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.

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

Page 403

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

Page 404

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