Source Code
These source-code files were transcribed from a printout in Don Eyles's personal
collection, scanned by archive.org, and financially sponsored by Linden Sims.
A team of volunteers performed the transcription and proof-reading. The scanned
page images are available at
the Virtual AGC Project website, as well as higher-quality (but much larger)
images at
the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating
"issues" at
the Virtual AGC Project's GitHub Repository. Notations on the program listing read, in part: GAP: ASSEMBLE REVISION 56 OF AGC PROGRAM ZERLINA BY ZOROASTER 9:12 OCT. 21,1970Note that the date is the date of the printout, not the date of the program revision. |
064288,000002: ## Copyright: Public domain.
064289,000003: ## Filename: TRIM_GIMBAL_CONTROL_SYSTEM.agc
064290,000004: ## Purpose: A log section of Zerlina 56, the final revision of
064291,000005: ## Don Eyles's offline development program for the variable
064292,000006: ## guidance period servicer. It also includes a new P66 with LPD
064293,000007: ## (Landing Point Designator) capability, based on an idea of John
064294,000008: ## Young's. Neither of these advanced features were actually flown,
064295,000009: ## but Zerlina was also the birthplace of other big improvements to
064296,000010: ## Luminary including the terrain model and new (Luminary 1E)
064297,000011: ## analog display programs. Zerlina was branched off of Luminary 145,
064298,000012: ## and revision 56 includes all changes up to and including Luminary
064299,000013: ## 183. It is therefore quite close to the Apollo 14 program,
064300,000014: ## Luminary 178, where not modified with new features.
064301,000015: ## Reference: pp. 1460-1472
064302,000016: ## Assembler: yaYUL
064303,000017: ## Contact: Ron Burkey <info@sandroid.org>.
064304,000018: ## Website: www.ibiblio.org/apollo/index.html
064305,000019: ## Mod history: 2017-07-28 MAS Created from Luminary 210.
064306,000020: ## 2017-08-29 MAS Updated for Zerlina 56.
064307,000021: ## 2021-05-30 ABS GTSGO+DN -> GTSGO+ON
064308,000022:
Page 1460 |
064310,000024: 21,3001 BANK 21
064311,000025: 21,3001 E6,1450 EBANK= QDIFF
064312,000026: 21,2000 SETLOC DAPS4
064313,000027: 21,2000 BANK
064314,000028:
064315,000029: 21,3001 COUNT* $$/DAPGT
064316,000030:
064317,000031: # CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
064318,000032: # AUTOPILOT ARE BOTH ON:
064319,000033: # A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
064320,000034: # INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
064321,000035: # B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
064322,000036: # ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
064323,000037:
064324,000038: # GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
064325,000039:
064326,000040: 21,3001 37761 GTS CAF NEGONE # MAKE THE NEXT PASS THROUGH THE DAP BE
064327,000041: 21,3002 55630 TS COTROLER # THROUGH RCS CONTROL,
064328,000042: 21,3003 34751 CAF FOUR # AND ENSURE THAT IT IS NOT A SKIP.
064329,000043: 21,3004 55534 TS SKIPU
064330,000044: 21,3005 55535 TS SKIPV
064331,000045:
064332,000046: 21,3006 34752 CAF TWO
064333,000047: 21,3007 55632 TS INGTS # SET INDICATOR OF GTS CONTROL POSITIVE.
064334,000048: 21,3010 55631 TS QGIMTIMR # SET TIMERS TO 200 MSEC TO AVOID BOTH
064335,000049: 21,3011 55633 TS RGIMTIMR # RUNAWAY AND INTERFERENCE BY NULLING.
064336,000050:
064337,000051: # THE DRIVE SETTING ALGORITHM
064338,000052:
064339,000053: # DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
064340,000054:
064341,000055: # 2 1/2 2 3/2
064342,000056: # NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K (DEL*OMEGA + ALPHA /(2*K))
064343,000057:
064344,000058: # DRIVE = -SGN(NEGUSUM)
064345,000059:
064346,000060: 21,3012 30021 CA SR # SAVE THE SR. SHIFT IT LEFT TO CORRECT
064347,000061: 21,3013 60000 AD A # FOR THE RIGHT SHIFT DUE TO EDITING.
064348,000062: 21,3014 55505 TS SAVESR
064349,000063:
064350,000064: 21,3015 34752 GTSGO+ON CAF TWO # SET INDEXER FOR R-AXIS CALCULATIONS.
064351,000065: 21,3016 13020 TCF GOQTRIMG +1
064352,000066:
064353,000067: 21,3017 34755 GOQTRIMG CAF ZERO # SET INDEXER FOR Q-AXIS CALCULATIONS
064354,000068: 21,3020 55747 TS QRCNTR
064355,000069:
064356,000070: 21,3021 51747 INDEX QRCNTR # AOS SCALED AT PI/2
064357,000071: 21,3022 31536 CA AOSQ
064358,000072: 21,3023 00006 EXTEND
064359,000073: 21,3024 74752 MP BIT2 # RESCALE AOS TO PI/4
064360,000074:
Page 1461 |
064362,000076: 21,3025 00006 EXTEND
064363,000077: 21,3026 13032 BZF GTSQAXIS -3 # USE FULL SCALE FOR LARGER AOS ESTIMATES.
064364,000078:
064365,000079: 21,3027 50000 INDEX A
064366,000080: 21,3030 44734 CS LIMITS # LIMITS +1 CONTAINS NEGMAX.
064367,000081: 21,3031 56001 XCH L # LIMITS -1 CONTAINS POSMAX.
064368,000082:
064369,000083: 21,3032 11747 CCS QRCNTR # PICK UP RATE FOR THIS AXIS. RATE CELLS
064370,000084: 21,3033 50000 INDEX A # ARE ADJACENT, NOT SEPARATED. AT PI/4
064371,000085: 21,3034 31436 CA EDOTQ
064372,000086: 21,3035 53743 GTSQAXIS DXCH WCENTRAL
064373,000087:
064374,000088: 21,3036 51747 INDEX QRCNTR # COLLECT K FOR THIS AXIS
064375,000089: 21,3037 31504 CA KQ
064376,000090: 21,3040 55740 TS KCENTRAL
064377,000091:
064378,000092: 21,3041 00006 EXTEND # CONTROL AUTHORITY ZERO. AVOID DRIVING
064379,000093: 21,3042 13500 BZF POSDRIVE +1 # ENGINE BELL TO THE STOPS.
064380,000094:
064381,000095: 21,3043 51747 INDEX QRCNTR # QDIFF, RDIFF ARE STORED IN D.P.
064382,000096: 21,3044 31450 CAE QDIFF
064383,000097:
064384,000098: 21,3045 00006 ALGORTHM EXTEND # Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
064385,000099: 21,3046 71740 MP KCENTRAL # FORM K*ERROR AT PI(2)/2(8), IN D.P.
064386,000100: 21,3047 23736 LXCH K2THETA
064387,000101: 21,3050 00006 EXTEND
064388,000102: 21,3051 74747 MP BIT5 # RESCALE TO 4*PI(2)
064389,000103: 21,3052 53737 DXCH K2THETA
064390,000104: 21,3053 00006 EXTEND
064391,000105: 21,3054 74747 MP BIT5 # FIRST TERM OF NEGUSUM IN K2THETA.
064392,000106: 21,3055 27737 ADS K2THETA +1 # NO CARRY NEEDED D.P. AT 4*PI(2)
064393,000107:
064394,000108: 21,3056 41743 CS ACENTRAL # FORM ALPHA(2)/(2*K) AT 16*PI, IN D.P.,
064395,000109: 21,3057 00006 EXTEND # LIMITING QUOTIENT TO AVOID OVERFLOW.
064396,000110: 21,3060 74736 MP BIT14 # -ALPHA/2 IN A, SCALED AT PI/4
064397,000111: 21,3061 00006 EXTEND
064398,000112: 21,3062 71743 MP ACENTRAL # -ALPHA(2)/2 IN A,L, SCALED AT PI(2)/16
064399,000113: 21,3063 61740 AD KCENTRAL
064400,000114: 21,3064 00006 EXTEND
064401,000115: 21,3065 63102 BZMF HUGEQUOT # K-ALPHA(2)/2 SHOULD BE PNZ FO DIVISION
064402,000116:
064403,000117: 21,3066 00006 EXTEND
064404,000118: 21,3067 40001 DCS A # ALPHA(2)/2 - K
064405,000119: 21,3070 61740 AD KCENTRAL
064406,000120: 21,3071 00006 EXTEND
064407,000121: 21,3072 11740 DV KCENTRAL # HIGH ORDER OF QUOTIENT.
064408,000122: 21,3073 57745 XCH A2CNTRAL
064409,000123: 21,3074 30001 CA L # SHIFT UP THE REMAINDER.
064410,000124: 21,3075 22007 LXCH 7 # ZERO LOW-ORDER DIVIDEND.
064411,000125: 21,3076 00006 EXTEND
Page 1462 |
064413,000127: 21,3077 11740 DV KCENTRAL
064414,000128: 21,3100 57746 XCH A2CNTRAL +1 # QUOTIENT STORED AT 16*PI, D.P.
064415,000129: 21,3101 13105 TCF HAVEQUOT
064416,000130:
064417,000131: 21,3102 34733 HUGEQUOT CA POSMAX
064418,000132: 21,3103 54001 TS L
064419,000133: 21,3104 53746 DXCH A2CNTRAL # LIMITED QUOTIENT STORED AT 16*PI, D.P.
064420,000134:
064421,000135: 21,3105 31742 HAVEQUOT CA WCENTRAL
064422,000136: 21,3106 00006 EXTEND
064423,000137: 21,3107 74743 MP BIT9 # RESCALE OMEGA AT 16*PI IN D.P.
064424,000138: 21,3110 53742 DXCH K2CNTRAL # LOWER WORD OVERLAYS OMEGA IN WCENTRAL
064425,000139:
064426,000140: 21,3111 00006 EXTEND
064427,000141: 21,3112 31742 DCA K2CNTRAL
064428,000142: 21,3113 53751 DXCH FUNCTION
064429,000143:
064430,000144: 21,3114 31743 CA ACENTRAL # GET ALPHA*ABS(ALPHA)/(2*K)
064431,000145: 21,3115 00006 EXTEND
064432,000146: 21,3116 63122 BZMF +4
064433,000147:
064434,000148: 21,3117 00006 EXTEND
064435,000149: 21,3120 31746 DCA A2CNTRAL
064436,000150: 21,3121 13124 TCF +3
064437,000151:
064438,000152: 21,3122 00006 EXTEND
064439,000153: 21,3123 41746 DCS A2CNTRAL
064440,000154:
064441,000155: 21,3124 21751 DAS FUNCTION # OMEGA + ALPHA*ABS(ALPHA)/2*K) AT 16*PI
064442,000156:
064443,000157: 21,3125 11750 CCS FUNCTION # DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
064444,000158: 21,3126 13132 TCF POSFNCT1 # OTHERWISE DEL = -1
064445,000159: 21,3127 13131 TCF +2
064446,000160: 21,3130 13134 TCF NEGFNCT1
064447,000161:
064448,000162: 21,3131 11751 CCS FUNCTION +1 # USE LOW ORDER WORD SINCE HIGH IS ZERO
064449,000163: 21,3132 34753 POSFNCT1 CAF BIT1
064450,000164: 21,3133 13135 TCF +2
064451,000165: 21,3134 44753 NEGFNCT1 CS BIT1
064452,000166: 21,3135 55744 TS DEL
064453,000167:
064454,000168: 21,3136 11744 CCS DEL # REPLACE OMEGA BY DEL*OMEGA
064455,000169: 21,3137 13151 TCF FUNCT2 # POSITIVE DEL VALUE. PROCEED.
064456,000170: 21,3140 13142 TCF DEFUNCT
064457,000171: 21,3141 13146 TCF NEGFNCT2
064458,000172:
064459,000173: 21,3142 55741 DEFUNCT TS K2CNTRAL
064460,000174: 21,3143 55742 TS K2CNTRAL +1
064461,000175: 21,3144 13151 TCF FUNCT2
064462,000176:
Page 1463 |
064464,000178: 21,3145 65252 NEG1/3 DEC -.33333
064465,000179:
064466,000180: 21,3146 00006 NEGFNCT2 EXTEND
064467,000181: 21,3147 41742 DCS K2CNTRAL
064468,000182: 21,3150 53742 DXCH K2CNTRAL
064469,000183:
064470,000184: 21,3151 00006 FUNCT2 EXTEND
064471,000185: 21,3152 31746 DCA A2CNTRAL
064472,000186: 21,3153 21742 DAS K2CNTRAL # DEL*OMEGA + ALPHA(2)/(2*K) AT 16*PI,D.P.
064473,000187:
064474,000188: 21,3154 31745 FUNCT3 CA A2CNTRAL
064475,000189: 21,3155 00006 EXTEND
064476,000190: 21,3156 73145 MP NEG1/3
064477,000191: 21,3157 53746 DXCH A2CNTRAL
064478,000192: 21,3160 30001 CA L
064479,000193: 21,3161 00006 EXTEND
064480,000194: 21,3162 73145 MP NEG1/3
064481,000195: 21,3163 27746 ADS A2CNTRAL +1
064482,000196: 21,3164 54001 TS L
064483,000197: 21,3165 13167 TCF +2 # A2CNTRAL NOW CONTAINS -ALPHA(2)/(6*K),
064484,000198: 21,3166 27745 ADS A2CNTRAL # SCALED AT 16*PI, IN D.P.
064485,000199:
064486,000200: 21,3167 00006 EXTEND
064487,000201: 21,3170 31742 DCA K2CNTRAL # DEL*OMEGA + ALPHA(2)/(3*K) IN A2CNTRAL,
064488,000202: 21,3171 21746 DAS A2CNTRAL # SCALED AT 16*PI, D.P.
064489,000203:
064490,000204: 21,3172 31745 CA A2CNTRAL
064491,000205: 21,3173 00006 EXTEND
064492,000206: 21,3174 71743 MP ACENTRAL
064493,000207: 21,3175 21737 DAS K2THETA
064494,000208: 21,3176 31746 CA A2CNTRAL +1
064495,000209: 21,3177 00006 EXTEND
064496,000210: 21,3200 71743 MP ACENTRAL # ACENTRAL MAY NOW BE OVERLAID.
064497,000211: 21,3201 27737 ADS K2THETA +1
064498,000212: 21,3202 54001 TS L
064499,000213: 21,3203 13205 TCF +2 # TWO TERMS OF NEGUSUM ACCUMULATED, SO FAR
064500,000214: 21,3204 27736 ADS K2THETA # SCALED AT 4*PI(2), IN D.P.
064501,000215:
064502,000216: 21,3205 31741 GETROOT CA K2CNTRAL # K*(DEL*OMEGA + ALPHA(2)/(2*K)) IS THE
064503,000217: 21,3206 00006 EXTEND # TERM FOR WHICH A SQUARE ROOT IS NEEDED.
064504,000218: 21,3207 71740 MP KCENTRAL # K AT PI/2(8)
064505,000219: 21,3210 53751 DXCH FUNCTION
064506,000220: 21,3211 31742 CA K2CNTRAL +1
064507,000221: 21,3212 00006 EXTEND
064508,000222: 21,3213 71740 MP KCENTRAL
064509,000223: 21,3214 27751 ADS FUNCTION +1
064510,000224: 21,3215 54001 TS L
064511,000225: 21,3216 13220 TCF +2
064512,000226: 21,3217 27750 ADS FUNCTION # DESIRED TERM IN FUNCTION, AT PI(2)/16
Page 1464 |
064514,000228: 21,3220 11744 CCS DEL
064515,000229: 21,3221 13426 TCF RSTOFGTS
064516,000230: 21,3222 13470 TCF NEGUSUM
064517,000231: 21,3223 13225 TCF NEGATE
064518,000232: 21,3224 13470 TCF NEGUSUM
064519,000233:
064520,000234: 21,3225 00006 NEGATE EXTEND
064521,000235: 21,3226 41742 DCS K2CNTRAL
064522,000236: 21,3227 53742 DXCH K2CNTRAL
064523,000237: 21,3230 13426 TCF RSTOFGTS
064524,000238:
064525,000239: 16,3740 BANK 16
064526,000240: 16,3740 E6,1501 EBANK= NEGUQ
064527,000241: 16,2000 SETLOC DAPS1
064528,000242: 16,2000 BANK
064529,000243:
064530,000244: # THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
064531,000245: # THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES. ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
064532,000246:
064533,000247: # WARNING: ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
064534,000248:
064535,000249: 16,3740 07400 BGIM OCTAL 07400
064536,000250: 16,3741 0066 CHNL12 EQUALS ITEMP6
064537,000251: 16,3741 41501 ACDT+C12 CS NEGUQ
064538,000252: 16,3742 00006 EXTEND # GIMBAL DRIVE REQUESTS.
064539,000253: 16,3743 71507 MP ACCDOTQ
064540,000254: 16,3744 23510 LXCH QACCDOT
064541,000255: 16,3745 41503 CS NEGUR
064542,000256: 16,3746 00006 EXTEND
064543,000257: 16,3747 71511 MP ACCDOTR
064544,000258: 16,3750 23512 LXCH RACCDOT
064545,000259:
064546,000260: 16,3751 11501 CCS NEGUQ
064547,000261: 16,3752 34742 CAF BIT10
064548,000262: 16,3753 13755 TCF +2
064549,000263: 16,3754 34743 CAF BIT9
064550,000264: 16,3755 54066 TS CHNL12
064551,000265:
064552,000266: 16,3756 11503 CCS NEGUR
064553,000267: 16,3757 34740 CAF BIT12
064554,000268: 16,3760 13762 TCF +2
064555,000269: 16,3761 34741 CAF BIT11
064556,000270: 16,3762 26066 ADS CHNL12 # (STORED RESULT NOT USED AT PRESENT)
064557,000271:
064558,000272: 16,3763 43740 CS BGIM
064559,000273: 16,3764 00006 EXTEND
064560,000274: 16,3765 02012 RAND CHAN12
064561,000275: 16,3766 60066 AD CHNL12
064562,000276: 16,3767 00006 EXTEND
064563,000277: 16,3770 01012 WRITE CHAN12
064564,000278:
Page 1465 |
064566,000280: 16,3771 44747 CS CALLGMBL # TURN OFF REQUEST FOR ACDT+C12 EXECUTION.
064567,000281: 16,3772 71262 MASK RCSFLAGS
064568,000282: 16,3773 55262 TS RCSFLAGS
064569,000283:
064570,000284: 16,3774 00002 TC Q # RETURN TO CALLER.
064571,000285:
064572,000286: 21,3231 BANK 21
064573,000287: 21,3231 E6,1450 EBANK= QDIFF
064574,000288: 21,2000 SETLOC DAPS4
064575,000289: 21,2000 BANK
064576,000290:
Page 1466 |
064578,000292: # SUBROUTINE TIMEGMBL: MOD 0, OCTOBER 1967, CRAIG WORK
064579,000293:
064580,000294: # TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
064581,000295: # THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS. INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
064582,000296: # SCALED AT PI/8. FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT). A ZERO
064583,000297: # ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY. OTHERWISE, THE GIMBAL IS TURNED ON
064584,000298: # DRIVING IN THE CORRECT DIRECTION. THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
064585,000299: # IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE. NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
064586,000300: # WHICH IS NEGATIVE, ZERO, OR POSITIVE.
064587,000301:
064588,000302: # INPUTS: AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7). PI/2(7).
064589,000303:
064590,000304: # OUTPUTS: NEW GIMBAL DRIVE BITS IN CHANNEL 12,NEGUQ,NEGUR,QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
064591,000305: # Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
064592,000306:
064593,000307: # DEBRIS: A,L,Q, ITEMPS 2,3,6, RUPTREG2 AND ACDT+C12 DEBRIS.
064594,000308:
064595,000309: # EXITS: VIA TC Q.
064596,000310:
064597,000311: # ALARMS, ABORTS, : NONE
064598,000312:
064599,000313: # SUBROUTINES: ACDT+C12, IBNKCALL
064600,000314:
064601,000315: # WARNING: THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS. THEREFORE IT MAY ONLY BE CALLED WITH
064602,000316: # INTERRUPT INHIBITED.
064603,000317:
064604,000318: # ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
064605,000319:
064606,000320: # NEGUQ ERASE +2 NEGATIVE OF Q-AXIS GIMBAL DRIVE
064607,000321: # (SPWORD) EQUALS NEGUQ +1 ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
064608,000322: # NEGUR EQUALS NEGUQ +2 NEGATIVE OF R-AXIS GIMBAL DRIVE
064609,000323:
064610,000324: # ACCDOTQ ERASE +2 Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
064611,000325: # (SPWORD) EQUALS ACCDOTQ +1 ANY S.P. ERASABLE NUMBER NOW QACCDOT
064612,000326: # ACCDOTR EQUALS ACCDOTQ +2 R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
064613,000327: # ACCDOTQ,ACCDOTR ARE MAGNITUDES.
064614,000328: # AOSQ ERASE +4 Q-AXIS ACC.,D.P. AT PI/2 R/SEC(2)
064615,000329: # AOSR EQUALS AOSQ +2 R-AXIS ACCELERATION SCALED AT PI/2 R/S2
064616,000330:
064617,000331: 21,3231 0066 QRNDXER EQUALS ITEMP6
064618,000332: 21,3231 23146 OCT23146 OCTAL 23146 # DECIMAL .6
064619,000333: 21,3232 0063 NZACCDOT EQUALS ITEMP3
064620,000334:
064621,000335: 21,3232 34753 TIMEGMBL CAF ONE # INITIALIZE ALLOWGTS.
064622,000336: 21,3233 55502 TS ALLOWGTS
064623,000337:
064624,000338: 21,3234 34752 CAF TWO # SET UP LOOP FOR R AXIS.
064625,000339: 21,3235 22002 LXCH Q # SAVE RETURN ADDRESS.
064626,000340: 21,3236 22071 LXCH RUPTREG2
Page 1467 |
064628,000342: 21,3237 13241 TCF +2
064629,000343: 21,3240 34755 TIMQGMBL CAF ZERO # NOW DO THE Q-AXIS
064630,000344: 21,3241 54066 TS QRNDXER
064631,000345: 21,3242 50066 INDEX QRNDXER
064632,000346: 21,3243 31507 CA ACCDOTQ # ACCDOT IS PRESUMED TO BE AT PI/2(7).
064633,000347: 21,3244 00006 EXTEND
064634,000348: 21,3245 63315 BZMF TGOFFNOW # IS ACCDOT LESS THAN OR EQUAL TO 0?
064635,000349: 21,3246 54063 TS NZACCDOT # NO. STORE NON-ZERO, POSITIVE ACCDOT.
064636,000350:
064637,000351: 21,3247 50066 ALPHATRY INDEX QRNDXER
064638,000352: 21,3250 41536 CS AOSQ
064639,000353: 21,3251 00006 EXTEND
064640,000354: 21,3252 13315 BZF TGOFFNOW # IS ALPHA ZERO?
064641,000355:
064642,000356: 21,3253 54002 TS Q # SAVE A COPY OF -AOS.
064643,000357: 21,3254 00006 EXTEND # NO. RESCALE FOR TIMEGMBL USE.
064644,000358: 21,3255 73231 MP OCT23146 # OCTAL 23146 IS DECIMAL .6
064645,000359: 21,3256 60002 AD Q # -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
064646,000360: 21,3257 54001 TS L # WAS THERE OVERFLOW?
064647,000361: 21,3260 13265 TCF SETNEGU # NO. COMPUTE DRIVE TIME.
064648,000362:
064649,000363: 21,3261 40000 CS A # RECOVER -SGN(AOS) IN THE A REGISTER.
064650,000364: 21,3262 50066 INDEX QRNDXER # YES. START DRIVE WITHOUT WAITLIST.
064651,000365: 21,3263 57501 XCH NEGUQ
064652,000366: 21,3264 13321 TCF NOTALLOW # KNOCK DOWN THE ALLOWGTS FLAG.
064653,000367:
064654,000368: 21,3265 00006 SETNEGU EXTEND
064655,000369: 21,3266 63273 BZMF POSALPH
064656,000370:
064657,000371: 21,3267 40000 COM
064658,000372: 21,3270 54062 TS ITEMP2 # STORE -ABS(.4*AOS) SCALED AT PI/8.
064659,000373: 21,3271 44753 CS BIT1
064660,000374: 21,3272 13275 TCF POSALPH +2
064661,000375: 21,3273 54062 POSALPH TS ITEMP2 # STORE -ABS(.4*AOS) SCALED AT PI/8.
064662,000376: 21,3274 34753 CA BIT1
064663,000377: 21,3275 50066 +2 INDEX QRNDXER # SGN(AOS) INTO NEGU
064664,000378: 21,3276 55501 TS NEGUQ # STORE SGN(APLHA) AS NEGU
064665,000379:
064666,000380: 21,3277 30063 CA NZACCDOT
064667,000381: 21,3300 00006 EXTEND
064668,000382: 21,3301 74740 MP BIT12 # 2*ACCDOT, SCALED AT PI/8.
064669,000383: 21,3302 60062 AD ITEMP2 # -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
064670,000384: 21,3303 00006 EXTEND
064671,000385: 21,3304 63321 BZMF NOTALLOW # IS DRIVE TIME MORE THAN TWO SECONDS?
064672,000386: 21,3305 40062 CS ITEMP2 # NO. COMPUTE DRIVE TIME.
064673,000387: 21,3306 00006 EXTEND # ABS(ALPHA) AT PI/8.
064674,000388: 21,3307 73342 MP OCT00240 # DECIMAL 10/1024
064675,000389: 21,3310 00006 EXTEND # QUOTIENT IS DRIVE TIME AT WAITLIST.
064676,000390: 21,3311 10063 DV NZACCDOT # ABS(ALPHA)/ACCDOT AT 2(14)/100
064677,000391:
Page 1468 |
064679,000393: 21,3312 00006 EXTEND
064680,000394: 21,3313 13315 BZF TGOFFNOW # DRIVE TIME MUST BE GREATER THAN ZERO.
064681,000395:
064682,000396: 21,3314 13327 TCF DRIVEON
064683,000397:
064684,000398: 21,3315 34755 TGOFFNOW CAF ZERO # TURN OFF GIMBAL NOW.
064685,000399: 21,3316 50066 INDEX QRNDXER
064686,000400: 21,3317 55501 TS NEGUQ
064687,000401:
064688,000402: 21,3320 13331 TCF DONEYET
064689,000403:
064690,000404: 21,3321 36010 NOTALLOW CAF OCT31
064691,000405: 21,3322 50066 INDEX QRNDXER
064692,000406: 21,3323 55631 TS QGIMTIMR
064693,000407: 21,3324 34755 CAF ZERO # DRIVE TIME IS MORE THAN 2 SECONDS, SO
064694,000408: 21,3325 55502 TS ALLOWGTS # DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
064695,000409: # CONTROL UNTIL AOSTASK APPROVES.
064696,000410: 21,3326 13331 TCF DONEYET # NO WAITLIST CALL IS MADE.
064697,000411:
064698,000412: 21,3327 50066 DRIVEON INDEX QRNDXER
064699,000413: 21,3330 55631 TS QGIMTIMR # CHOOSE Q OR R AXIS.
064700,000414:
064701,000415: 21,3331 10066 DONEYET CCS QRNDXER
064702,000416: 21,3332 13240 TCF TIMQGMBL
064703,000417:
064704,000418: 21,3333 52073 DXCH RUPTREG3 # PROTECT IBNKCALL ERASABLES. ACDT+C12
064705,000419: 21,3334 52063 DXCH ITEMP2 # LEAVES ITEMPS2,3 ALONE.
064706,000420:
064707,000421: 21,3335 04674 TC IBNKCALL # TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
064708,000422: 21,3336 35741 CADR ACDT+C12
064709,000423:
064710,000424: 21,3337 52063 DXCH ITEMP2 # RESTORE ERASABLES FOR IBNKCALL.
064711,000425: 21,3340 52073 DXCH RUPTREG3
064712,000426:
064713,000427: 21,3341 00071 TC RUPTREG2 # RETURN TO CALLER.
064714,000428:
064715,000429: 21,3342 00240 OCT00240 OCTAL 00240 # DECIMAL 10/1024
064716,000430:
Page 1469 |
064718,000432: # THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY. THE QUANTITY NEGUSUM
064719,000433: # IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM. NEW DRIVES ARE ENTERED TO CH 12.
064720,000434:
064721,000435: # THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
064722,000436: # SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT. ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
064723,000437: # EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
064724,000438: # POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
064725,000439: # SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT. CELLS CLOBBERED ARE A,L,SHFTFLAG,ININDEX,
064726,000440: # HALFARG,SCRATCH,SR,FUNCTION, FUNCTION +1. GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
064727,000441: # ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
064728,000442:
064729,000443: 21,3343 11750 GTSQRT CCS FUNCTION
064730,000444: 21,3344 13362 TCF GOODARG # FUNCTION IS POSITIVE. TAKE SQUARE ROOT.
064731,000445: 21,3345 13347 TCF +2 # HIGH ORDER WORD IS ZERO. TRY THE LOWER.
064732,000446: 21,3346 13353 TCF ZEROOT # NEGATIVE. USE ZERO FOR 1/2 POWER.
064733,000447:
064734,000448: 21,3347 31751 CA FUNCTION +1
064735,000449: 21,3350 00006 EXTEND
064736,000450: 21,3351 63353 BZMF ZEROOT
064737,000451:
064738,000452: 21,3352 13356 TCF ZEROHIGH # PROCEED.
064739,000453: 21,3353 34755 ZEROOT CA ZERO
064740,000454: 21,3354 55740 TS SHFTFLAG
064741,000455: 21,3355 00002 TC Q
064742,000456:
064743,000457: 21,3356 57750 ZEROHIGH XCH FUNCTION # 14 MOST SIGNIFICANT BITS ARE IN THE
064744,000458: 21,3357 57751 XCH FUNCTION +1 # LOWER WORD. EXCHANGE THEM.
064745,000459: 21,3360 34757 CA SEVEN
064746,000460: 21,3361 13363 TCF GOODARG +1
064747,000461:
064748,000462: 21,3362 34755 GOODARG CA ZERO
064749,000463: 21,3363 55740 TS SHFTFLAG
064750,000464: 21,3364 35752 CA TWELVE # INITIALIZE THE SCALING LOOP.
064751,000465: 21,3365 55743 TS ININDEX
064752,000466: 21,3366 13375 TCF SCALLOOP
064753,000467:
064754,000468: 21,3367 31750 SCALSTRT CA FUNCTION
064755,000469: 21,3370 13411 TCF SCALDONE
064756,000470:
064757,000471: 21,3371 37760 MULBUSH CA NEG2 # IF ARG IS NOT LESS THAN 1/4, INDEX IS
064758,000472: 21,3372 27743 ADS ININDEX # ZERO, INDICATING NO SHIFT NEEDED.
064759,000473: 21,3373 00006 EXTEND # BRANCH IF ARG IS NOT LESS THAN 1/4.
064760,000474: 21,3374 63367 BZMF SCALSTRT # OTHERWISE COMPARE ARG WITH A REFERENCE
064761,000475: # WHICH IS 4 TIMES LARGER THAN THE LAST.
064762,000476: 21,3375 41750 SCALLOOP CS FUNCTION
064763,000477: 21,3376 51743 INDEX ININDEX
064764,000478: 21,3377 64735 AD BIT15 # REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
064765,000479: 21,3400 00006 EXTEND
064766,000480: 21,3401 63371 BZMF MULBUSH # IF ARG IS NOT LESS THAN REFERENCE, GO
064767,000481: # AROUND THE MULBERRY BUSH ONCE MORE.
064768,000482:
Page 1470 |
064770,000484: 21,3402 51743 INDEX ININDEX
064771,000485: 21,3403 34735 CA BIT15 # THIS IS THE SCALE MAGNITUDE
064772,000486: 21,3404 57746 XCH HALFARG # 2**(-ININDEX) IS THE SHIFT DIVISOR.
064773,000487: 21,3405 00006 EXTEND # RESCALE ARGUMENT.
064774,000488: 21,3406 31751 DCA FUNCTION
064775,000489: 21,3407 00006 EXTEND
064776,000490: 21,3410 11746 DV HALFARG
064777,000491: # ININDEX AND SHFTFLAG PRESERVE INFO FOR
064778,000492:
064779,000493: # RESCALING AFTER ROOT PROCESS.
064780,000494: 21,3411 00006 SCALDONE EXTEND
064781,000495: 21,3412 23751 QXCH FUNCTION +1 # SAVE Q FOR RETURN
064782,000496: 21,3413 00006 EXTEND
064783,000497: 21,3414 74736 MP BIT14
064784,000498: 21,3415 55746 TS HALFARG
064785,000499: 21,3416 74737 MASK BIT13
064786,000500: 21,3417 10000 CCS A
064787,000501: 21,3420 33536 CA OCT11276
064788,000502: 21,3421 63534 AD ROOTHALF # INITIAL GUESS IS ROOT 1/2 OR POSMAX
064789,000503:
064790,000504: 21,3422 03540 TC ROOTCYCL
064791,000505: 21,3423 03540 TC ROOTCYCL
064792,000506: 21,3424 03540 TC ROOTCYCL
064793,000507:
064794,000508: 21,3425 01751 TC FUNCTION +1
064795,000509:
064796,000510: # ****************************************************************************************************************
064797,000511:
064798,000512:
064799,000513: 21,3426 03343 RSTOFGTS TC GTSQRT
064800,000514: 21,3427 57741 PRODUCT XCH K2CNTRAL
064801,000515: 21,3430 00006 EXTEND
064802,000516: 21,3431 71741 MP K2CNTRAL
064803,000517: 21,3432 53742 DXCH K2CNTRAL
064804,000518: 21,3433 00006 EXTEND # THE PRODUCT OF
064805,000519: 21,3434 70001 MP L # 1/2 2 1/2
064806,000520: 21,3435 27742 ADS K2CNTRAL +1 # K *(DEL*OMEGA + ALPHA /(2*K))
064807,000521: 21,3436 54001 TS L # AND
064808,000522: 21,3437 13441 TCF +2 # 2
064809,000523: 21,3440 27741 ADS K2CNTRAL # DEL*(DEL*OMEGA + ALPHA /(2*K)) NOW IN
064810,000524: # K2CNTRAL
064811,000525:
064812,000526: 21,3441 31743 DOSHIFT CA ININDEX
064813,000527: 21,3442 00006 EXTEND # MULTIPLY IN THE FACTOR 2(-S), RETURNED
064814,000528: 21,3443 74736 MP BIT14 # BY THE GTSQRT SUBROUTINE
064815,000529: 21,3444 27740 ADS SHFTFLAG
064816,000530: 21,3445 00006 EXTEND
064817,000531: 21,3446 13465 BZF ADDITIN
064818,000532: 21,3447 51740 INDEX SHFTFLAG
064819,000533: 21,3450 34735 CA BIT15
Page 1471 |
064821,000535: 21,3451 57741 XCH K2CNTRAL
064822,000536: 21,3452 00006 EXTEND
064823,000537: 21,3453 71741 MP K2CNTRAL
064824,000538: 21,3454 21737 DAS K2THETA
064825,000539: 21,3455 57741 XCH K2CNTRAL
064826,000540: 21,3456 00006 EXTEND
064827,000541: 21,3457 71742 MP K2CNTRAL +1
064828,000542: 21,3460 27737 ADS K2THETA +1
064829,000543: 21,3461 54001 TS L
064830,000544: 21,3462 13464 TCF +2
064831,000545: 21,3463 27736 ADS K2THETA
064832,000546:
064833,000547: 21,3464 13470 TCF NEGUSUM
064834,000548:
064835,000549: 21,3465 00006 ADDITIN EXTEND
064836,000550: 21,3466 31742 DCA K2CNTRAL
064837,000551: 21,3467 21737 DAS K2THETA # NOW ADD IN THE K2THETA TERM.
064838,000552: 21,3470 11736 NEGUSUM CCS K2THETA # TEST SIGN OF HIGH ORDER PART.
064839,000553: 21,3471 13475 TCF NEGDRIVE
064840,000554: 21,3472 13474 TCF +2
064841,000555: 21,3473 13477 TCF POSDRIVE
064842,000556:
064843,000557: 21,3474 11737 CCS K2THETA +1 # SIGN TEST FOR LOW ORDER PART.
064844,000558: 21,3475 34753 NEGDRIVE CA BIT1
064845,000559: 21,3476 13500 TCF +2 # STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
064846,000560: 21,3477 44753 POSDRIVE CS BIT1
064847,000561: 21,3500 54001 TS L # SAVE FOR DRIVE REVERSAL TEST.
064848,000562: 21,3501 51747 INDEX QRCNTR
064849,000563: 21,3502 57501 XCH NEGUQ
064850,000564:
064851,000565: 21,3503 00006 EXTEND
064852,000566: 21,3504 70001 MP L # MULTIPLY OLD NEGU AND NEW NEGU.
064853,000567: 21,3505 10001 CCS L
064854,000568: 21,3506 13523 TCF LOUPE # NON-ZERO GIMBAL DRIVE BEING CONTINUED.
064855,000569:
064856,000570: 21,3507 13520 TCF ZEROLOUP # NO REVERSAL PROBLEM HERE.
064857,000571:
064858,000572: 21,3510 13512 TCF REVERSAL # NON-ZERO GIMBAL DRIVE BEING REVERSED.
064859,000573: 21,3511 13520 TCF ZEROLOUP # NO REVERSAL PROBLEM HERE.
064860,000574:
064861,000575: 21,3512 51747 REVERSAL INDEX QRCNTR # A ZERO-DRIVE PAUSE IS NEEDED HERE. ZERO
064862,000576: 21,3513 55510 TS QACCDOT # IS IN A REGISTER FROM CCS ON (-1).
064863,000577: 21,3514 51747 INDEX QRCNTR
064864,000578: 21,3515 43535 CS GMBLBITA
064865,000579: 21,3516 00006 EXTEND
064866,000580: 21,3517 03012 WAND CHAN12
064867,000581:
064868,000582: 21,3520 41262 ZEROLOUP CS RCSFLAGS # SET UP REQUEST FOR ACDT+C12 CALL.
064869,000583: 21,3521 74747 MASK CALLGMBL
064870,000584: 21,3522 27262 ADS RCSFLAGS
064871,000585:
Page 1472 |
064873,000587: 21,3523 11747 LOUPE CCS QRCNTR # HAVE BOTH AXES BEEN PROCESSED?
064874,000588: 21,3524 13017 TCF GOQTRIMG # NO. DO Q AXIS NEXT.
064875,000589:
064876,000590: 21,3525 31505 CA SAVESR # RESTORE THE SR
064877,000591: 21,3526 54021 TS SR
064878,000592:
064879,000593: 21,3527 00006 GOCLOSE EXTEND # TERMINATE THE JASK.
064880,000594: 21,3530 33533 DCA CLOSEADR
064881,000595: 21,3531 52006 DTCB
064882,000596:
064883,000597: 21,3532 E6,1536 EBANK= AOSQ
064884,000598: 21,3532 03270 36106 CLOSEADR 2CADR CLOSEOUT # TERMINATE THE JASK.
064885,000599:
064886,000600: 21,3534 5752 TWELVE EQUALS OCT14
064887,000601: 21,3534 26501 ROOTHALF OCTAL 26501 # SQUARE ROOT OF 1/2
064888,000602: 21,3535 01400 GMBLBITA OCTAL 01400 # INDEXED WRT GMBLBITB DO NOT MOVE******
064889,000603: 21,3536 11276 OCT11276 OCTAL 11276 # POSMAX - ROOTHALF
064890,000604: 21,3537 06000 GMBLBITB OCTAL 06000 # INDEXED WRT GMBLBITA DO NOT MOVE******
064891,000605:
064892,000606: # SUBROUTINE ROOTCYCL: BY CRAIG WORK,3 APRIL 68
064893,000607: # ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION. THE INITIAL GUESS AT THE
064894,000608: # SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG. THE NEW APPROXI-
064895,000609: # MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER. DEBRIS: A,L,SR,SCRATCH. ROOTCYCL IS CALLED FROM
064896,000610: # LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
064897,000611:
064898,000612: # WARNING: IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
064899,000613:
064900,000614: 21,3540 55745 ROOTCYCL TS SCRATCH # STORE X
064901,000615: 21,3541 54021 TS SR # X/2 NOW IN SR
064902,000616: 21,3542 31746 CA HALFARG # ARG/2 IN THE A REG
064903,000617: 21,3543 22007 ZL # PREPARE FOR DIVISION
064904,000618: 21,3544 00006 EXTEND
064905,000619: 21,3545 11745 DV SCRATCH # (ARG/X)/2
064906,000620: 21,3546 60021 AD SR # (X + ARG/X)/2 IN THE A REG
064907,000621: 21,3547 00002 TC Q
End of include-file TRIM_GIMBAL_CONTROL_SYSTEM.agc. Parent file is MAIN.agc