Source Code
These source-code files are part of a reconstructed copy of Luminary 178, the
final release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 178 listing would be different. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. |
063013,000002: ## Copyright: Public domain.
063014,000003: ## Filename: TRIM_GIMBAL_CONTROL_SYSTEM.agc
063015,000004: ## Purpose: A section of Luminary revision 178.
063016,000005: ## It is part of the reconstructed source code for the final
063017,000006: ## release of the flight software for the Lunar Module's
063018,000007: ## (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
063019,000008: ## code has been recreated from copies of Zerlina 56, Luminary
063020,000009: ## 210, and Luminary 131, as well as many Luminary memos.
063021,000010: ## It has been adapted such that the resulting bugger words
063022,000011: ## exactly match those specified for Luminary 178 in NASA
063023,000012: ## drawing 2021152N, which gives relatively high confidence
063024,000013: ## that the reconstruction is correct.
063025,000014: ## Reference: pp. 1460-1472
063026,000015: ## Assembler: yaYUL
063027,000016: ## Contact: Ron Burkey <info@sandroid.org>.
063028,000017: ## Website: www.ibiblio.org/apollo/index.html
063029,000018: ## Mod history: 2019-08-14 MAS Created from Zerlina 56.
063030,000019: ## 2021-05-30 ABS GTSGO+DN -> GTSGO+ON
063031,000020:
Page 1460 |
063033,000022: 21,2654 BANK 21
063034,000023: 21,2654 E6,1450 EBANK= QDIFF
063035,000024: 21,2000 SETLOC DAPS4
063036,000025: 21,2000 BANK
063037,000026:
063038,000027: 21,2654 COUNT* $$/DAPGT
063039,000028:
063040,000029: # CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
063041,000030: # AUTOPILOT ARE BOTH ON:
063042,000031: # A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
063043,000032: # INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
063044,000033: # B) THE Q,R-AXES RCS AUTOPILOT DETERMINED THAT THE VEHICLE WAS ENTERING (OR HAD JUST ENTERED) A COAST
063045,000034: # ZONE WITH A SMALL OFFSET ANGULAR ACCELERATION.
063046,000035:
063047,000036: # GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
063048,000037:
063049,000038: 21,2654 37752 GTS CAF NEGONE # MAKE THE NEXT PASS THROUGH THE DAP BE
063050,000039: 21,2655 55630 TS COTROLER # THROUGH RCS CONTROL,
063051,000040: 21,2656 34751 CAF FOUR # AND ENSURE THAT IT IS NOT A SKIP.
063052,000041: 21,2657 55534 TS SKIPU
063053,000042: 21,2660 55535 TS SKIPV
063054,000043:
063055,000044: 21,2661 34752 CAF TWO
063056,000045: 21,2662 55632 TS INGTS # SET INDICATOR OF GTS CONTROL POSITIVE.
063057,000046: 21,2663 55631 TS QGIMTIMR # SET TIMERS TO 200 MSEC TO AVOID BOTH
063058,000047: 21,2664 55633 TS RGIMTIMR # RUNAWAY AND INTERFERENCE BY NULLING.
063059,000048:
063060,000049: # THE DRIVE SETTING ALGORITHM
063061,000050:
063062,000051: # DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
063063,000052:
063064,000053: # 2 1/2 2 3/2
063065,000054: # NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K (DEL*OMEGA + ALPHA /(2*K))
063066,000055:
063067,000056: # DRIVE = -SGN(NEGUSUM)
063068,000057:
063069,000058: 21,2665 30021 CA SR # SAVE THE SR. SHIFT IT LEFT TO CORRECT
063070,000059: 21,2666 60000 AD A # FOR THE RIGHT SHIFT DUE TO EDITING.
063071,000060: 21,2667 55505 TS SAVESR
063072,000061:
063073,000062: 21,2670 34752 GTSGO+ON CAF TWO # SET INDEXER FOR R-AXIS CALCULATIONS.
063074,000063: 21,2671 12673 TCF GOQTRIMG +1
063075,000064:
063076,000065: 21,2672 34755 GOQTRIMG CAF ZERO # SET INDEXER FOR Q-AXIS CALCULATIONS
063077,000066: 21,2673 55747 TS QRCNTR
063078,000067:
063079,000068: 21,2674 51747 INDEX QRCNTR # AOS SCALED AT PI/2
063080,000069: 21,2675 31536 CA AOSQ
063081,000070: 21,2676 00006 EXTEND
063082,000071: 21,2677 74752 MP BIT2 # RESCALE AOS TO PI/4
063083,000072:
Page 1461 |
063085,000074: 21,2700 00006 EXTEND
063086,000075: 21,2701 12705 BZF GTSQAXIS -3 # USE FULL SCALE FOR LARGER AOS ESTIMATES.
063087,000076:
063088,000077: 21,2702 50000 INDEX A
063089,000078: 21,2703 44734 CS LIMITS # LIMITS +1 CONTAINS NEGMAX.
063090,000079: 21,2704 56001 XCH L # LIMITS -1 CONTAINS POSMAX.
063091,000080:
063092,000081: 21,2705 11747 CCS QRCNTR # PICK UP RATE FOR THIS AXIS. RATE CELLS
063093,000082: 21,2706 50000 INDEX A # ARE ADJACENT, NOT SEPARATED. AT PI/4
063094,000083: 21,2707 31436 CA EDOTQ
063095,000084: 21,2710 53743 GTSQAXIS DXCH WCENTRAL
063096,000085:
063097,000086: 21,2711 51747 INDEX QRCNTR # COLLECT K FOR THIS AXIS
063098,000087: 21,2712 31504 CA KQ
063099,000088: 21,2713 55740 TS KCENTRAL
063100,000089:
063101,000090: 21,2714 00006 EXTEND # CONTROL AUTHORITY ZERO. AVOID DRIVING
063102,000091: 21,2715 13353 BZF POSDRIVE +1 # ENGINE BELL TO THE STOPS.
063103,000092:
063104,000093: 21,2716 51747 INDEX QRCNTR # QDIFF, RDIFF ARE STORED IN D.P.
063105,000094: 21,2717 31450 CAE QDIFF
063106,000095:
063107,000096: 21,2720 00006 ALGORTHM EXTEND # Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
063108,000097: 21,2721 71740 MP KCENTRAL # FORM K*ERROR AT PI(2)/2(8), IN D.P.
063109,000098: 21,2722 23736 LXCH K2THETA
063110,000099: 21,2723 00006 EXTEND
063111,000100: 21,2724 74747 MP BIT5 # RESCALE TO 4*PI(2)
063112,000101: 21,2725 53737 DXCH K2THETA
063113,000102: 21,2726 00006 EXTEND
063114,000103: 21,2727 74747 MP BIT5 # FIRST TERM OF NEGUSUM IN K2THETA.
063115,000104: 21,2730 27737 ADS K2THETA +1 # NO CARRY NEEDED D.P. AT 4*PI(2)
063116,000105:
063117,000106: 21,2731 41743 CS ACENTRAL # FORM ALPHA(2)/(2*K) AT 16*PI, IN D.P.,
063118,000107: 21,2732 00006 EXTEND # LIMITING QUOTIENT TO AVOID OVERFLOW.
063119,000108: 21,2733 74736 MP BIT14 # -ALPHA/2 IN A, SCALED AT PI/4
063120,000109: 21,2734 00006 EXTEND
063121,000110: 21,2735 71743 MP ACENTRAL # -ALPHA(2)/2 IN A,L, SCALED AT PI(2)/16
063122,000111: 21,2736 61740 AD KCENTRAL
063123,000112: 21,2737 00006 EXTEND
063124,000113: 21,2740 62755 BZMF HUGEQUOT # K-ALPHA(2)/2 SHOULD BE PNZ FO DIVISION
063125,000114:
063126,000115: 21,2741 00006 EXTEND
063127,000116: 21,2742 40001 DCS A # ALPHA(2)/2 - K
063128,000117: 21,2743 61740 AD KCENTRAL
063129,000118: 21,2744 00006 EXTEND
063130,000119: 21,2745 11740 DV KCENTRAL # HIGH ORDER OF QUOTIENT.
063131,000120: 21,2746 57745 XCH A2CNTRAL
063132,000121: 21,2747 30001 CA L # SHIFT UP THE REMAINDER.
063133,000122: 21,2750 22007 LXCH 7 # ZERO LOW-ORDER DIVIDEND.
063134,000123: 21,2751 00006 EXTEND
Page 1462 |
063136,000125: 21,2752 11740 DV KCENTRAL
063137,000126: 21,2753 57746 XCH A2CNTRAL +1 # QUOTIENT STORED AT 16*PI, D.P.
063138,000127: 21,2754 12760 TCF HAVEQUOT
063139,000128:
063140,000129: 21,2755 34733 HUGEQUOT CA POSMAX
063141,000130: 21,2756 54001 TS L
063142,000131: 21,2757 53746 DXCH A2CNTRAL # LIMITED QUOTIENT STORED AT 16*PI, D.P.
063143,000132:
063144,000133: 21,2760 31742 HAVEQUOT CA WCENTRAL
063145,000134: 21,2761 00006 EXTEND
063146,000135: 21,2762 74743 MP BIT9 # RESCALE OMEGA AT 16*PI IN D.P.
063147,000136: 21,2763 53742 DXCH K2CNTRAL # LOWER WORD OVERLAYS OMEGA IN WCENTRAL
063148,000137:
063149,000138: 21,2764 00006 EXTEND
063150,000139: 21,2765 31742 DCA K2CNTRAL
063151,000140: 21,2766 53751 DXCH FUNCTION
063152,000141:
063153,000142: 21,2767 31743 CA ACENTRAL # GET ALPHA*ABS(ALPHA)/(2*K)
063154,000143: 21,2770 00006 EXTEND
063155,000144: 21,2771 62775 BZMF +4
063156,000145:
063157,000146: 21,2772 00006 EXTEND
063158,000147: 21,2773 31746 DCA A2CNTRAL
063159,000148: 21,2774 12777 TCF +3
063160,000149:
063161,000150: 21,2775 00006 EXTEND
063162,000151: 21,2776 41746 DCS A2CNTRAL
063163,000152:
063164,000153: 21,2777 21751 DAS FUNCTION # OMEGA + ALPHA*ABS(ALPHA)/2*K) AT 16*PI
063165,000154:
063166,000155: 21,3000 11750 CCS FUNCTION # DEL = +1 FOR FUNCT1 GREATER THAN ZERO.
063167,000156: 21,3001 13005 TCF POSFNCT1 # OTHERWISE DEL = -1
063168,000157: 21,3002 13004 TCF +2
063169,000158: 21,3003 13007 TCF NEGFNCT1
063170,000159:
063171,000160: 21,3004 11751 CCS FUNCTION +1 # USE LOW ORDER WORD SINCE HIGH IS ZERO
063172,000161: 21,3005 34753 POSFNCT1 CAF BIT1
063173,000162: 21,3006 13010 TCF +2
063174,000163: 21,3007 44753 NEGFNCT1 CS BIT1
063175,000164: 21,3010 55744 TS DEL
063176,000165:
063177,000166: 21,3011 11744 CCS DEL # REPLACE OMEGA BY DEL*OMEGA
063178,000167: 21,3012 13024 TCF FUNCT2 # POSITIVE DEL VALUE. PROCEED.
063179,000168: 21,3013 13015 TCF DEFUNCT
063180,000169: 21,3014 13021 TCF NEGFNCT2
063181,000170:
063182,000171: 21,3015 55741 DEFUNCT TS K2CNTRAL
063183,000172: 21,3016 55742 TS K2CNTRAL +1
063184,000173: 21,3017 13024 TCF FUNCT2
063185,000174:
Page 1463 |
063187,000176: 21,3020 65252 NEG1/3 DEC -.33333
063188,000177:
063189,000178: 21,3021 00006 NEGFNCT2 EXTEND
063190,000179: 21,3022 41742 DCS K2CNTRAL
063191,000180: 21,3023 53742 DXCH K2CNTRAL
063192,000181:
063193,000182: 21,3024 00006 FUNCT2 EXTEND
063194,000183: 21,3025 31746 DCA A2CNTRAL
063195,000184: 21,3026 21742 DAS K2CNTRAL # DEL*OMEGA + ALPHA(2)/(2*K) AT 16*PI,D.P.
063196,000185:
063197,000186: 21,3027 31745 FUNCT3 CA A2CNTRAL
063198,000187: 21,3030 00006 EXTEND
063199,000188: 21,3031 73020 MP NEG1/3
063200,000189: 21,3032 53746 DXCH A2CNTRAL
063201,000190: 21,3033 30001 CA L
063202,000191: 21,3034 00006 EXTEND
063203,000192: 21,3035 73020 MP NEG1/3
063204,000193: 21,3036 27746 ADS A2CNTRAL +1
063205,000194: 21,3037 54001 TS L
063206,000195: 21,3040 13042 TCF +2 # A2CNTRAL NOW CONTAINS -ALPHA(2)/(6*K),
063207,000196: 21,3041 27745 ADS A2CNTRAL # SCALED AT 16*PI, IN D.P.
063208,000197:
063209,000198: 21,3042 00006 EXTEND
063210,000199: 21,3043 31742 DCA K2CNTRAL # DEL*OMEGA + ALPHA(2)/(3*K) IN A2CNTRAL,
063211,000200: 21,3044 21746 DAS A2CNTRAL # SCALED AT 16*PI, D.P.
063212,000201:
063213,000202: 21,3045 31745 CA A2CNTRAL
063214,000203: 21,3046 00006 EXTEND
063215,000204: 21,3047 71743 MP ACENTRAL
063216,000205: 21,3050 21737 DAS K2THETA
063217,000206: 21,3051 31746 CA A2CNTRAL +1
063218,000207: 21,3052 00006 EXTEND
063219,000208: 21,3053 71743 MP ACENTRAL # ACENTRAL MAY NOW BE OVERLAID.
063220,000209: 21,3054 27737 ADS K2THETA +1
063221,000210: 21,3055 54001 TS L
063222,000211: 21,3056 13060 TCF +2 # TWO TERMS OF NEGUSUM ACCUMULATED, SO FAR
063223,000212: 21,3057 27736 ADS K2THETA # SCALED AT 4*PI(2), IN D.P.
063224,000213:
063225,000214: 21,3060 31741 GETROOT CA K2CNTRAL # K*(DEL*OMEGA + ALPHA(2)/(2*K)) IS THE
063226,000215: 21,3061 00006 EXTEND # TERM FOR WHICH A SQUARE ROOT IS NEEDED.
063227,000216: 21,3062 71740 MP KCENTRAL # K AT PI/2(8)
063228,000217: 21,3063 53751 DXCH FUNCTION
063229,000218: 21,3064 31742 CA K2CNTRAL +1
063230,000219: 21,3065 00006 EXTEND
063231,000220: 21,3066 71740 MP KCENTRAL
063232,000221: 21,3067 27751 ADS FUNCTION +1
063233,000222: 21,3070 54001 TS L
063234,000223: 21,3071 13073 TCF +2
063235,000224: 21,3072 27750 ADS FUNCTION # DESIRED TERM IN FUNCTION, AT PI(2)/16
Page 1464 |
063237,000226: 21,3073 11744 CCS DEL
063238,000227: 21,3074 13301 TCF RSTOFGTS
063239,000228: 21,3075 13343 TCF NEGUSUM
063240,000229: 21,3076 13100 TCF NEGATE
063241,000230: 21,3077 13343 TCF NEGUSUM
063242,000231:
063243,000232: 21,3100 00006 NEGATE EXTEND
063244,000233: 21,3101 41742 DCS K2CNTRAL
063245,000234: 21,3102 53742 DXCH K2CNTRAL
063246,000235: 21,3103 13301 TCF RSTOFGTS
063247,000236:
063248,000237: 16,3740 BANK 16
063249,000238: 16,3740 E6,1501 EBANK= NEGUQ
063250,000239: 16,2000 SETLOC DAPS1
063251,000240: 16,2000 BANK
063252,000241:
063253,000242: # THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
063254,000243: # THE NEGATIVES OF THE DESIRED ACCELERATION CHANGES. ACDT+C12 SETS Q(R)ACCDOT TO REFLECT THE NEW DRIVES.
063255,000244:
063256,000245: # WARNING: ACDT+C12 AND WRCHN12 MUST BE CALLED WITH INTERRUPT INHIBITED.
063257,000246:
063258,000247: 16,3740 07400 BGIM OCTAL 07400
063259,000248: 16,3741 0066 CHNL12 EQUALS ITEMP6
063260,000249: 16,3741 41501 ACDT+C12 CS NEGUQ
063261,000250: 16,3742 00006 EXTEND # GIMBAL DRIVE REQUESTS.
063262,000251: 16,3743 71507 MP ACCDOTQ
063263,000252: 16,3744 23510 LXCH QACCDOT
063264,000253: 16,3745 41503 CS NEGUR
063265,000254: 16,3746 00006 EXTEND
063266,000255: 16,3747 71511 MP ACCDOTR
063267,000256: 16,3750 23512 LXCH RACCDOT
063268,000257:
063269,000258: 16,3751 11501 CCS NEGUQ
063270,000259: 16,3752 34742 CAF BIT10
063271,000260: 16,3753 13755 TCF +2
063272,000261: 16,3754 34743 CAF BIT9
063273,000262: 16,3755 54066 TS CHNL12
063274,000263:
063275,000264: 16,3756 11503 CCS NEGUR
063276,000265: 16,3757 34740 CAF BIT12
063277,000266: 16,3760 13762 TCF +2
063278,000267: 16,3761 34741 CAF BIT11
063279,000268: 16,3762 26066 ADS CHNL12 # (STORED RESULT NOT USED AT PRESENT)
063280,000269:
063281,000270: 16,3763 43740 CS BGIM
063282,000271: 16,3764 00006 EXTEND
063283,000272: 16,3765 02012 RAND CHAN12
063284,000273: 16,3766 60066 AD CHNL12
063285,000274: 16,3767 00006 EXTEND
063286,000275: 16,3770 01012 WRITE CHAN12
063287,000276:
Page 1465 |
063289,000278: 16,3771 44747 CS CALLGMBL # TURN OFF REQUEST FOR ACDT+C12 EXECUTION.
063290,000279: 16,3772 71262 MASK RCSFLAGS
063291,000280: 16,3773 55262 TS RCSFLAGS
063292,000281:
063293,000282: 16,3774 00002 TC Q # RETURN TO CALLER.
063294,000283:
063295,000284: 21,3104 BANK 21
063296,000285: 21,3104 E6,1450 EBANK= QDIFF
063297,000286: 21,2000 SETLOC DAPS4
063298,000287: 21,2000 BANK
063299,000288:
Page 1466 |
063301,000290: # SUBROUTINE TIMEGMBL: MOD 0, OCTOBER 1967, CRAIG WORK
063302,000291:
063303,000292: # TIMEGMBL COMPUTES THE DRIVE TIME NEEDED FOR THE TRIM GIMBAL TO POSITION THE DESCENT ENGINE NOZZLE SO AS TO NULL
063304,000293: # THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS. INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
063305,000294: # SCALED AT PI/8. FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT). A ZERO
063306,000295: # ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY. OTHERWISE, THE GIMBAL IS TURNED ON
063307,000296: # DRIVING IN THE CORRECT DIRECTION. THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
063308,000297: # IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE. NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
063309,000298: # WHICH IS NEGATIVE, ZERO, OR POSITIVE.
063310,000299:
063311,000300: # INPUTS: AOSQ,AOSR, SCALED AT P1/2, AND ACCDOTQ, ACCDOTR AT PI/2(7). PI/2(7).
063312,000301:
063313,000302: # OUTPUTS: NEW GIMBAL DRIVE BITS IN CHANNEL 12,NEGUQ,NEGUR,QACCDOT AND RACCDOT, THE LAST SCALED AT PI/2(7).
063314,000303: # Q(R)GIMTIMR WILL BE SET TO TIME AND TERMINATE GIMBAL DRIVE(S)
063315,000304:
063316,000305: # DEBRIS: A,L,Q, ITEMPS 2,3,6, RUPTREG2 AND ACDT+C12 DEBRIS.
063317,000306:
063318,000307: # EXITS: VIA TC Q.
063319,000308:
063320,000309: # ALARMS, ABORTS, : NONE
063321,000310:
063322,000311: # SUBROUTINES: ACDT+C12, IBNKCALL
063323,000312:
063324,000313: # WARNING: THIS SUBROUTINE WRITES INTO CHANNEL 12 AND USES THE ITEMPS. THEREFORE IT MAY ONLY BE CALLED WITH
063325,000314: # INTERRUPT INHIBITED.
063326,000315:
063327,000316: # ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
063328,000317:
063329,000318: # NEGUQ ERASE +2 NEGATIVE OF Q-AXIS GIMBAL DRIVE
063330,000319: # (SPWORD) EQUALS NEGUQ +1 ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
063331,000320: # NEGUR EQUALS NEGUQ +2 NEGATIVE OF R-AXIS GIMBAL DRIVE
063332,000321:
063333,000322: # ACCDOTQ ERASE +2 Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
063334,000323: # (SPWORD) EQUALS ACCDOTQ +1 ANY S.P. ERASABLE NUMBER NOW QACCDOT
063335,000324: # ACCDOTR EQUALS ACCDOTQ +2 R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
063336,000325: # ACCDOTQ,ACCDOTR ARE MAGNITUDES.
063337,000326: # AOSQ ERASE +4 Q-AXIS ACC.,D.P. AT PI/2 R/SEC(2)
063338,000327: # AOSR EQUALS AOSQ +2 R-AXIS ACCELERATION SCALED AT PI/2 R/S2
063339,000328:
063340,000329: 21,3104 0066 QRNDXER EQUALS ITEMP6
063341,000330: 21,3104 23146 OCT23146 OCTAL 23146 # DECIMAL .6
063342,000331: 21,3105 0063 NZACCDOT EQUALS ITEMP3
063343,000332:
063344,000333: 21,3105 34753 TIMEGMBL CAF ONE # INITIALIZE ALLOWGTS.
063345,000334: 21,3106 55502 TS ALLOWGTS
063346,000335:
063347,000336: 21,3107 34752 CAF TWO # SET UP LOOP FOR R AXIS.
063348,000337: 21,3110 22002 LXCH Q # SAVE RETURN ADDRESS.
063349,000338: 21,3111 22071 LXCH RUPTREG2
Page 1467 |
063351,000340: 21,3112 13114 TCF +2
063352,000341: 21,3113 34755 TIMQGMBL CAF ZERO # NOW DO THE Q-AXIS
063353,000342: 21,3114 54066 TS QRNDXER
063354,000343: 21,3115 50066 INDEX QRNDXER
063355,000344: 21,3116 31507 CA ACCDOTQ # ACCDOT IS PRESUMED TO BE AT PI/2(7).
063356,000345: 21,3117 00006 EXTEND
063357,000346: 21,3120 63170 BZMF TGOFFNOW # IS ACCDOT LESS THAN OR EQUAL TO 0?
063358,000347: 21,3121 54063 TS NZACCDOT # NO. STORE NON-ZERO, POSITIVE ACCDOT.
063359,000348:
063360,000349: 21,3122 50066 ALPHATRY INDEX QRNDXER
063361,000350: 21,3123 41536 CS AOSQ
063362,000351: 21,3124 00006 EXTEND
063363,000352: 21,3125 13170 BZF TGOFFNOW # IS ALPHA ZERO?
063364,000353:
063365,000354: 21,3126 54002 TS Q # SAVE A COPY OF -AOS.
063366,000355: 21,3127 00006 EXTEND # NO. RESCALE FOR TIMEGMBL USE.
063367,000356: 21,3130 73104 MP OCT23146 # OCTAL 23146 IS DECIMAL .6
063368,000357: 21,3131 60002 AD Q # -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
063369,000358: 21,3132 54001 TS L # WAS THERE OVERFLOW?
063370,000359: 21,3133 13140 TCF SETNEGU # NO. COMPUTE DRIVE TIME.
063371,000360:
063372,000361: 21,3134 40000 CS A # RECOVER -SGN(AOS) IN THE A REGISTER.
063373,000362: 21,3135 50066 INDEX QRNDXER # YES. START DRIVE WITHOUT WAITLIST.
063374,000363: 21,3136 57501 XCH NEGUQ
063375,000364: 21,3137 13174 TCF NOTALLOW # KNOCK DOWN THE ALLOWGTS FLAG.
063376,000365:
063377,000366: 21,3140 00006 SETNEGU EXTEND
063378,000367: 21,3141 63146 BZMF POSALPH
063379,000368:
063380,000369: 21,3142 40000 COM
063381,000370: 21,3143 54062 TS ITEMP2 # STORE -ABS(.4*AOS) SCALED AT PI/8.
063382,000371: 21,3144 44753 CS BIT1
063383,000372: 21,3145 13150 TCF POSALPH +2
063384,000373: 21,3146 54062 POSALPH TS ITEMP2 # STORE -ABS(.4*AOS) SCALED AT PI/8.
063385,000374: 21,3147 34753 CA BIT1
063386,000375: 21,3150 50066 +2 INDEX QRNDXER # SGN(AOS) INTO NEGU
063387,000376: 21,3151 55501 TS NEGUQ # STORE SGN(APLHA) AS NEGU
063388,000377:
063389,000378: 21,3152 30063 CA NZACCDOT
063390,000379: 21,3153 00006 EXTEND
063391,000380: 21,3154 74740 MP BIT12 # 2*ACCDOT, SCALED AT PI/8.
063392,000381: 21,3155 60062 AD ITEMP2 # -ABS(ALPHA) + 2*ACCDOT, AT PI/8.
063393,000382: 21,3156 00006 EXTEND
063394,000383: 21,3157 63174 BZMF NOTALLOW # IS DRIVE TIME MORE THAN TWO SECONDS?
063395,000384: 21,3160 40062 CS ITEMP2 # NO. COMPUTE DRIVE TIME.
063396,000385: 21,3161 00006 EXTEND # ABS(ALPHA) AT PI/8.
063397,000386: 21,3162 73215 MP OCT00240 # DECIMAL 10/1024
063398,000387: 21,3163 00006 EXTEND # QUOTIENT IS DRIVE TIME AT WAITLIST.
063399,000388: 21,3164 10063 DV NZACCDOT # ABS(ALPHA)/ACCDOT AT 2(14)/100
063400,000389:
Page 1468 |
063402,000391: 21,3165 00006 EXTEND
063403,000392: 21,3166 13170 BZF TGOFFNOW # DRIVE TIME MUST BE GREATER THAN ZERO.
063404,000393:
063405,000394: 21,3167 13202 TCF DRIVEON
063406,000395:
063407,000396: 21,3170 34755 TGOFFNOW CAF ZERO # TURN OFF GIMBAL NOW.
063408,000397: 21,3171 50066 INDEX QRNDXER
063409,000398: 21,3172 55501 TS NEGUQ
063410,000399:
063411,000400: 21,3173 13204 TCF DONEYET
063412,000401:
063413,000402: 21,3174 36010 NOTALLOW CAF OCT31
063414,000403: 21,3175 50066 INDEX QRNDXER
063415,000404: 21,3176 55631 TS QGIMTIMR
063416,000405: 21,3177 34755 CAF ZERO # DRIVE TIME IS MORE THAN 2 SECONDS, SO
063417,000406: 21,3200 55502 TS ALLOWGTS # DO NOT PERMIT FURTHER GTS ATTITUDE-RATE
063418,000407: # CONTROL UNTIL AOSTASK APPROVES.
063419,000408: 21,3201 13204 TCF DONEYET # NO WAITLIST CALL IS MADE.
063420,000409:
063421,000410: 21,3202 50066 DRIVEON INDEX QRNDXER
063422,000411: 21,3203 55631 TS QGIMTIMR # CHOOSE Q OR R AXIS.
063423,000412:
063424,000413: 21,3204 10066 DONEYET CCS QRNDXER
063425,000414: 21,3205 13113 TCF TIMQGMBL
063426,000415:
063427,000416: 21,3206 52073 DXCH RUPTREG3 # PROTECT IBNKCALL ERASABLES. ACDT+C12
063428,000417: 21,3207 52063 DXCH ITEMP2 # LEAVES ITEMPS2,3 ALONE.
063429,000418:
063430,000419: 21,3210 04674 TC IBNKCALL # TURN OF CHANNEL BITS, SET Q(R)ACCDOTS.
063431,000420: 21,3211 35741 CADR ACDT+C12
063432,000421:
063433,000422: 21,3212 52063 DXCH ITEMP2 # RESTORE ERASABLES FOR IBNKCALL.
063434,000423: 21,3213 52073 DXCH RUPTREG3
063435,000424:
063436,000425: 21,3214 00071 TC RUPTREG2 # RETURN TO CALLER.
063437,000426:
063438,000427: 21,3215 00240 OCT00240 OCTAL 00240 # DECIMAL 10/1024
063439,000428:
Page 1469 |
063441,000430: # THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY. THE QUANTITY NEGUSUM
063442,000431: # IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM. NEW DRIVES ARE ENTERED TO CH 12.
063443,000432:
063444,000433: # THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
063445,000434: # SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT. ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
063446,000435: # EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
063447,000436: # POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
063448,000437: # SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT. CELLS CLOBBERED ARE A,L,SHFTFLAG,ININDEX,
063449,000438: # HALFARG,SCRATCH,SR,FUNCTION, FUNCTION +1. GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
063450,000439: # ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
063451,000440:
063452,000441: 21,3216 11750 GTSQRT CCS FUNCTION
063453,000442: 21,3217 13235 TCF GOODARG # FUNCTION IS POSITIVE. TAKE SQUARE ROOT.
063454,000443: 21,3220 13222 TCF +2 # HIGH ORDER WORD IS ZERO. TRY THE LOWER.
063455,000444: 21,3221 13226 TCF ZEROOT # NEGATIVE. USE ZERO FOR 1/2 POWER.
063456,000445:
063457,000446: 21,3222 31751 CA FUNCTION +1
063458,000447: 21,3223 00006 EXTEND
063459,000448: 21,3224 63226 BZMF ZEROOT
063460,000449:
063461,000450: 21,3225 13231 TCF ZEROHIGH # PROCEED.
063462,000451: 21,3226 34755 ZEROOT CA ZERO
063463,000452: 21,3227 55740 TS SHFTFLAG
063464,000453: 21,3230 00002 TC Q
063465,000454:
063466,000455: 21,3231 57750 ZEROHIGH XCH FUNCTION # 14 MOST SIGNIFICANT BITS ARE IN THE
063467,000456: 21,3232 57751 XCH FUNCTION +1 # LOWER WORD. EXCHANGE THEM.
063468,000457: 21,3233 34757 CA SEVEN
063469,000458: 21,3234 13236 TCF GOODARG +1
063470,000459:
063471,000460: 21,3235 34755 GOODARG CA ZERO
063472,000461: 21,3236 55740 TS SHFTFLAG
063473,000462: 21,3237 35752 CA TWELVE # INITIALIZE THE SCALING LOOP.
063474,000463: 21,3240 55743 TS ININDEX
063475,000464: 21,3241 13250 TCF SCALLOOP
063476,000465:
063477,000466: 21,3242 31750 SCALSTRT CA FUNCTION
063478,000467: 21,3243 13264 TCF SCALDONE
063479,000468:
063480,000469: 21,3244 37751 MULBUSH CA NEG2 # IF ARG IS NOT LESS THAN 1/4, INDEX IS
063481,000470: 21,3245 27743 ADS ININDEX # ZERO, INDICATING NO SHIFT NEEDED.
063482,000471: 21,3246 00006 EXTEND # BRANCH IF ARG IS NOT LESS THAN 1/4.
063483,000472: 21,3247 63242 BZMF SCALSTRT # OTHERWISE COMPARE ARG WITH A REFERENCE
063484,000473: # WHICH IS 4 TIMES LARGER THAN THE LAST.
063485,000474: 21,3250 41750 SCALLOOP CS FUNCTION
063486,000475: 21,3251 51743 INDEX ININDEX
063487,000476: 21,3252 64735 AD BIT15 # REFERENCE MAGNITUDE LESS OR EQUAL TO 1/4
063488,000477: 21,3253 00006 EXTEND
063489,000478: 21,3254 63244 BZMF MULBUSH # IF ARG IS NOT LESS THAN REFERENCE, GO
063490,000479: # AROUND THE MULBERRY BUSH ONCE MORE.
063491,000480:
Page 1470 |
063493,000482: 21,3255 51743 INDEX ININDEX
063494,000483: 21,3256 34735 CA BIT15 # THIS IS THE SCALE MAGNITUDE
063495,000484: 21,3257 57746 XCH HALFARG # 2**(-ININDEX) IS THE SHIFT DIVISOR.
063496,000485: 21,3260 00006 EXTEND # RESCALE ARGUMENT.
063497,000486: 21,3261 31751 DCA FUNCTION
063498,000487: 21,3262 00006 EXTEND
063499,000488: 21,3263 11746 DV HALFARG
063500,000489: # ININDEX AND SHFTFLAG PRESERVE INFO FOR
063501,000490:
063502,000491: # RESCALING AFTER ROOT PROCESS.
063503,000492: 21,3264 00006 SCALDONE EXTEND
063504,000493: 21,3265 23751 QXCH FUNCTION +1 # SAVE Q FOR RETURN
063505,000494: 21,3266 00006 EXTEND
063506,000495: 21,3267 74736 MP BIT14
063507,000496: 21,3270 55746 TS HALFARG
063508,000497: 21,3271 74737 MASK BIT13
063509,000498: 21,3272 10000 CCS A
063510,000499: 21,3273 33411 CA OCT11276
063511,000500: 21,3274 63407 AD ROOTHALF # INITIAL GUESS IS ROOT 1/2 OR POSMAX
063512,000501:
063513,000502: 21,3275 03413 TC ROOTCYCL
063514,000503: 21,3276 03413 TC ROOTCYCL
063515,000504: 21,3277 03413 TC ROOTCYCL
063516,000505:
063517,000506: 21,3300 01751 TC FUNCTION +1
063518,000507:
063519,000508: # ****************************************************************************************************************
063520,000509:
063521,000510:
063522,000511: 21,3301 03216 RSTOFGTS TC GTSQRT
063523,000512: 21,3302 57741 PRODUCT XCH K2CNTRAL
063524,000513: 21,3303 00006 EXTEND
063525,000514: 21,3304 71741 MP K2CNTRAL
063526,000515: 21,3305 53742 DXCH K2CNTRAL
063527,000516: 21,3306 00006 EXTEND # THE PRODUCT OF
063528,000517: 21,3307 70001 MP L # 1/2 2 1/2
063529,000518: 21,3310 27742 ADS K2CNTRAL +1 # K *(DEL*OMEGA + ALPHA /(2*K))
063530,000519: 21,3311 54001 TS L # AND
063531,000520: 21,3312 13314 TCF +2 # 2
063532,000521: 21,3313 27741 ADS K2CNTRAL # DEL*(DEL*OMEGA + ALPHA /(2*K)) NOW IN
063533,000522: # K2CNTRAL
063534,000523:
063535,000524: 21,3314 31743 DOSHIFT CA ININDEX
063536,000525: 21,3315 00006 EXTEND # MULTIPLY IN THE FACTOR 2(-S), RETURNED
063537,000526: 21,3316 74736 MP BIT14 # BY THE GTSQRT SUBROUTINE
063538,000527: 21,3317 27740 ADS SHFTFLAG
063539,000528: 21,3320 00006 EXTEND
063540,000529: 21,3321 13340 BZF ADDITIN
063541,000530: 21,3322 51740 INDEX SHFTFLAG
063542,000531: 21,3323 34735 CA BIT15
Page 1471 |
063544,000533: 21,3324 57741 XCH K2CNTRAL
063545,000534: 21,3325 00006 EXTEND
063546,000535: 21,3326 71741 MP K2CNTRAL
063547,000536: 21,3327 21737 DAS K2THETA
063548,000537: 21,3330 57741 XCH K2CNTRAL
063549,000538: 21,3331 00006 EXTEND
063550,000539: 21,3332 71742 MP K2CNTRAL +1
063551,000540: 21,3333 27737 ADS K2THETA +1
063552,000541: 21,3334 54001 TS L
063553,000542: 21,3335 13337 TCF +2
063554,000543: 21,3336 27736 ADS K2THETA
063555,000544:
063556,000545: 21,3337 13343 TCF NEGUSUM
063557,000546:
063558,000547: 21,3340 00006 ADDITIN EXTEND
063559,000548: 21,3341 31742 DCA K2CNTRAL
063560,000549: 21,3342 21737 DAS K2THETA # NOW ADD IN THE K2THETA TERM.
063561,000550: 21,3343 11736 NEGUSUM CCS K2THETA # TEST SIGN OF HIGH ORDER PART.
063562,000551: 21,3344 13350 TCF NEGDRIVE
063563,000552: 21,3345 13347 TCF +2
063564,000553: 21,3346 13352 TCF POSDRIVE
063565,000554:
063566,000555: 21,3347 11737 CCS K2THETA +1 # SIGN TEST FOR LOW ORDER PART.
063567,000556: 21,3350 34753 NEGDRIVE CA BIT1
063568,000557: 21,3351 13353 TCF +2 # STOP GIMBAL DRIVE FOR A ZERO NEGUSUM.
063569,000558: 21,3352 44753 POSDRIVE CS BIT1
063570,000559: 21,3353 54001 TS L # SAVE FOR DRIVE REVERSAL TEST.
063571,000560: 21,3354 51747 INDEX QRCNTR
063572,000561: 21,3355 57501 XCH NEGUQ
063573,000562:
063574,000563: 21,3356 00006 EXTEND
063575,000564: 21,3357 70001 MP L # MULTIPLY OLD NEGU AND NEW NEGU.
063576,000565: 21,3360 10001 CCS L
063577,000566: 21,3361 13376 TCF LOUPE # NON-ZERO GIMBAL DRIVE BEING CONTINUED.
063578,000567:
063579,000568: 21,3362 13373 TCF ZEROLOUP # NO REVERSAL PROBLEM HERE.
063580,000569:
063581,000570: 21,3363 13365 TCF REVERSAL # NON-ZERO GIMBAL DRIVE BEING REVERSED.
063582,000571: 21,3364 13373 TCF ZEROLOUP # NO REVERSAL PROBLEM HERE.
063583,000572:
063584,000573: 21,3365 51747 REVERSAL INDEX QRCNTR # A ZERO-DRIVE PAUSE IS NEEDED HERE. ZERO
063585,000574: 21,3366 55510 TS QACCDOT # IS IN A REGISTER FROM CCS ON (-1).
063586,000575: 21,3367 51747 INDEX QRCNTR
063587,000576: 21,3370 43410 CS GMBLBITA
063588,000577: 21,3371 00006 EXTEND
063589,000578: 21,3372 03012 WAND CHAN12
063590,000579:
063591,000580: 21,3373 41262 ZEROLOUP CS RCSFLAGS # SET UP REQUEST FOR ACDT+C12 CALL.
063592,000581: 21,3374 74747 MASK CALLGMBL
063593,000582: 21,3375 27262 ADS RCSFLAGS
063594,000583:
Page 1472 |
063596,000585: 21,3376 11747 LOUPE CCS QRCNTR # HAVE BOTH AXES BEEN PROCESSED?
063597,000586: 21,3377 12672 TCF GOQTRIMG # NO. DO Q AXIS NEXT.
063598,000587:
063599,000588: 21,3400 31505 CA SAVESR # RESTORE THE SR
063600,000589: 21,3401 54021 TS SR
063601,000590:
063602,000591: 21,3402 00006 GOCLOSE EXTEND # TERMINATE THE JASK.
063603,000592: 21,3403 33406 DCA CLOSEADR
063604,000593: 21,3404 52006 DTCB
063605,000594:
063606,000595: 21,3405 E6,1536 EBANK= AOSQ
063607,000596: 21,3405 03270 36106 CLOSEADR 2CADR CLOSEOUT # TERMINATE THE JASK.
063608,000597:
063609,000598: 21,3407 5752 TWELVE EQUALS OCT14
063610,000599: 21,3407 26501 ROOTHALF OCTAL 26501 # SQUARE ROOT OF 1/2
063611,000600: 21,3410 01400 GMBLBITA OCTAL 01400 # INDEXED WRT GMBLBITB DO NOT MOVE******
063612,000601: 21,3411 11276 OCT11276 OCTAL 11276 # POSMAX - ROOTHALF
063613,000602: 21,3412 06000 GMBLBITB OCTAL 06000 # INDEXED WRT GMBLBITA DO NOT MOVE******
063614,000603:
063615,000604: # SUBROUTINE ROOTCYCL: BY CRAIG WORK,3 APRIL 68
063616,000605: # ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION. THE INITIAL GUESS AT THE
063617,000606: # SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG. THE NEW APPROXI-
063618,000607: # MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER. DEBRIS: A,L,SR,SCRATCH. ROOTCYCL IS CALLED FROM
063619,000608: # LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
063620,000609:
063621,000610: # WARNING: IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.
063622,000611:
063623,000612: 21,3413 55745 ROOTCYCL TS SCRATCH # STORE X
063624,000613: 21,3414 54021 TS SR # X/2 NOW IN SR
063625,000614: 21,3415 31746 CA HALFARG # ARG/2 IN THE A REG
063626,000615: 21,3416 22007 ZL # PREPARE FOR DIVISION
063627,000616: 21,3417 00006 EXTEND
063628,000617: 21,3420 11745 DV SCRATCH # (ARG/X)/2
063629,000618: 21,3421 60021 AD SR # (X + ARG/X)/2 IN THE A REG
063630,000619: 21,3422 00002 TC Q
End of include-file TRIM_GIMBAL_CONTROL_SYSTEM.agc. Parent file is MAIN.agc