Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 97 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

014962,000002:                                                                                                  ## Copyright:   Public domain.
014963,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
014964,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
014965,000005:                                                                                                  ##              It is part of the reconstructed source code for the
014966,000006:                                                                                                  ##              second release of the flight software for the Lunar 
014967,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
014968,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
014969,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
014970,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
014971,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
014972,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
014973,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
014974,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
014975,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
014976,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
014977,000017:                                                                                                  ##              reconstruction is correct.
014978,000018:                                                                                                  ## Reference:   p.  364
014979,000019:                                                                                                  ## Assembler:   yaYUL
014980,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014981,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014982,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
014983,000023: 

Page 364

014985,000025: 15,2050                                           BANK     15                                    
014986,000026: 
014987,000027: 22,2000                                           SETLOC   KALCMON1                              
014988,000028: 22,2000                                           BANK                                           
014989,000029: 
014990,000030:                                                                                                  #  DETECTING GIMBAL LOCK
014991,000031: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
014992,000032: 
014993,000033: 22,2744           77614        NOGIMLOC           SET                                            
014994,000034: 22,2745           01074                                    CALCMAN3                              
014995,000035: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
014996,000036: 22,2747           01325                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
014997,000037: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
014998,000038: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
014999,000039: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
015000,000040:                                                                                                  #  ABOUT COF
015001,000041: 22,2753           74343                           DLOAD*   VXSC                                  
015002,000042: 22,2754           04772                                    ARATE,1                               
015003,000043: 22,2755           03271                                    COF                                   
015004,000044: 22,2756           17326                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
015005,000045: 22,2757           03336                                    AM                                    
015006,000046: 22,2760           55605                           DMP      DDV*                                  
015007,000047: 22,2761           05002                                    ANGLTIME                              
015008,000048: 22,2762           04772                                    ARATE,1                               
015009,000049: 22,2763           77661                           SR                                             
015010,000050: 22,2764           20606                                    5                                     
015011,000051: 22,2765           03334                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
015012,000052: 22,2766           77614                           SETGO                                          
015013,000053: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
015014,000054: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
015015,000055: 
015016,000056:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015017,000057:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
015018,000058: 
015019,000059: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC         $ 22.5 DEG/SEC
015020,000060: 
015021,000061: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC         $ 22.5 DEG/SEC
015022,000062: 
015023,000063: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC         $ 22.5 DEG/SEC
015024,000064: 
015025,000065: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC        $ 22.5 DEG/SEC
015026,000066: 
015027,000067: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
015028,000068:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
015029,000069: 
015030,000070: 

End of include-file GIMBAL_LOCK_AVOIDANCE.agc.  Parent file is MAIN.agc