Source Code
These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9
LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of
original core rope program modules, as follows:
|
058478,000002: ## Copyright: Public domain.
058479,000003: ## Filename: TRIM_GIMBAL_CONTROL_SYSTEM.agc
058480,000004: ## Purpose: A section of an attempt to reconstruct Sundance revision 306
058481,000005: ## as closely as possible with available information. Sundance
058482,000006: ## 306 is the source code for the Lunar Module's (LM) Apollo
058483,000007: ## Guidance Computer (AGC) for Apollo 9. This program was created
058484,000008: ## using the mixed-revision SundanceXXX as a starting point, and
058485,000009: ## pulling back features from Luminary 69 believed to have been
058486,000010: ## added based on memos, checklists, observed address changes,
058487,000011: ## or the Sundance GSOPs.
058488,000012: ## Assembler: yaYUL
058489,000013: ## Contact: Ron Burkey <info@sandroid.org>.
058490,000014: ## Website: www.ibiblio.org/apollo/index.html
058491,000015: ## Mod history: 2020-07-24 MAS Created from SundanceXXX.
058492,000016: ## 2021-05-30 ABS GTSGO+DN -> GTSGO+ON
058493,000017: ## MAXISHIFT -> MAXISHFT
058494,000018: ## MINISHIFT -> MINISHFT
058495,000019:
058496,000020:
058497,000021:
058498,000022: 21,3055 BANK 21
058499,000023: 21,3055 E6,1451 EBANK= QDIFF
058500,000024: 21,2000 SETLOC DAPS4
058501,000025: 21,2000 BANK
058502,000026:
058503,000027: 21,3055 COUNT* $$/DAPGT
058504,000028:
058505,000029: # CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
058506,000030: # AUTOPILOT ARE BOTH ON:
058507,000031: # A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
058508,000032: # INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
058509,000033: # B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
058510,000034: # ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
058511,000035: # GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
058512,000036:
058513,000037: 21,3055 37721 GTS CAF NEGONE # MAKE THE NEXT PASS THROUGH THE DAP BE
058514,000038: 21,3056 55625 TS COTROLER # THROUGH RCS CONTROL,
058515,000039: 21,3057 35024 CAF FOUR # AND ENSURE THAT IT IS NOT A SKIP.
058516,000040: 21,3060 55530 TS SKIPU
058517,000041: 21,3061 55531 TS SKIPV
058518,000042:
058519,000043: 21,3062 35025 CAF TWO
058520,000044: 21,3063 55627 TS INGTS # SET INDICATOR OF GTS CONTROL POSITIVE.
058521,000045: 21,3064 55626 TS QGIMTIMR # SET TIMERS TO 200 MSEC TO AVOID BOTH
058522,000046: 21,3065 55630 TS RGIMTIMR # RUNAWAY AND INTERFERENCE BY NULLING.
058523,000047:
058524,000048: # THE DRIVE SETTING ALGORITHM
058525,000049:
058526,000050: # DEL = SGN(OMEGA*K + ALPHA*ABS(ALPHA)/2).
058527,000051:
058528,000052: # NEGUSUM = ERROR.K(2) + DEL(OMEGA.K.DEL + ALPHA(2)/2)(3/2) + ALPHA(OMEGA.K.DEL + ALPHA(2)/3)
058529,000053:
058530,000054: # DRIVE = -SGN(NEGUSUM)
058531,000055:
058532,000056: 21,3066 30021 CA SR # SAVE THE SR. SHIFT IT LEFT TO CORRECT
058533,000057: 21,3067 60000 AD A # FOR THE RIGHT SHIFT DUE TO EDITING.
058534,000058: 21,3070 55471 TS SAVESR
058535,000059:
058536,000060: 21,3071 35025 GTSGO+ON CAF TWO # SET INDEXER FOR R-AXIS CALCULATIONS.
058537,000061: 21,3072 55745 TS QRCNTR
058538,000062: 21,3073 31534 CA AOSR
058539,000063: 21,3074 00006 EXTEND
058540,000064: 21,3075 75024 MP BIT3
058541,000065: 21,3076 31435 CA EDOTR
058542,000066: 21,3077 13106 TCF GTSQAXIS
058543,000067:
058544,000068: 21,3100 35030 GOQTRIMG CAF ZERO # SET INDEXER FOR Q-AXIS CALCULATIONS
058545,000069: 21,3101 55745 TS QRCNTR
058546,000070: 21,3102 31532 CA AOSQ
058547,000071: 21,3103 00006 EXTEND
058548,000072: 21,3104 75024 MP BIT3
058549,000073: 21,3105 31434 CA EDOTQ
058550,000074: 21,3106 53743 GTSQAXIS DXCH WCENTRAL
058551,000075: 21,3107 00006 EXTEND
058552,000076: 21,3110 51745 INDEX QRCNTR # PICK UP K AND K(2) FOR THIS AXIS
058553,000077: 21,3111 31504 DCA KQ
058554,000078: 21,3112 53741 DXCH KCENTRAL
058555,000079:
058556,000080: 21,3113 11745 CCS QRCNTR
058557,000081: 21,3114 50000 INDEX A # QDIFF, RDIFF ARE STORED IN D.P.
058558,000082: 21,3115 31451 CAE QDIFF
058559,000083:
058560,000084: 21,3116 00006 ALGORTHM EXTEND # Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
058561,000085: 21,3117 71741 MP K2CNTRAL # FORM K(2)*THETA IN D.P.
058562,000086: 21,3120 23734 LXCH K2THETA
058563,000087: 21,3121 00006 EXTEND # FORM K(2)*THETA*SF2 IN D.P.
058564,000088: 21,3122 75016 MP BIT9
058565,000089: 21,3123 53735 DXCH K2THETA
058566,000090: 21,3124 00006 EXTEND
058567,000091: 21,3125 75016 MP BIT9
058568,000092: 21,3126 27735 ADS K2THETA +1
058569,000093:
058570,000094: 21,3127 31742 CAE WCENTRAL # GET OMEGA
058571,000095: 21,3130 00006 EXTEND
058572,000096: 21,3131 71740 MP KCENTRAL # FORM K*OMEGA IN D.P.
058573,000097: 21,3132 23740 LXCH OMEGA.K
058574,000098: 21,3133 00006 EXTEND # FORM OMEGA*K*SF1 IN D.P.
058575,000099: 21,3134 75013 MP BIT12
058576,000100: 21,3135 53741 DXCH OMEGA.K
058577,000101: 21,3136 00006 EXTEND
058578,000102: 21,3137 75013 MP BIT12
058579,000103: 21,3140 27741 ADS OMEGA.K +1
058580,000104:
058581,000105: 21,3141 31743 CAE ACENTRAL # FORM ALPHA(2)/2 IN D.P.
058582,000106: 21,3142 00006 EXTEND
058583,000107: 21,3143 70000 SQUARE
058584,000108: 21,3144 53737 DXCH A2CNTRAL
058585,000109:
058586,000110: 21,3145 31743 CAE ACENTRAL # GET ALPHA*ABS(ALPHA)/2, IF ALPHA GREATER
058587,000111: # THAN 0. OTHERWISE TAKE NEGATIVE OF ABOVE
058588,000112: 21,3146 00006 EXTEND
058589,000113: 21,3147 63153 BZMF +4
058590,000114: 21,3150 00006 EXTEND
058591,000115: 21,3151 31737 DCA A2CNTRAL
058592,000116: 21,3152 13155 TCF +3
058593,000117: 21,3153 00006 EXTEND
058594,000118: 21,3154 41737 DCS A2CNTRAL
058595,000119: 21,3155 53474 DXCH FUNCTION # SAVE AS SGN(ALPHA)*ALPHA(2)/2
058596,000120: 21,3156 00006 EXTEND
058597,000121: 21,3157 31741 DCA OMEGA.K
058598,000122: 21,3160 21474 DAS FUNCTION # FORM FUNCT1
058599,000123:
058600,000124: 21,3161 11473 CCS FUNCTION # DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
058601,000125: 21,3162 13166 TCF POSFNCT1 # OTHERWISE DEL = -1
058602,000126: 21,3163 13165 TCF +2
058603,000127: 21,3164 13170 TCF NEGFNCT1
058604,000128:
058605,000129: 21,3165 11474 CCS FUNCTION +1 # USE LOW ORDER WORD SINCE HIGH IS ZERO
058606,000130: 21,3166 35026 POSFNCT1 CAF BIT1
058607,000131: 21,3167 13171 TCF +2
058608,000132: 21,3170 45026 NEGFNCT1 CS BIT1
058609,000133: 21,3171 55744 TS DEL
058610,000134:
058611,000135: 21,3172 11744 CCS DEL # MAKE OMEGA*K REALLY DEL*OMEGA*K
058612,000136: 21,3173 13200 TCF FUNCT2 # (NOTHING NEED BE DONE)
058613,000137: 21,3174 13200 TCF FUNCT2
058614,000138: 21,3175 00006 EXTEND
058615,000139: 21,3176 41741 DCS OMEGA.K
058616,000140: 21,3177 53741 DXCH OMEGA.K # CHANGE SIGN OF OMEGA*K
058617,000141:
058618,000142: 21,3200 00006 FUNCT2 EXTEND
058619,000143: 21,3201 31741 DCA OMEGA.K
058620,000144: 21,3202 53474 DXCH FUNCTION # DEL*OMEGA*K
058621,000145: 21,3203 00006 EXTEND
058622,000146: 21,3204 31737 DCA A2CNTRAL
058623,000147: 21,3205 21474 DAS FUNCTION # DEL*OMEGA*K + ALPHA(2)/2
058624,000148: 21,3206 31736 FUNCT3 CAE A2CNTRAL # CALCULATE (2/3)*ALPHA(2)/2 = ALPHA(2)/3
058625,000149: 21,3207 00006 EXTEND
058626,000150: 21,3210 73302 MP .66667
058627,000151: 21,3211 53737 DXCH A2CNTRAL
058628,000152: 21,3212 56001 XCH L
058629,000153: 21,3213 00006 EXTEND
058630,000154: 21,3214 73302 MP .66667
058631,000155: 21,3215 27737 ADS A2CNTRAL +1
058632,000156: 21,3216 54001 TS L
058633,000157: 21,3217 13221 TCF +2
058634,000158: 21,3220 27736 ADS A2CNTRAL
058635,000159: 21,3221 53741 DXCH OMEGA.K # DEL*OMEGA*K + ALPHA(2)/3 = G
058636,000160: 21,3222 21737 DAS A2CNTRAL
058637,000161: 21,3223 31736 CAE A2CNTRAL # G*ALPHA IN D.P.
058638,000162: 21,3224 00006 EXTEND
058639,000163: 21,3225 71743 MP ACENTRAL
058640,000164: 21,3226 53737 DXCH A2CNTRAL
058641,000165: 21,3227 56001 XCH L
058642,000166: 21,3230 00006 EXTEND
058643,000167: 21,3231 71743 MP ACENTRAL
058644,000168: 21,3232 27737 ADS A2CNTRAL +1
058645,000169: 21,3233 54001 TS L
058646,000170: 21,3234 13236 TCF +2
058647,000171: 21,3235 27736 ADS A2CNTRAL
058648,000172:
058649,000173: 21,3236 53737 DXCH A2CNTRAL # FIRST AND THIRD TERMS
058650,000174: 21,3237 21735 DAS K2THETA # SUMMED IN D.P.
058651,000175:
058652,000176: 21,3240 13410 TCF RSTOFGTS
058653,000177:
058654,000178: # THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
058655,000179: # THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES. ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
058656,000180:
058657,000181: # WARNING: ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
058658,000182:
058659,000183: 21,3241 07400 BGIM OCTAL 07400
058660,000184: 21,3242 0066 CHNL12 EQUALS ITEMP6
058661,000185: 21,3242 31102 ACDT+C12 CA DAPBOOLS
058662,000186: 21,3243 75011 MASK USEQRJTS
058663,000187: 21,3244 00006 EXTEND
058664,000188: 21,3245 13251 BZF +4
058665,000189: 21,3246 35030 CAF ZERO
058666,000190: 21,3247 55500 TS NEGUQ
058667,000191: 21,3250 55502 TS NEGUR
058668,000192:
058669,000193: 21,3251 41500 CS NEGUQ
058670,000194: 21,3252 00006 EXTEND # GIMBAL DRIVE REQUESTS.
058671,000195: 21,3253 71507 MP ACCDOTQ
058672,000196: 21,3254 23510 LXCH QACCDOT
058673,000197: 21,3255 41502 CS NEGUR
058674,000198: 21,3256 00006 EXTEND
058675,000199: 21,3257 71511 MP ACCDOTR
058676,000200: 21,3260 23512 LXCH RACCDOT
058677,000201:
058678,000202: 21,3261 11500 CCS NEGUQ
058679,000203: 21,3262 35015 CAF BIT10
058680,000204: 21,3263 13265 TCF +2
058681,000205: 21,3264 35016 CAF BIT9
058682,000206: 21,3265 54066 TS CHNL12
058683,000207:
058684,000208: 21,3266 11502 CCS NEGUR
058685,000209: 21,3267 35013 CAF BIT12
058686,000210: 21,3270 13272 TCF +2
058687,000211: 21,3271 35014 CAF BIT11
058688,000212: 21,3272 26066 ADS CHNL12 # (STORED RESULT NOT USED AT PRESENT)
058689,000213:
058690,000214: 21,3273 43241 CS BGIM
058691,000215: 21,3274 00006 EXTEND
058692,000216: 21,3275 03012 WAND CHAN12
058693,000217: 21,3276 30066 CA CHNL12
058694,000218: 21,3277 00006 EXTEND
058695,000219: 21,3300 05012 WOR CHAN12
058696,000220:
058697,000221: 21,3301 00002 TC Q # RETURN TO CALLER.
058698,000222:
058699,000223: 21,3302 BANK 21
058700,000224: 21,3302 E6,1451 EBANK= QDIFF
058701,000225: 21,2000 SETLOC DAPS4
058702,000226: 21,2000 BANK
058703,000227:
058704,000228: # SUBROUTINE TIMEGMBL: MOD 0, OCTOBER 1967, CRAIG WORK
058705,000229:
058706,000230: # TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
058707,000231: # THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS. INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
058708,000232: # SCALED AT PI/8. FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT). A ZERO
058709,000233: # ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY. OTHERWISE, THE GIMBAL IS TURNED ON
058710,000234: # DRIVING IN THE CORRECT DIRECTION. THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
058711,000235: # IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE. NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
058712,000236: # WHICH IS NEGATIVE, ZERO, OR POSITIVE.
058713,000237:
058714,000238: # INPUTS: AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7). PI/2(7).
058715,000239:
058716,000240: # OUTPUTS: NEW GIMBAL DRIVE BITS IN CHANNEL 12,NEGUQ,NEGUR,QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
058717,000241: # Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
058718,000242:
058719,000243: # DEBRIS: A,L,Q, ITEMPS 2,3,6, RUPTREG2 AND ACDT+C12 DEBRIS.
058720,000244:
058721,000245: # EXITS: VIA TC Q.
058722,000246:
058723,000247: # ALARMS, ABORTS, : NONE
058724,000248:
058725,000249: # SUBROUTINES: ACDT+C12, IBNKCALL
058726,000250:
058727,000251: # WARNING: THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS. THEREFORE IT MAY ONLY BE CALLED WITH
058728,000252: # INTERRUPT INHIBITED.
058729,000253:
058730,000254: # ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
058731,000255: # NEGUQ ERASE +2 NEGATIVE OF Q-AXIS GIMBAL DRIVE
058732,000256: # (SPWORD) EQUALS NEGUQ +1 ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
058733,000257: # NEGUR EQUALS NEGUQ +2 NEGATIVE OF R-AXIS GIMBAL DRIVE
058734,000258:
058735,000259: # ACCDOTQ ERASE +2 Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
058736,000260: # (SPWORD) EQUALS ACCDOTQ +1 ANY S.P. ERASABLE NUMBER NOW QACCDOT
058737,000261: # ACCDOTR EQUALS ACCDOTQ +2 R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
058738,000262: # ACCDOTQ, ACCDOTR ARE MAGNITUDES.
058739,000263: # AOSQ ERASE +4 Q-AXIS ACC., D.P. AT PI/2 R/SEC(2)
058740,000264: # AOSR EQUALS AOSQ +2 R-AXIS ACCELERATION SCALED AT PI/2 R/S2
058741,000265:
058742,000266: 21,3302 0066 QRNDXER EQUALS ITEMP6
058743,000267: 21,3302 25253 .66667 DEC .66667
058744,000268: 21,3303 23146 OCT23146 OCTAL 23146 # DECIMAL .6
058745,000269: 21,3304 0063 NZACCDOT EQUALS ITEMP3
058746,000270:
058747,000271: 21,3304 35026 TIMEGMBL CAF ONE # INITIALIZE ALLOWGTS.
058748,000272: 21,3305 55624 TS ALLOWGTS
058749,000273:
058750,000274: 21,3306 35025 CAF TWO # SET UP LOOP FOR R AXIS.
058751,000275: 21,3307 22002 LXCH Q # SAVE RETURN ADDRESS.
058752,000276: 21,3310 22071 LXCH RUPTREG2
058753,000277: 21,3311 13313 TCF +2
058754,000278: 21,3312 35030 TIMQGMBL CAF ZERO # NOW DO THE Q-AXIS
058755,000279: 21,3313 54066 TS QRNDXER
058756,000280: 21,3314 50066 INDEX QRNDXER
058757,000281: 21,3315 31507 CA ACCDOTQ # ACCDOT IS PRESUMED TO BE AT PI/2(7).
058758,000282: 21,3316 00006 EXTEND
058759,000283: 21,3317 63367 BZMF TGOFFNOW # IS ACCDOT LESS THAN OR EQUAL TO 0?
058760,000284: 21,3320 54063 TS NZACCDOT # NO. STORE NON-ZERO, POSITIVE ACCDOT.
058761,000285:
058762,000286: 21,3321 50066 ALPHATRY INDEX QRNDXER
058763,000287: 21,3322 41532 CS AOSQ
058764,000288: 21,3323 00006 EXTEND
058765,000289: 21,3324 13367 BZF TGOFFNOW # IS ALPHA ZERO?
058766,000290:
058767,000291: 21,3325 54002 TS Q # SAVE A COPY OF -AOS.
058768,000292: 21,3326 00006 EXTEND # NO. RESCALE FOR TIMEGMBL USE.
058769,000293: 21,3327 73303 MP OCT23146 # OCTAL 23146 IS DECIMAL .6
058770,000294: 21,3330 60002 AD Q # -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
058771,000295: 21,3331 54001 TS L # WAS THERE OVERFLOW?
058772,000296: 21,3332 13337 TCF SETNEGU # NO. COMPUTE DRIVE TIME.
058773,000297:
058774,000298: 21,3333 40000 CS A # RECOVER -SGN(AOS) IN THE A REGISTER.
058775,000299: 21,3334 50066 INDEX QRNDXER # YES. START DRIVE WITHOUT WAITLIST.
058776,000300: 21,3335 57500 XCH NEGUQ
058777,000301: 21,3336 13373 TCF NOTALLOW # KNOCK DOWN THE ALLOWGTS FLAG.
058778,000302:
058779,000303: 21,3337 00006 SETNEGU EXTEND
058780,000304: 21,3340 63345 BZMF POSALPH
058781,000305:
058782,000306: 21,3341 40000 COM
058783,000307: 21,3342 54062 TS ITEMP2 # STORE -ABS(.4*AOS) SCALED AT PI/8.
058784,000308: 21,3343 45026 CS BIT1
058785,000309: 21,3344 13347 TCF POSALPH +2
058786,000310: 21,3345 54062 POSALPH TS ITEMP2 # STORE -ABS(.4*AOS) SCALED AT PI/8.
058787,000311: 21,3346 35026 CA BIT1
058788,000312: 21,3347 50066 +2 INDEX QRNDXER # SGN(AOS) INTO NEGU
058789,000313: 21,3350 55500 TS NEGUQ # STORE SGN(APLHA) AS NEGU
058790,000314:
058791,000315: 21,3351 30063 CA NZACCDOT
058792,000316: 21,3352 00006 EXTEND
058793,000317: 21,3353 75013 MP BIT12 # 2*ACCDOT, SCALED AT PI/8.
058794,000318: 21,3354 60062 AD ITEMP2 # -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
058795,000319: 21,3355 00006 EXTEND
058796,000320: 21,3356 63373 BZMF NOTALLOW # IS DRIVE TIME MORE THAN TWO SECONDS?
058797,000321: 21,3357 40062 CS ITEMP2 # NO. COMPUTE DRIVE TIME.
058798,000322: 21,3360 00006 EXTEND # ABS(ALPHA) AT PI/8.
058799,000323: 21,3361 73407 MP OCT00240 # DECIMAL 10/1024
058800,000324: 21,3362 00006 EXTEND # QUOTIENT IS DRIVE TIME AT WAITLIST.
058801,000325: 21,3363 10063 DV NZACCDOT # ABS(ALPHA)/ACCDOT AT 2(14)/100
058802,000326: 21,3364 00006 EXTEND
058803,000327: 21,3365 13367 BZF TGOFFNOW # DRIVE TIME MUST BE GREATER THAN ZERO.
058804,000328:
058805,000329: 21,3366 13401 TCF DRIVEON
058806,000330:
058807,000331: 21,3367 35030 TGOFFNOW CAF ZERO # TURN OFF GIMBAL NOW.
058808,000332: 21,3370 50066 INDEX QRNDXER
058809,000333: 21,3371 55500 TS NEGUQ
058810,000334:
058811,000335: 21,3372 13403 TCF DONEYET
058812,000336:
058813,000337: 21,3373 34113 NOTALLOW CAF OCT31
058814,000338: 21,3374 50066 INDEX QRNDXER
058815,000339: 21,3375 55626 TS QGIMTIMR
058816,000340: 21,3376 35030 CAF ZERO # DRIVE TIME IS MORE THAN 2 SECONDS, SO
058817,000341: 21,3377 55624 TS ALLOWGTS # DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
058818,000342: # CONTROL UNTIL AOSTASK APPROVES.
058819,000343: 21,3400 13403 TCF DONEYET # NO WAITLIST CALL IS MADE.
058820,000344:
058821,000345: 21,3401 50066 DRIVEON INDEX QRNDXER
058822,000346: 21,3402 55626 TS QGIMTIMR # CHOOSE Q OR R AXIS.
058823,000347:
058824,000348: 21,3403 10066 DONEYET CCS QRNDXER
058825,000349: 21,3404 13312 TCF TIMQGMBL
058826,000350:
058827,000351: 21,3405 03242 TC ACDT+C12 # TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
058828,000352:
058829,000353: 21,3406 00071 TC RUPTREG2 # RETURN TO CALLER.
058830,000354:
058831,000355: 21,3407 00240 OCT00240 OCTAL 00240 # DECIMAL 10/1024
058832,000356:
058833,000357: # THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY. THE QUANTITY NEGUSUM
058834,000358: # IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM. NEW DRIVES ARE ENTERED TO CH 12.
058835,000359:
058836,000360: 21,3410 11473 RSTOFGTS CCS FUNCTION
058837,000361: 21,3411 13430 TCF GOODARG # FUNCTION IS POSITIVE. GET 3/2 POWER.
058838,000362: 21,3412 13414 TCF +2 # HIGH ORDER WORD IS ZERO. TRY THE LOWER.
058839,000363: 21,3413 13541 TCF NEGUSUM # NEGATIVE. USE ZERO FOR 3/2 POWER.
058840,000364:
058841,000365: 21,3414 41474 CS FUNCTION +1 # IF ARG IS LESS THAN 2(-18), THEN THE 3/2
058842,000366: 21,3415 65014 AD BIT11 # POWER IS LESS THAN 2(-27). USE ZERO.
058843,000367: 21,3416 00006 EXTEND
058844,000368: 21,3417 63421 BZMF ZEROHIGH # BRANCH IF ARG NOT LESS THAN 2(-18).
058845,000369:
058846,000370: 21,3420 13541 TCF NEGUSUM
058847,000371:
058848,000372: 21,3421 34331 ZEROHIGH CA FOURTEEN # ARG LESS THAN 2(-14) MEANS 3/2 POWER
058849,000373: # WILL BE LESS THAN 2(-21).
058850,000374: 21,3422 55736 TS SHFTFLAG
058851,000375:
058852,000376: 21,3423 35025 CA TWO
058853,000377: 21,3424 55737 TS ININDEX # INITIALIZE THE SHIFT LOOP.
058854,000378:
058855,000379: # COLLECT THE 14 MOST SIGNIFICANT BITS OF
058856,000380: 21,3425 57474 XCH FUNCTION +1 # THE 28 INTO THE HIGH ORDER WORD.
058857,000381: 21,3426 57473 XCH FUNCTION
058858,000382: 21,3427 13443 TCF SCALLOOP
058859,000383: 21,3430 35746 GOODARG CA TWELVE
058860,000384: 21,3431 55737 TS ININDEX # INITIALIZE THE SHIFT LOOP.
058861,000385: 21,3432 35030 CA ZERO # THERE ARE SIGNIFICANT BITS IN THE HIGH
058862,000386: 21,3433 55736 TS SHFTFLAG # ORDER WORD, SO SET SHFTFLAG TO ZERO.
058863,000387:
058864,000388: 21,3434 13443 TCF SCALLOOP
058865,000389:
058866,000390: 21,3435 31473 SCALSTRT CA FUNCTION
058867,000391: 21,3436 13460 TCF SCALDONE
058868,000392:
058869,000393: 21,3437 37720 MULBUSH CA NEG2 # IF ARG IS NOT LESS THAN 1/4, INDEX IS
058870,000394: 21,3440 27737 ADS ININDEX # ZERO, INDICATING NO SHIFT NEEDED.
058871,000395: 21,3441 00006 EXTEND # BRANCH IF ARG IS NOT LESS THAN 1/4.
058872,000396: 21,3442 63435 BZMF SCALSTRT # OTHERWISE COMPARE ARG WITH A REFERENCE
058873,000397: # WHICH IS 4 TIMES LARGER THAN THE LAST.
058874,000398: 21,3443 41473 SCALLOOP CS FUNCTION
058875,000399: 21,3444 51737 INDEX ININDEX
058876,000400: 21,3445 65010 AD BIT15 # REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
058877,000401: 21,3446 00006 EXTEND
058878,000402: 21,3447 63437 BZMF MULBUSH # IF ARG IS NOT LESS THAN REFERENCE, GO
058879,000403: # AROUND THE MULBERRY BUSH ONCE MORE.
058880,000404: 21,3450 51737 INDEX ININDEX
058881,000405: 21,3451 35010 CA BIT15 # THIS IS THE SCALE MAGNITUDE
058882,000406: 21,3452 56002 XCH Q # 2**(-ININDEX) IS THE SHIFT DIVISOR.
058883,000407: 21,3453 00006 EXTEND # RESCALE ARGUMENT.
058884,000408: 21,3454 31474 DCA FUNCTION
058885,000409: 21,3455 00006 EXTEND
058886,000410: 21,3456 10002 DV Q
058887,000411: 21,3457 55473 TS FUNCTION # ININDEX AND SHFTFLAG PRESERVE INFO FOR
058888,000412: # RESCALING AFTER ROOT PROCESS.
058889,000413: 21,3460 00006 SCALDONE EXTEND # AFTER 3/2 POWER IS TAKEN, SCALE FACTOR
058890,000414: 21,3461 75012 MP BIT13 # OF SQRT(1/2) WILL BE NEEDED, SO FACTOR
058891,000415: 21,3462 55742 TS HALFARG # OF 1/2 IS INCLUDED NOW, BEFORE SQRT.
058892,000416:
058893,000417: 21,3463 33567 CA STARTER # INITIAL GUESS FOR SQRT ALGORITHM.
058894,000418: 21,3464 03570 TC ROOTCYCL
058895,000419: 21,3465 03570 TC ROOTCYCL
058896,000420: 21,3466 03570 TC ROOTCYCL
058897,000421:
058898,000422: 21,3467 00006 EXTEND # SQRT(1/2)*SQRT(ARG) IN A.
058899,000423: 21,3470 71473 MP FUNCTION # SQRT(1/2)*ARG*SQRT(ARG) IN A,L.
058900,000424: 21,3471 53474 DXCH FUNCTION
058901,000425:
058902,000426: 21,3472 31736 DOSHIFT CA SHFTFLAG # HOW MANY SHIFT BITS ARE THERE?
058903,000427: 21,3473 61737 AD ININDEX # 2**(-ININDEX) WAS SHIFT DIVISOR.
058904,000428: 21,3474 54021 TS SR
058905,000429: 21,3475 60021 AD SR # THIS MANY SHIFTS ARE REQUIRED.
058906,000430: 21,3476 54002 SAVESHFT TS Q # Q BOUNDS ARE ZERO AND 24 (DECIMAL).
058907,000431: 21,3477 00006 EXTEND
058908,000432: 21,3500 63526 BZMF SUMNEGU # BRANCH IF SHIFTING IS UNNECESSARY.
058909,000433:
058910,000434: 21,3501 44331 CS FOURTEEN
058911,000435: 21,3502 60002 AD Q
058912,000436: 21,3503 00006 EXTEND # Q = 0(MOD 3), SO A REG IS NON-ZERO.
058913,000437: 21,3504 63511 BZMF MINISHFT # BRANCH IF SMALL SHIFT SUFFICES.
058914,000438:
058915,000439: 21,3505 54002 MAXISHFT TS Q # 14 BIT SHIFT RIGHT NOW.
058916,000440: 21,3506 35030 CA ZERO
058917,000441: 21,3507 57473 XCH FUNCTION
058918,000442: 21,3510 55474 TS FUNCTION +1
058919,000443:
058920,000444: 21,3511 50002 MINISHFT INDEX Q # C(Q) ARE GREATER THAN ZERO.
058921,000445: 21,3512 35010 CA BIT15
058922,000446: 21,3513 54002 TS Q # 2**(-Q) WILL BE SHIFT MULTIPLIER.
058923,000447: 21,3514 00006 EXTEND
058924,000448: 21,3515 71474 MP FUNCTION +1
058925,000449: 21,3516 56001 XCH L
058926,000450: 21,3517 35030 CA ZERO
058927,000451: 21,3520 53474 DXCH FUNCTION # LOWER WORD SHIFTED NOW.
058928,000452: 21,3521 00006 EXTEND
058929,000453: 21,3522 63526 BZMF SUMNEGU # BRANCH IF UPPER WORD WAS ZERO.
058930,000454: 21,3523 00006 EXTEND # SHIFT UPPER WORD.
058931,000455: 21,3524 70002 MP Q
058932,000456: 21,3525 21474 DAS FUNCTION # NO OVERFLOW POSSIBLE.
058933,000457:
058934,000458: 21,3526 41744 SUMNEGU CS DEL # INCLUDE DEL FACTOR IN PRODUCT TERM.
058935,000459: 21,3527 00006 EXTEND
058936,000460: 21,3530 63534 BZMF SUMTERMS
058937,000461:
058938,000462: 21,3531 00006 EXTEND # DEL FACTOR IS MINUS ONE.
058939,000463: 21,3532 41474 DCS FUNCTION
058940,000464: 21,3533 13540 TCF NEGUSUM -1 # NOW ADD IN THE K2THETA TERM.
058941,000465:
058942,000466: 21,3534 00006 SUMTERMS EXTEND
058943,000467: 21,3535 13541 BZF NEGUSUM # BRANCH IF DEL IS ZERO.
058944,000468:
058945,000469: 21,3536 00006 EXTEND # DEL FACTOR IS +1.
058946,000470: 21,3537 31474 DCA FUNCTION
058947,000471: 21,3540 21735 DAS K2THETA # NOW ADD IN THE K2THETA TERM.
058948,000472: 21,3541 11734 NEGUSUM CCS K2THETA # TEST SIGN OF HIGH ORDER PART.
058949,000473: 21,3542 13546 TCF NEGDRIVE
058950,000474: 21,3543 13545 TCF +2
058951,000475: 21,3544 13550 TCF POSDRIVE
058952,000476:
058953,000477: 21,3545 11735 CCS K2THETA +1 # SIGN TEST FOR LOW ORDER PART.
058954,000478: 21,3546 35026 NEGDRIVE CA BIT1
058955,000479: 21,3547 13551 TCF +2 # STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
058956,000480: 21,3550 45026 POSDRIVE CS BIT1
058957,000481: 21,3551 51745 INDEX QRCNTR
058958,000482: 21,3552 55500 TS NEGUQ
058959,000483:
058960,000484: 21,3553 11745 CCS QRCNTR # HAVE BOTH AXES BEEN PROCESSED?
058961,000485: 21,3554 13100 TCF GOQTRIMG # NO. DO Q AXIS NEXT.
058962,000486:
058963,000487: 21,3555 00004 INHINT
058964,000488: 21,3556 03242 TC ACDT+C12
058965,000489: 21,3557 00003 RELINT
058966,000490:
058967,000491: 21,3560 31471 CA SAVESR # RESTORE THE SR
058968,000492: 21,3561 54021 TS SR
058969,000493:
058970,000494: 21,3562 00006 GOCLOSE EXTEND # TERMINATE THE JASK.
058971,000495: 21,3563 33566 DCA CLOSEADR
058972,000496: 21,3564 52006 DTCB
058973,000497:
058974,000498: 21,3565 E6,1532 EBANK= AOSQ
058975,000499: 21,3565 03021 36106 CLOSEADR 2CADR CLOSEOUT # TERMINATE THE JASK.
058976,000500:
058977,000501: 21,3567 5746 TWELVE EQUALS OCT14
058978,000502: 21,3567 20761 STARTER DEC .53033 # INITIAL VALUE FOR SQRT ALGORITHM.
058979,000503:
058980,000504: # SUBROUTINE ROOTCYCL: BY CRAIG WORK,3 APRIL 68
058981,000505:
058982,000506: # ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION. THE INITIAL GUESS AT THE
058983,000507: # SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG. THE NEW APPROXI-
058984,000508: # MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER. DEBRIS: A,L,SR,SCRATCH. ROOTCYCL IS CALLED FROM
058985,000509: # LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
058986,000510:
058987,000511: # WARNING: IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
058988,000512:
058989,000513: 21,3570 55741 ROOTCYCL TS SCRATCH # STORE X
058990,000514: 21,3571 54021 TS SR # X/2 NOW IN SR
058991,000515: 21,3572 31742 CA HALFARG # ARG/2 IN THE A REG
058992,000516: 21,3573 22007 ZL # PREPARE FOR DIVISION
058993,000517: 21,3574 00006 EXTEND
058994,000518: 21,3575 11741 DV SCRATCH # (ARG/X)/2
058995,000519: 21,3576 60021 AD SR # (X + ARG/X)/2 IN THE A REG
058996,000520: 21,3577 00002 TC Q
058997,000521:
058998,000522:
End of include-file TRIM_GIMBAL_CONTROL_SYSTEM.agc. Parent file is MAIN.agc