Source Code

These source-code files are part of a reconstructed copy of Luminary 163, the first (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 163 listing would be different.

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.

015730,000002:                                                                                                  ## Copyright:   Public domain.
015731,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
015732,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
015733,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
015734,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
015735,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
015736,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
015737,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
015738,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
015739,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
015740,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
015741,000013:                                                                                                  ##              that the reconstruction is correct.
015742,000014:                                                                                                  ## Reference:   p.  369
015743,000015:                                                                                                  ## Assembler:   yaYUL
015744,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015745,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015746,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
015747,000019: 

Page 369

015749,000021: 15,2050                                           BANK     15                                    
015750,000022: 
015751,000023: 22,2000                                           SETLOC   KALCMON1                              
015752,000024: 22,2000                                           BANK                                           
015753,000025: 
015754,000026: 
015755,000027:                                                                                                  #  DETECTING GIMBAL LOCK
015756,000028: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
015757,000029: 
015758,000030: 22,2744           77614        NOGIMLOC           SET                                            
015759,000031: 22,2745           01074                                    CALCMAN3                              
015760,000032: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
015761,000033: 22,2747           01322                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
015762,000034: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
015763,000035: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
015764,000036: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
015765,000037:                                                                                                  #  ABOUT COF
015766,000038: 22,2753           74343                           DLOAD*   VXSC                                  
015767,000039: 22,2754           04772                                    ARATE,1                               
015768,000040: 22,2755           03270                                    COF                                   
015769,000041: 22,2756           17325                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
015770,000042: 22,2757           03335                                    AM                                    
015771,000043: 22,2760           55605                           DMP      DDV*                                  
015772,000044: 22,2761           05002                                    ANGLTIME                              
015773,000045: 22,2762           04772                                    ARATE,1                               
015774,000046: 22,2763           77661                           SR                                             
015775,000047: 22,2764           20606                                    5                                     
015776,000048: 22,2765           03333                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
015777,000049: 22,2766           77614                           SETGO                                          
015778,000050: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
015779,000051: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
015780,000052:                                                                                                  #           THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015781,000053:                                                                                                  #           LOADING RATEINDX WITH 0,2,4,6, RESPECTIVELY
015782,000054: 
015783,000055: 
015784,000056: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC       $ 22.5 DEG/SEC
015785,000057: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC       $ 22.5 DEG/SEC
015786,000058: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC       $ 22.5 DEG/SEC
015787,000059: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC      $ 22.5 DEG/SEC
015788,000060: 
015789,000061: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19     FUDGE FACTOR TO CONVERT
015790,000062:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME

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