GIMBAL_LOCK_AVOIDANCE.agc
### FILE="Main.annotation"
## Copyright: Public domain.
## Filename: GIMBAL_LOCK_AVOIDANCE.agc
## Purpose: Part of the source code for Colossus, build 249.
## It is part of the source code for the Command Module's (CM)
## Apollo Guidance Computer (AGC), for Apollo 9.
## Assembler: yaYUL
## Reference: pp. 405-406.
## Contact: Ron Burkey <info@sandroid.org>.
## Website: www.ibiblio.org/apollo.
## Mod history: 08/10/04 RSB. Began transcribing.
## 2017-01-06 RSB Page numbers now agree with those on the
## original harcopy, as opposed to the PDF page
## numbers in 1701.pdf.
## 2017-01-14 RSB Cross-diff'd comment text (not whitespace)
## vs the already-proofed corresponding Colossus
## 237 and Comanche 55 source-code files
## and corrected errors found.
##
## The contents of the "Colossus249" files, in general, are transcribed
## from a scanned copy of the program listing. Notations on this
## document read, in part:
##
## Assemble revision 249 of AGC program Colossus by NASA
## 2021111-041. October 28, 1968.
##
## This AGC program shall also be referred to as
## Colossus 1A
##
## Prepared by
## Massachusetts Institute of Technology
## 75 Cambridge Parkway
## Cambridge, Massachusetts
## under NASA contract NAS 9-4065.
##
## Refer directly to the online document mentioned above for further information.
## Please report any errors (relative to the scanned pages) to info@sandroid.org.
##
## In some cases, where the source code for Luminary 131 overlaps that of
## Colossus 249, this code is instead copied from the corresponding Luminary 131
## source file, and then is proofed to incorporate any changes.
## Page 405
BANK 15
SETLOC KALCMON1
BANK
EBANK= BCDU
# DETECTING GIMBAL LOCK
LOCSKIRT EQUALS NOGIMLOC
NOGIMLOC SET
CALCMAN3
WCALC LXC,1 DLOAD*
RATEINDX
ARATE,1
SR4 CALL # COMPUTE THE INCREMENTAL ROTATION MATRIX
DELCOMP # DEL CORRESPONDING TO A 1 SEC ROTATION
# ABOUT COF
DLOAD* VXSC
ARATE,1
COF
MXV
QUADROT
STODL BRATE
AM
DMP DDV*
ANGLTIME
ARATE,1
SR
5
STOVL TM
BRATE
VXSC
BIASCALE
STORE BIASTEMP # ATTITUDE ERROR BIAS TO PREVENT OVERSHOOT
# IN SYSTEM
SETGO # STATE SWITCH CALCMAN2 (43D)
CALCMAN2 # 0(OFF) = BYPASS STARTING PROCEDURE
NEWANGL +1 # 1(ON) = START MANEUVER
ARATE 2DEC .0022222222 # = .05 DEG/SEC
2DEC .0088888889 # = .2 DEG/SEC
2DEC .0222222222 # = .5 DEG/SEC
2DEC .1777777777 # = 4 DEG/SEC $ 22.5 DEG/SEC
ANGLTIME 2DEC .000190735 # = 100B-19
# MANEUVER ANGLE TO MANEUVER TIME
## Page 406
QUADROT 2DEC .1 # ROTATION MATRIX FROM S/C AXES TO CONTROL
2DEC 0 # AXES (X ROT = -7.25 DEG)
2DEC 0
2DEC 0
2DEC .099200 # = (.1)COS7.25
2DEC -.012620 # =-(.1)SIN7.25
2DEC 0
2DEC .012620 # (.1)SIN7.25
2DEC .099200 # (.1)COS7.25
BIASCALE 2DEC .0002543132 # = (450/180)(1/0.6)(1/16384)