Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

015290,000002:                                                                                                  ## Copyright:   Public domain.
015291,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
015292,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
015293,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
015294,000006:                                                                                                  ##              although several more revisions would follow. It has been
015295,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
015296,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
015297,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
015298,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
015299,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
015300,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
015301,000013:                                                                                                  ##              rather than the original YUL assembler.
015302,000014:                                                                                                  ## Reference:   p. 366
015303,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015304,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015305,000017:                                                                                                  ## Mod history: 05/11/03 RSB.   Began transcribing.
015306,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
015307,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
015308,000020:                                                                                                  ##                              original harcopy, as opposed to the PDF page
015309,000021:                                                                                                  ##                              numbers in 1701.pdf.
015310,000022:                                                                                                  ##              2017-02-23 RSB  Proofed comment text using octopus/ProoferComments.
015311,000023:                                                                                                  ##              2017-08-22 RSB  Fixed comment-text typo identified in ZERLINA 56.
015312,000024:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
015313,000025: 

Page 366

015315,000027: 15,2050                                           BANK     15                                    
015316,000028: 
015317,000029: 22,2000                                           SETLOC   KALCMON1                              
015318,000030: 22,2000                                           BANK                                           
015319,000031: 
015320,000032:                                                                                                  #  DETECTING GIMBAL LOCK
015321,000033: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
015322,000034: 
015323,000035: 22,2744           77614        NOGIMLOC           SET                                            
015324,000036: 22,2745           01074                                    CALCMAN3                              
015325,000037: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
015326,000038: 22,2747           01322                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
015327,000039: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
015328,000040: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
015329,000041: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
015330,000042:                                                                                                  #  ABOUT COF
015331,000043: 22,2753           74343                           DLOAD*   VXSC                                  
015332,000044: 22,2754           04772                                    ARATE,1                               
015333,000045: 22,2755           03270                                    COF                                   
015334,000046: 22,2756           17325                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
015335,000047: 22,2757           03335                                    AM                                    
015336,000048: 22,2760           55605                           DMP      DDV*                                  
015337,000049: 22,2761           05002                                    ANGLTIME                              
015338,000050: 22,2762           04772                                    ARATE,1                               
015339,000051: 22,2763           77661                           SR                                             
015340,000052: 22,2764           20606                                    5                                     
015341,000053: 22,2765           03333                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
015342,000054: 22,2766           77614                           SETGO                                          
015343,000055: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
015344,000056: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
015345,000057: 
015346,000058:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015347,000059:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
015348,000060: 
015349,000061: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC                 $ 22.5 DEG/SEC
015350,000062: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC                 $ 22.5 DEG/SEC
015351,000063: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC                 $ 22.5 DEG/SEC
015352,000064: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC                $ 22.5 DEG/SEC
015353,000065: 
015354,000066: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
015355,000067:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
015356,000068: 
015357,000069: 

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