Source Code

These source-code files are part of a reconstructed copy of Artemis 071, the first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 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.

018402,000002:                                                                                                  ## Copyright:   Public domain.
018403,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
018404,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
018405,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
018406,000006:                                                                                                  ##              release of the flight software for the Command Module's
018407,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
018408,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
018409,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
018410,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
018411,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
018412,000012:                                                                                                  ##              that the reconstruction is correct.
018413,000013:                                                                                                  ## Reference:   416
018414,000014:                                                                                                  ## Assembler:   yaYUL
018415,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
018416,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
018417,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
018418,000018: 

Page 416

018420,000020: 
018421,000021: 22,2000                                           SETLOC   KALCMON1                              
018422,000022: 22,2000                                           BANK                                           
018423,000023: 
018424,000024: 22,2745                                           COUNT*   $$/KALC                               
018425,000025: 22,2745  E6,1661                                  EBANK=   BCDU                                  
018426,000026: 
018427,000027:                                                                                                  #  DETECTING GIMBAL LOCK
018428,000028: 22,2745  22,2745               LOCSKIRT           EQUALS   WCALC                                 
018429,000029: 22,2745           70740        WCALC              LXC,1    DLOAD*                                
018430,000030: 22,2746           00774                                    RATEINDX                              
018431,000031: 22,2747           05002                                    ARATE,1                               
018432,000032: 22,2750           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
018433,000033: 22,2751           44522                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
018434,000034:                                                                                                  #  ABOUT COF
018435,000035: 22,2752           74343                           DLOAD*   VXSC                                  
018436,000036: 22,2753           05002                                    ARATE,1                               
018437,000037: 22,2754           03343                                    COF                                   
018438,000038: 22,2755           77721                           MXV                                            
018439,000039: 22,2756           05014                                    QUADROT                               
018440,000040: 22,2757           17311                           STODL    BRATE                                 
018441,000041: 22,2760           03365                                    AM                                    
018442,000042: 22,2761           55605                           DMP      DDV*                                  
018443,000043: 22,2762           05012                                    ANGLTIME                              
018444,000044: 22,2763           05002                                    ARATE,1                               
018445,000045: 22,2764           77661                           SR                                             
018446,000046: 22,2765           20606                                    5                                     
018447,000047: 22,2766           03317                           STORE    TM                                    
018448,000048: 22,2767           77214                           BON      VLOAD                                 
018449,000049: 22,2770           00313                                    CYC61FLG                              
018450,000050: 22,2771           71747                                    RCYCLR61                              
018451,000051: 22,2772           03311                                    BRATE                                 
018452,000052: 22,2773           77761                           VXSC                                           
018453,000053: 22,2774           05036                                    BIASCALE                              
018454,000054: 22,2775           03275                           STORE    BIASTEMP                              #  ATTITUDE ERROR BIAS TO PREVENT OVERSHOOT
018455,000055:                                                                                                  #  IN SYSTEM
018456,000056: 22,2776           77614                           SETGO                                          #  STATE SWITCH CALCMAN2 (43D)
018457,000057: 22,2777           01035                                    CALCMAN2                              #  0(OFF) = BYPASS STARTING PROCEDURE
018458,000058: 22,3000           45053                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
018459,000059: 
018460,000060: 
018461,000061: 22,3001           00044 15053  ARATE              2DEC     .0022222222                            #  = .05 DEG/SEC
018462,000062: 22,3003           00221 24255                     2DEC     .0088888889                            #  = .2 DEG/SEC
018463,000063: 22,3005           00554 02660                     2DEC     .0222222222                            #  = .5 DEG/SEC
018464,000064: 22,3007           02660 13301                     2DEC     .0888888889                            #  = 2 DEG/SEC                $22.5 DEG/SEC
018465,000065: 22,3011           00003 04000  ANGLTIME           2DEC     .000190735                            #  = 100B - 19
018466,000066:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME

Page 417

018468,000068: 22,3013           03146 14632  QUADROT            2DEC     .1                                    #  ROTATION MATRIX FROM S/C AXES TO CONTROL
018469,000069: 22,3015           00000 00000                     2DEC     0          B-28                       #  AXES (X ROT = -7.25 DEG)
018470,000070: 22,3017           00000 00000                     2DEC     0          B-28                       
018471,000071: 22,3021           00000 00000                     2DEC     0          B-28                       
018472,000072: 22,3023           03131 11275                     2DEC     .099200                               #  =(.1)COS7.25
018473,000073: 22,3025           77461 47370                     2DEC     -.012620                              #  =-(.1)SIN7.25
018474,000074: 22,3027           00000 00000                     2DEC     0          B-28                       
018475,000075: 22,3031           00316 30407                     2DEC     .012620                               #  (.1)SIN7.25
018476,000076: 22,3033           03131 11275                     2DEC     .099200                               #  (.1)COS7.25
018477,000077: 22,3035           00004 05253  BIASCALE           2DEC     .0002543132                            #  = (450/180)(1/0.6)(1/16384)

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