Source Code

These source-code files were derived from scans of the Colossus 237 (Apollo 8 Command Module) program listing from the private collection of original AGC developer Fred Martin. Scanning was by Ron Burkey. Pre-existing Colossus 249 (Apollo 9 CM) source files were used as a template, and changes between Colossus 249 and Colossus 237 were manually transcribed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional 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 237 OF AGC PROGRAM COLOSSUS 
	BY NASA 2021111-031  1:17 AUG. 24, 1968
Note that the date is the date of the printout, not the date of the program revision.

017761,000002:                                                                                                  ## Copyright:   Public domain.
017762,000003:                                                                                                  ## Filename:    GIMBAL_LOCK_AVOIDANCE.agc
017763,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus build 237.  
017764,000005:                                                                                                  ##              This is for the Command Module's (CM) Apollo Guidance
017765,000006:                                                                                                  ##              Computer (AGC), for Apollo 8.
017766,000007:                                                                                                  ## Assembler:   yaYUL
017767,000008:                                                                                                  ## Contact:     Onno Hommes <ohommes@alumni.cmu.edu>
017768,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
017769,000010:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Colossus237/
017770,000011:                                                                                                  ## Mod history: 2010-06-01 OH   Adapted from corresponding Colossus 249 file.
017771,000012:                                                                                                  ##              2010-12-04 JL   Remove Colossus 249 header comments. Change 
017772,000013:                                                                                                  ##                              to double-hash page numbers.
017773,000014:                                                                                                  ##              2011-01-27 JL   Minor fixes.
017774,000015:                                                                                                  ##              2016-12-30 RSB  Proofed comment text using octopus/ProoferComments,
017775,000016:                                                                                                  ##                              and corrected errors found.
017776,000017: 

Page 403

017778,000019: 15,2000                                           BANK     15                                    
017779,000020: 22,2000                                           SETLOC   KALCMON1                              
017780,000021: 22,2000                                           BANK                                           
017781,000022: 
017782,000023: 22,2736  E6,1661                                  EBANK=   BCDU                                  
017783,000024: 
017784,000025:                                                                                                  #  DETECTING GIMBAL LOCK
017785,000026: 22,2736  22,2736               LOCSKIRT           EQUALS   NOGIMLOC                              
017786,000027: 
017787,000028: 22,2736           77614        NOGIMLOC           SET                                            
017788,000029: 22,2737           01074                                    CALCMAN3                              
017789,000030: 22,2740           70740        WCALC              LXC,1    DLOAD*                                
017790,000031: 22,2741           01130                                    RATEINDX                              
017791,000032: 22,2742           04772                                    ARATE,1                               
017792,000033: 22,2743           45002                           SR4      CALL                                  #  COMPUTE THE INCREMENTAL ROTATION MATRIX
017793,000034: 22,2744           44530                                    DELCOMP                               #  DEL CORRESPONDING TO A 1 SEC ROTATION
017794,000035:                                                                                                  #                                          ABOUT COF
017795,000036: 22,2745           74343                           DLOAD*   VXSC                                  
017796,000037: 22,2746           04772                                    ARATE,1                               
017797,000038: 22,2747           03343                                    COF                                   
017798,000039: 22,2750           77721                           MXV                                            
017799,000040: 22,2751           05004                                    QUADROT                               
017800,000041: 22,2752           17311                           STODL    BRATE                                 
017801,000042: 22,2753           03365                                    AM                                    
017802,000043: 22,2754           55605                           DMP      DDV*                                  
017803,000044: 22,2755           05002                                    ANGLTIME                              
017804,000045: 22,2756           04772                                    ARATE,1                               
017805,000046: 22,2757           77661                           SR                                             
017806,000047: 22,2760           20606                                    5                                     
017807,000048: 22,2761           27317                           STOVL    TM                                    
017808,000049: 22,2762           03311                                    BRATE                                 
017809,000050: 22,2763           77761                           VXSC                                           
017810,000051: 22,2764           05026                                    BIASCALE                              
017811,000052: 22,2765           03275                           STORE    BIASTEMP                              #  ATTITUDE ERROR BIAS TO PREVENT OVERSHOOT
017812,000053:                                                                                                  #                                          IN SYSTEM
017813,000054: 22,2766           77614                           SETGO                                          #  STATE SWITCH CALCMAN2 (43D)
017814,000055: 22,2767           01035                                    CALCMAN2                              #  0(OFF) = BYPASS STARTING PROCEDURE
017815,000056: 22,2770           45033                                    NEWANGL    +1                         #  1(ON) = START MANEUVER
017816,000057: 
017817,000058: 
017818,000059: 22,2771           00044 15053  ARATE              2DEC     .0022222222                            #  = .05 DEG/SEC
017819,000060: 22,2773           00221 24255                     2DEC     .0088888889                            #  = .2 DEG/SEC
017820,000061: 22,2775           00554 02660                     2DEC     .0222222222                            #  = .5 DEG/SEC
017821,000062: 22,2777           05540 26603                     2DEC     .1777777777                            #  = 4 DEG/SEC               $ 22.5 DEG/SEC
017822,000063: 22,3001           00003 04000  ANGLTIME           2DEC     .000190735                            #  = 100B - 19 
017823,000064:                                                                                                  #                                          MANEUVER ANGLE TO MANEUVER TIME

Page 404

017825,000066: 22,3003           03146 14632  QUADROT            2DEC     .1                                    #  ROTATION MATRIX FROM S/C AXES TO CONTROL
017826,000067: 22,3005           00000 00000                     2DEC     0          B-28                       #  AXES  (X ROT = -7.25 DEG)
017827,000068: 22,3007           00000 00000                     2DEC     0          B-28                       
017828,000069: 22,3011           00000 00000                     2DEC     0          B-28                       
017829,000070: 22,3013           03131 11275                     2DEC     .099200                               #  =(.1)COS7.25
017830,000071: 22,3015           77461 47370                     2DEC     -.012620                              #  =-(.1)SIN7.25
017831,000072: 22,3017           00000 00000                     2DEC     0          B-28                       
017832,000073: 22,3021           00316 30407                     2DEC     .012620                               #  (.1)SIN7.25
017833,000074: 22,3023           03131 11275                     2DEC     .099200                               #  (.1)COS7.25
017834,000075: 22,3025           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