Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

015259,000002:                                                                                                  ## Copyright:   Public domain.
015260,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
015261,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
015262,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
015263,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
015264,000007:                                                                                                  ## Assembler:   yaYUL
015265,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015266,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
015267,000010:                                                                                                  ## Pages:       364
015268,000011:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
015269,000012:                                                                                                  ##                              Luminary131 file, using page 
015270,000013:                                                                                                  ##                              images from Luminary 1A.
015271,000014:                                                                                                  ##              2010-12-31 JL   Fixed page number comment.
015272,000015:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
015273,000016:                                                                                                  ##                              but no errors found.
015274,000017:                                                                                                  ##              2017-08-22 RSB  Fixed comment-text typo identified in ZERLINA 56.
015275,000018:                                                                                                  ##
015276,000019:                                                                                                  ## This source code has been transcribed or otherwise adapted from
015277,000020:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
015278,000021:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
015279,000022:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
015280,000023:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
015281,000024:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
015282,000025:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
015283,000026:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
015284,000027:                                                                                                  ## actually created.
015285,000028:                                                                                                  ##
015286,000029:                                                                                                  ## Notations on the hardcopy document read, in part:
015287,000030:                                                                                                  ##
015288,000031:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
015289,000032:                                                                                                  ##      16:27 JULY 14, 1969 
015290,000033: 

Page 364

015292,000035: 15,2050                                           BANK     15                                    
015293,000036: 
015294,000037: 22,2000                                           SETLOC   KALCMON1                              
015295,000038: 22,2000                                           BANK                                           
015296,000039: 
015297,000040:                                                                                                  #  DETECTING GIMBAL LOCK
015298,000041: 22,2744  22,2744               LOCSKIRT           EQUALS   NOGIMLOC                              
015299,000042: 
015300,000043: 22,2744           77614        NOGIMLOC           SET                                            
015301,000044: 22,2745           01074                                    CALCMAN3                              
015302,000045: 22,2746           70740        WCALC              LXC,1    DLOAD*                                
015303,000046: 22,2747           01325                                    RATEINDX                              #  CHOOSE THE DESIRED MANEUVER RATE
015304,000047: 22,2750           04772                                    ARATE,1                               #  FROM A LIST OF FOUR
015305,000048: 22,2751           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
015306,000049: 22,2752           44527                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
015307,000050:                                                                                                  #  ABOUT COF
015308,000051: 22,2753           74343                           DLOAD*   VXSC                                  
015309,000052: 22,2754           04772                                    ARATE,1                               
015310,000053: 22,2755           03271                                    COF                                   
015311,000054: 22,2756           17326                           STODL    BRATE                                 #  COMPONENT MANEUVER RATES 45 DEG/SEC
015312,000055: 22,2757           03336                                    AM                                    
015313,000056: 22,2760           55605                           DMP      DDV*                                  
015314,000057: 22,2761           05002                                    ANGLTIME                              
015315,000058: 22,2762           04772                                    ARATE,1                               
015316,000059: 22,2763           77661                           SR                                             
015317,000060: 22,2764           20606                                    5                                     
015318,000061: 22,2765           03334                           STORE    TM                                    #  MANEUVER EXECUTION TIME SCALED AS T2
015319,000062: 22,2766           77614                           SETGO                                          
015320,000063: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = CONTINUE MANEUVER
015321,000064: 22,2770           45010                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
015322,000065: 
015323,000066:                                                                                                  #  THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
015324,000067:                                                                                                  #  LOADING RATEINDX WITH 0, 2, 4, 6, RESPECTIVELY
015325,000068: 
015326,000069: 22,2771           00221 24255  ARATE              2DEC     .0088888888                            #  = 0.2 DEG/SEC         $ 22.5 DEG/SEC
015327,000070: 
015328,000071: 22,2773           00554 02660                     2DEC     .0222222222                            #  = 0.5 DEG/SEC         $ 22.5 DEG/SEC
015329,000072: 
015330,000073: 22,2775           02660 13301                     2DEC     .0888888888                            #  = 2.0 DEG/SEC         $ 22.5 DEG/SEC
015331,000074: 
015332,000075: 22,2777           16161 30707                     2DEC     .4444444444                            #  = 10.0 DEG/SEC        $ 22.5 DEG/SEC
015333,000076: 
015334,000077: 22,3001           00003 04000  ANGLTIME           2DEC     .0001907349                            #  = 100B-19 FUDGE FACTOR TO CONVERT
015335,000078:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
015336,000079: 
015337,000080: 

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