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 Colossus 249 (Apollo 9) 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 055 OF AGC PROGRAM COMANCHE BY NASA 2021113-051
	10:28 APR.  1,1969
Note that the date is the date of the printout, not the date of the program revision.

018059,000002:                                                                                                  ## Copyright:   Public domain.
018060,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
018061,000004:                                                                                                  ## Purpose:     Part of the source code for Comanche, build 055.
018062,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
018063,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), Apollo 11.
018064,000007:                                                                                                  ## Assembler:   yaYUL
018065,000008:                                                                                                  ## Reference:   pp. 412-413
018066,000009:                                                                                                  ## Contact:     Onno Hommes <ohommes@cmu.edu>.
018067,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
018068,000011:                                                                                                  ## Mod history: 05/07/09 OH     Transcription Batch 1 Assignment 
018069,000012:                                                                                                  ##              2016-12-10 RSB  Proofed comments with octopus/ProoferComments
018070,000013:                                                                                                  ##                              and fixed the errors found.
018071,000014:                                                                                                  ##
018072,000015:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
018073,000016:                                                                                                  ## from scanned documents. 
018074,000017:                                                                                                  ##
018075,000018:                                                                                                  ##      Assemble revision 055 of AGC program Comanche by NASA
018076,000019:                                                                                                  ##      2021113-051.  April 1, 1969.  
018077,000020:                                                                                                  ##
018078,000021:                                                                                                  ##      This AGC program shall also be referred to as Colossus 2A
018079,000022:                                                                                                  ##
018080,000023:                                                                                                  ##      Prepared by
018081,000024:                                                                                                  ##                      Massachusetts Institute of Technology
018082,000025:                                                                                                  ##                      75 Cambridge Parkway
018083,000026:                                                                                                  ##                      Cambridge, Massachusetts
018084,000027:                                                                                                  ##
018085,000028:                                                                                                  ##      under NASA contract NAS 9-4065.
018086,000029:                                                                                                  ##
018087,000030:                                                                                                  ## Refer directly to the online document mentioned above for further information.
018088,000031:                                                                                                  ## Please report any errors to info@sandroid.org.
018089,000032: 
018090,000033: 

Page 412

018092,000035: 15,2000                                           BANK     15                                    
018093,000036: 22,2000                                           SETLOC   KALCMON1                              
018094,000037: 22,2000                                           BANK                                           
018095,000038: 
018096,000039: 22,2737  E6,1661                                  EBANK=   BCDU                                  
018097,000040: 
018098,000041:                                                                                                  #  DETECTING GIMBAL LOCK
018099,000042: 22,2737  22,2737               LOCSKIRT           EQUALS   WCALC                                 
018100,000043: 22,2737           70740        WCALC              LXC,1    DLOAD*                                
018101,000044: 22,2740           01130                                    RATEINDX                              
018102,000045: 22,2741           04771                                    ARATE,1                               
018103,000046: 22,2742           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
018104,000047: 22,2743           44530                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
018105,000048:                                                                                                  #  ABOUT COF
018106,000049: 22,2744           74343                           DLOAD*   VXSC                                  
018107,000050: 22,2745           04771                                    ARATE,1                               
018108,000051: 22,2746           03343                                    COF                                   
018109,000052: 22,2747           77721                           MXV                                            
018110,000053: 22,2750           05003                                    QUADROT                               
018111,000054: 22,2751           17311                           STODL    BRATE                                 
018112,000055: 22,2752           03365                                    AM                                    
018113,000056: 22,2753           55605                           DMP      DDV*                                  
018114,000057: 22,2754           05001                                    ANGLTIME                              
018115,000058: 22,2755           04771                                    ARATE,1                               
018116,000059: 22,2756           77661                           SR                                             
018117,000060: 22,2757           20606                                    5                                     
018118,000061: 22,2760           27317                           STOVL    TM                                    
018119,000062: 22,2761           03311                                    BRATE                                 
018120,000063: 22,2762           77761                           VXSC                                           
018121,000064: 22,2763           05025                                    BIASCALE                              
018122,000065: 22,2764           03275                           STORE    BIASTEMP                              #  ATTITUDE ERROR BIAS TO PREVENT OVERSHOOT
018123,000066:                                                                                                  #  IN SYSTEM
018124,000067: 22,2765           77614                           SETGO                                          #  STATE SWITCH CALCMAN2 (43D)
018125,000068: 22,2766           01035                                    CALCMAN2                              #  0(OFF) = BYPASS STARTING PROCEDURE
018126,000069: 22,2767           45032                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
018127,000070: 
018128,000071: 
018129,000072: 22,2770           00044 15053  ARATE              2DEC     .0022222222                            #  = .05 DEG/SEC
018130,000073: 
018131,000074: 22,2772           00221 24255                     2DEC     .0088888889                            #  = .2 DEG/SEC
018132,000075: 
018133,000076: 22,2774           00554 02660                     2DEC     .0222222222                            #  = .5 DEG/SEC
018134,000077: 
018135,000078: 22,2776           02660 13301                     2DEC     .0888888889                            #  = 2 DEG/SEC                $22.5 DEG/SEC
018136,000079: 
018137,000080: 22,3000           00003 04000  ANGLTIME           2DEC     .000190735                            #  = 100B - 19
018138,000081: 
018139,000082:                                                                                                  #  MANEUVER ANGLE TO MANEUVER TIME
018140,000083: 22,3002           03146 14632  QUADROT            2DEC     .1                                    #  ROTATION MATRIX FROM S/C AXES TO CONTROL
018141,000084: 

Page 413

018143,000086: 22,3004           00000 00000                     2DEC     0          B-28                       #  AXES (X ROT = -7.25 DEG)
018144,000087: 
018145,000088: 22,3006           00000 00000                     2DEC     0          B-28                       
018146,000089: 
018147,000090: 22,3010           00000 00000                     2DEC     0          B-28                       
018148,000091: 
018149,000092: 22,3012           03131 11275                     2DEC     .099200                               #  =(.1)COS7.25
018150,000093: 
018151,000094: 22,3014           77461 47370                     2DEC     -.012620                              #  =-(.1)SIN7.25
018152,000095: 
018153,000096: 22,3016           00000 00000                     2DEC     0          B-28                       
018154,000097: 
018155,000098: 22,3020           00316 30407                     2DEC     .012620                               #  (.1)SIN7.25
018156,000099: 
018157,000100: 22,3022           03131 11275                     2DEC     .099200                               #  (.1)COS7.25
018158,000101: 
018159,000102: 22,3024           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