Source Code
These source-code files are part of a reconstructed copy of Luminary 98, a
development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 98 listing. 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. |
013828,000002: ## Copyright: Public domain.
013829,000003: ## Filename: ATTITUDE_MANEUVER_ROUTINE.agc
013830,000004: ## Purpose: A section of Luminary revision 98.
013831,000005: ## It is part of the reconstructed source code for the a
013832,000006: ## development version of the flight software for the Lunar
013833,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
013834,000008: ## The code has been recreated from a copy of Luminary 99
013835,000009: ## revision 001, using asterisks indicating changed lines in
013836,000010: ## the listing and Luminary Memo #85, which lists changes between
013837,000011: ## Luminary 98 and 99.
013838,000012: ## Reference: pp. 342-363
013839,000013: ## Assembler: yaYUL
013840,000014: ## Contact: Ron Burkey <info@sandroid.org>.
013841,000015: ## Website: www.ibiblio.org/apollo/index.html
013842,000016: ## Mod history: 2019-07-28 MAS Created from Luminary 99.
013843,000017:
Page 342 |
013845,000019: # BLOCK 2 LGC ATTITUDE MANEUVER ROUTINE - KALCMANU
013846,000020:
013847,000021: # MOD 2 DATE 5/1/67 BY DON KEENE
013848,000022:
013849,000023: # PROGRAM DESCRIPTION
013850,000024:
013851,000025: # KALCMANU IS A ROUTINE WHICH GENERATES COMMANDS FOR THE LM DAP TO CHANGE THE ATTITUDE OF THE SPACECRAFT
013852,000026: # DURING FREE FALL. IT IS DESIGNED TO MANEUVER THE SPACECRAFT FROM ITS INITIAL ORIENTATION TO SOME DESIRED
013853,000027: # ORIENTATION SPECIFIED BY THE PROGRAM WHICH CALLS KALCMANU, AVOIDING GIMBAL LOCK IN THE PROCESS. IN THE
013854,000028: # MOD 2 VERSION, THIS DESIRED ATTITUDE IS SPECIFIED BY A SET OF THREE COMMANDED CDU ANGLES STORED AS 2S COMPLEMENT
013855,000029: # SINGLE PRECISION ANGLES IN THE THREE CONSECUTIVE LOCATIONS, CPHI, CTHETA, CPSI, WHERE
013856,000030:
013857,000031: # CPHI = COMMANDED OUTER GIMBAL ANGLE
013858,000032: # CTHETA = COMMANDED INNER GIMBAL ANGLE
013859,000033: # CPSI = COMMANDED MIDDLE GIMBAL ANGLE
013860,000034:
013861,000035: # WHEN POINTING A SPACECRAFT AXIS (E.I. X, Y, Z, THE AOT, THRUST AXIS, ETC) THE SUBROUTINE VECPOINT MAY BE
013862,000036: # USED TO GENERATE THIS SET OF DESIRED CDU ANGLES (SEE DESCRIPTION IN R60) -
013863,000037: # WITH THIS INFORMATION KALCMANU DETERMINES THE DIRECTION OF THE SINGLE EQUIVALENT ROTATION (COF ALSO U) AND THE
013864,000038: # MAGNITUDE OF THE ROTATION (AM) TO BRING THE S/C FROM ITS INITIAL ORIENTATION TO ITS FINAL ORIENTATION.
013865,000039: # THIS DIRECTION REMAINS FIXED BOTH IN INERTIAL COORDINATES AND IN COMMANDED S/C AXES THROUGHOUT THE
013866,000040: # -
013867,000041: # MANEUVER. ONCE COF AND AM HAVE BEEN DETERMINED, KALCMANU THEN EXAMINES THE MANEUVER TO SEE IF IT WILL BRING
013868,000042: # -
013869,000043: # THE S/C THROUGH GIMBAL LOCK. IF SO, COF AND AM ARE READJUSTED SO THAT THE S/C WILL JUST SKIM THE GIMBAL
013870,000044: # LOCK ZONE AND ALIGN THE X-AXIS. IN GENERAL A FINAL YAW ABOUT X WILL BE NECESSARY TO COMPLETE THE MANEUVER.
013871,000045: # NEEDLESS TO SAY, NEITHER THE INITIAL NOR THE FINAL ORIENTATION CAN BE IN GIMBAL LOCK.
013872,000046:
013873,000047: # FOR PROPER ATTITUDE CONTROL THE DIGITAL AUTOPILOT MUST BE GIVEN AN ATTITUDE REFERENCE WHICH IT CAN TRACK.
013874,000048: # KALCMANU DOES THIS BY GENERATING A REFERENCE OF DESIRED GIMBAL ANGLES (CDUXD, CDUYD, CDUZD) WHICH ARE UPDATED
013875,000049: # EVERY ONE SECOND DURING THE MANEUVER. TO ACHIEVE A SMOOTHER SEQUENCE OF COMMANDS BETWEEN SUCCESSIVE UPDATES,
013876,000050: # THE PROGRAM ALSO GENERATES A SET OF INCREMENTAL CDU ANGLES (DELDCDU) TO BE ADDED TO CDU DESIRED BY THE DIGITAL
013877,000051: # AUTOPILOT. KALCMANU ALSO CALCULATES THE COMPONENT MANEUVER RATES (OMEGAPD, OMEGAQD, OMEGARD), WHICH CAN
013878,000052: # -
013879,000053: # BE DETERMINED SIMPLY BY MULTIPLYING COF BY SOME SCALAR (ARATE) CORRESPONDING TO THE DESIRED ROTATIONAL RATE.
013880,000054:
013881,000055: # AUTOMATIC MANEUVERS ARE TIMED WITH THE HELP OF WAITLIST SO THAT AFTER A SPECIFIED INTERVAL THE Y AND Z
013882,000056: # DESIRED RATES ARE SET TO ZERO AND THE DESIRED CDU ANGLES (CDUYD, CDUZD) ARE SET EQUAL TO THE FINAL DESIRED CDU
013883,000057: # ANGLES (CTHETA, CPSI). IF ANY YAW REMAINS DUE TO GIMBAL LOCK AVOIDANCE, THE FINAL YAW MANEUVER IS
013884,000058: # CALCULATED AND THE DESIRED YAW RATE SET TO SOME FIXED VALUE (ROLLRATE = + OR - 2 DEGREES PER SEC).
013885,000059: # IN THIS CASE ONLY AN INCREMENTAL CDUX ANGLE (DELFROLL) IS SUPPLIED TO THE DAP. AT THE END OF THE YAW
013886,000060: # MANEUVER OR IN THE EVENT THAT THERE WAS NO FINAL YAW, CDUXD IS SET EQUAL TO CPHI AND THE X-AXIS DESIRED
013887,000061: # RATE SET TO ZERO. THUS, UPON COMPLETION OF THE MANEUVER THE S/C WILL FINISH UP IN A LIMIT CYCLE ABOUT THE
013888,000062: # DESIRED FINAL GIMBAL ANGLES.
013889,000063:
013890,000064: # PROGRAM LOGIC FLOW
013891,000065:
013892,000066: # KALCMANU IS CALLED AS A HIGH PRIORITY JOB WITH ENTRY POINTS AT KALCMAN3 AND VECPOINT. IT FIRST PICKS
013893,000067: # UP THE CURRENT CDU ANGLES TO BE USED AS THE BASIS FOR ALL COMPUTATIONS INVOLVING THE INITIAL S/C ORIENTATION.
Page 343 |
013895,000069: # IT THEN DETERMINES THE DIRECTION COSINE MATRICES RELATING BOTH THE INITIAL AND FINAL S/C ORIENTATION TO STABLE
013896,000070: # * * *
013897,000071: # MEMBER AXES (MIS,MFS). IT ALSO COMPUTES THE MATRIX RELATING FINAL S/C AXES TO INITIAL S/C AXES (MFI). THE
013898,000072: # ANGLE OF ROTATION (AM) IS THEN EXTRACTED FROM THIS MATRIX, AND TESTS ARE MADE TO DETERMINE IF
013899,000073:
013900,000074: # A) AM LESS THAN .25 DEGREES (MINANG)
013901,000075: # B) AM GREATER THAN 170 DEGREES (MAXANG)
013902,000076:
013903,000077: # IF AM LESS THAN .25 DEGREES, NO COMPLICATED AUTOMATIC MANEUVERING IS NECESSARY. THEREFORE WE CAN SIMPLY
013904,000078: # SET CDU DESIRED EQUAL TO THE FINAL CDU DESIRED ANGLES AND TERMINATE THE JOB.
013905,000079:
013906,000080: # IF AM IS GREATER THAN .25 DEGREES BUT LESS THAN 170 DEGREES, THE AXES OF THE SINGLE EQUIVALENT ROTATION
013907,000081: # - *
013908,000082: # (COF) IS EXTRACTED FROM THE SKEW SYMMETRIC COMPONENTS OF MFI. * *
013909,000083: # IF AM GREATER THAN 170 DEGREES AN ALTERNATE METHOD EMPLOYING THE SYMMETRIC PART OF MFI (MFISYM) IS USED
013910,000084: # -
013911,000085: # TO DETERMINE COF.
013912,000086:
013913,000087: # THE PROGRAM THEN CHECKS TO SEE IF THE MANEUVER AS COMPUTED WILL BRING THE S/C THROUGH GIMBAL LOCK. IF
013914,000088: # SO, A NEW MANEUVER IS CALCULATED WHICH WILL JUST SKIM THE GIMBAL LOCK ZONE AND ALIGN THE S/C X-AXIS. THIS
013915,000089: # METHOD ASSURES THAT THE ADDITIONAL MANEUVERING TO AVOID GIMBAL LOCK WILL BE KEPT TO A MINIMUM. SINCE A FINAL
013916,000090: # P AXIS YAW WILL BE NECESSARY, A SWITCH IS RESET (STATE SWITCH 31) TO ALLOW FOR THE COMPUTATION OF THIS FINAL
013917,000091: # YAW.
013918,000092:
013919,000093: # AS STATED PREVIOUSLY KALCMANU GENERATES A SEQUENCE OF DESIRED GIMBAL ANGLES WHICH ARE UPDATED EVERY
013920,000094: # -
013921,000095: # SECOND. THIS IS ACCOMPLISHED BY A SMALL ROTATION OF THE DESIRED S/C FRAME ABOUT THE VECTOR COF. THE NEW
013922,000096: # DESIRED REFERENCE MATRIX IS THEN,
013923,000097: # * * *
013924,000098: # MIS = MIS DEL
013925,000099: # N+1 N
013926,000100: # *
013927,000101: # WHERE DEL IS THE MATRIX CORRESPONDING TO THIS SMALL ROTATION. THE NEW CDU ANGLES CAN THEN BE EXTRACTED
013928,000102: # *
013929,000103: # FROM MIS.
013930,000104:
013931,000105: # AT THE BEGINNING OF THE MANEUVER THE AUTOPILOT DESIRED RATES (OMEGAPD, OMEGAQD, OMEGARD) AND THE
013932,000106: # MANEUVER TIMINGS ARE ESTABLISHED. ON THE FIRST PASS AND ON ALL SUBSEQUENT UPDATES THE CDU DESIRED
013933,000107: # ANGLES ARE LOADED WITH THE APPROPRIATE VALUES AND THE INCREMENTAL CDU ANGLES ARE COMPUTED. THE AGC CLOCKS
013934,000108: # (TIME1 AND TIME2) ARE THAN CHECKED TO SEE IF THE MANEUVER WILL TERMINATE BEFORE THE NEXT UPDATE. IF
013935,000109: # NOT, KALCMANU CALLS FOR ANOTHER UPDATE (RUN AS A JOB WITH PRIORITY TBD) IN ONE SECOND. ANY DELAYS IN THIS
013936,000110: # CALLING SEQUENCE ARE AUTOMATICALLY COMPENSATED IN CALLING FOR THE NEXT UPDATE.
013937,000111:
013938,000112: # IF IT IS FOUND THAT THE MANEUVER IS TO TERMINATE BEFORE THE NEXT UPDATE A ROUTINE IS CALLED (AS A WAIT-
013939,000113: # LIST TASK) TO STOP THE MANEUVER AT THE APPROPRIATE TIME AS EXPLAINED ABOVE.
013940,000114:
Page 344 |
013942,000116: # CALLING SEQUENCE
013943,000117:
013944,000118: # IN ORDER TO PERFORM A KALCMANU SUPERVISED MANEUVER, THE COMMANDED GIMBAL ANGLES MUST BE PRECOMPUTED AND
013945,000119: # STORED IN LOCATIONS CPHI, CTHETA, CPSI. THE USER:S PROGRAM MUST THEN CLEAR STATE SWITCH NO 33 TO ALLOW THE
013946,000120: # ATTITUDE MANEUVER ROUTINE TO PERFORM ANY FINAL P-AXIS YAW INCURRED BY AVOIDING GIMBAL LOCK. THE MANEUVER IS
013947,000121: # THEN INITIATED BY ESTABLISHING THE FOLLOWING EXECUTIVE JOB
013948,000122: # *
013949,000123: # CAF PRIO XX
013950,000124: # --
013951,000125: # INHINT
013952,000126: # TC FINDVAC
013953,000127: # 2CADR KALCMAN3
013954,000128: # RELINT
013955,000129:
013956,000130: # THE USER:S PROGRAM MAY EITHER CONTINUE OR WAIT FOR THE TERMINATION OF THE MANEUVER. IF THE USER WISHES TO
013957,000131: # WAIT, HE MAY PUT HIS JOB TO SLEEP WITH THE FOLLOWING INSTRUCTIONS
013958,000132:
013959,000133: # L TC BANKCALL
013960,000134: # L+1 CADR ATTSTALL
013961,000135: # L+2 (BAD RETURN)
013962,000136: # L+3 (GOOD RETURN)
013963,000137:
013964,000138: # UPON COMPLETION OF THE MANEUVER, THE PROGRAM WILL BE AWAKENED AT L+3 IF THE MANEUVER WAS COMPLETED
013965,000139: # SUCCESSFULLY, OR AT L+2 IF THE MANEUVER WAS ABORTED. THIS ABORT WOULD OCCUR IF THE INITIAL OR FINAL ATTITUDE
013966,000140: # WAS IN GIMBAL LOCK.
013967,000141:
013968,000142: # *** NOTA BENE *** IT IS ASSUMED THAT THE DESIRED MANEUVERING RATE (0.5, 2, 5, 10, DEG/SEC) HAS BEEN SELECTED BY
013969,000143: # KEYBOARD ENTRY PRIOR TO THE EXECUTION OF KALCMANU.
013970,000144: # IT IS ALSO ASSUMED THAT THE AUTOPILOT IS IN THE AUTO MODE. IF THE MODE SWITCH IS CHANGED DURING THE
013971,000145: # MANEUVER, KALCMANU WILL TERMINATE VIA GOODEND WITHIN 1 SECOND SO THAT R60 MAY REQUEST A TRIM OF THE S/C ATTITUDE
013972,000146: # THIS IS THE ONLY MEANS FOR MANUALLY TERMINATING A KALCMANU SUPERVISED MANEUVER.
013973,000147: # SUBROUTINES
013974,000148:
013975,000149: # KALCMANU USES A NUMBER OF INTERPRETIVE SUBROUTINES WHICH MAY BE OF GENERAL INTEREST. SINCE THESE ROUTINES
013976,000150: # WERE PROGRAMMED EXCLUSIVELY FOR KALCMANU, THEY ARE NOT, AS YET, GENERALLY AVAILABLE FOR USE BY OTHER PROGRAMS.
013977,000151:
013978,000152: # MXM3
013979,000153: # ----
013980,000154:
013981,000155: # THIS SUBROUTINE MULTIPLIES TWO 3X3 MATRICES AND LEAVES THE RESULT IN THE FIRST 18 LOCATIONS OF THE PUSH
013982,000156: # DOWN LIST, I.E.,
013983,000157: # ( M M M )
013984,000158: # ( 0 1 2 )
013985,000159: # * ( ) * *
013986,000160: # M = ( M M M ) = M1 X M2
013987,000161: # ( 3 4 5 )
013988,000162: # ( )
013989,000163: # ( M M M )
Page 345 |
013991,000165: # ( 6 7 8 )
013992,000166: # *
013993,000167: # INDEX REGISTER X1 MUST BE LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M1, AND X2 MUST BE
013994,000168: # *
013995,000169: # LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M2. THE ROUTINE USES THE FIRST 20 LOCATIONS OF THE PUSH
013996,000170: # DOWN LIST. THE FIRST ELEMENT OF THE MATRIX APPEARS IN PDO. PUSH UP FOR M .
013997,000171: # 8
013998,000172: # TRANSPOS
013999,000173: # --------
014000,000174:
014001,000175: # THIS ROUTINE TRANSPOSES A 3X3 MATRIX AND LEAVES THE RESULT IN THE PUSH DOWN LIST, I.E.,
014002,000176: #
014003,000177: # * * T
014004,000178: # M = M1
014005,000179:
014006,000180: # INDEX REGISTER X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M1. PUSH UP FOR THE FIRST AND SUB-
014007,000181: # *
014008,000182: # SEQUENT COMPONENTS OF M. THIS SUBROUTINE ALSO USES THE FIRST 20 LOCATIONS OF THE PUSH DOWN LIST.
014009,000183:
014010,000184: # CDU TO DCM
014011,000185: # ----------
014012,000186:
014013,000187: # THIS SUBROUTINE CONVERTS THREE CDU ANGLES IN T(MPAC) TO A DIRECTION COSINE MATRIX (SCALED BY 2) RELATING
014014,000188: # THE CORRESPONDING S/C ORIENTATIONS TO THE STABLE MEMBER FRAME. THE FORMULAS FOR THIS CONVERSION ARE
014015,000189:
014016,000190: # M = COSY COSZ
014017,000191: # 0
014018,000192:
014019,000193: # M = -COSY SINZ COSX + SINY SINX
014020,000194: # 1
014021,000195:
014022,000196: # M = COSY SINZ SINX + SINY COSX
014023,000197: # 2
014024,000198:
014025,000199: # M = SINZ
014026,000200: # 3
014027,000201:
014028,000202: # M = COSZ COSX
014029,000203: # 4
014030,000204:
014031,000205: # M = -COSZ SINX
014032,000206: # 5
014033,000207:
014034,000208: # M = -SINY COSZ
014035,000209: # 6
014036,000210: #
014037,000211: # M = SINY SINZ COSX + COSY SINX
014038,000212: # 7
Page 346 |
014040,000214: # M = -SINY SINZ SINX + COSY COSX
014041,000215: # 8
014042,000216:
014043,000217: # WHERE X = OUTER GIMBAL ANGLE
014044,000218: # Y = INNER GIMBAL ANGLE
014045,000219: # Z = MIDDLE GIMBAL ANGLE
014046,000220:
014047,000221: # THE INTERPRETATION OF THIS MATRIX IS AS FOLLOWS
014048,000222:
014049,000223: # IF A , A , A REPRESENT THE COMPONENTS OF A VECTOR IN S/C AXES THEN THE COMPONENTS OF THE SAME VECTOR IN
014050,000224: # X Y Z
014051,000225: # STABLE MEMBER AXES (B , B , B ) ARE
014052,000226: # X Y Z
014053,000227:
014054,000228: # ( B ) ( A )
014055,000229: # ( X ) ( X )
014056,000230: # ( ) ( )
014057,000231: # ( ) * ( )
014058,000232: # ( B ) = M ( A )
014059,000233: # ( Y ) ( Y )
014060,000234: # ( ) ( )
014061,000235: # ( B ) ( A )
014062,000236: # ( Z ) ( Z )
014063,000237:
014064,000238: # THE SUBROUTINE WILL STORE THIS MATRIX IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY AS SPECIFIED BY THE CALLING
014065,000239: # *
014066,000240: # PROGRAM. TO DO THIS THE CALLING PROGRAM MUST FIRST LOAD X2 WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M.
014067,000241:
014068,000242: # INTERNALLY, THE ROUTINE USES THE FIRST 16 LOCATIONS OF THE PUSH DOWN LIST, ALSO STEP REGISTER S1 AND INDEX
014069,000243: # REGISTER X2.
014070,000244:
014071,000245: # DCM TO CDU
014072,000246: # ----------
014073,000247: # *
014074,000248: # THIS ROUTINE EXTRACTS THE CDU ANGLES FROM A DIRECTION COSINE MATRIX (M SCALED BY 2) RELATING S/C AXIS TO
014075,000249: # *
014076,000250: # STABLE MEMBER AXES. X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M. THE SUBROUTINE LEAVES THE
014077,000251: # CORRESPONDING GIMBAL ANGLES IN V(MPAC) AS DOUBLE PRECISION 1:S COMPLEMENT ANGLES SCALED BY 2PI. THE FORMULAS
014078,000252: # FOR THIS CONVERSION ARE
014079,000253:
014080,000254: # Z = ARCSIN (M )
014081,000255: # 3
014082,000256:
014083,000257: # Y = ARCSIN (-M /COSZ)
014084,000258: # 6
014085,000259:
014086,000260: # IF M IS NEGATIVE, Y IS REPLACED BY PI SGN Y - Y
014087,000261: # 0
Page 347 |
014089,000263: # X = ARCSIN (-M /COSZ)
014090,000264: # 5
014091,000265:
014092,000266: # IF M IS NEGATIVE X IS REPLACED BY PI SGN X - X
014093,000267: # 4
014094,000268:
014095,000269: # THIS ROUTINE DOES NOT SET THE PUSH DOWN POINTER, BUT USES THE NEXT 8 LOCATIONS OF THE PUSH DOWN LIST AND
014096,000270: # RETURNS THE POINTER TO ITS ORIGINAL SETTING. THIS PROCEDURE ALLOWS THE CALLER TO STORE THE MATRIX AT THE TOP OF
014097,000271: # THE PUSH DOWN LIST.
014098,000272:
014099,000273: # DELCOMP
014100,000274: # -------
014101,000275: # *
014102,000276: # THIS ROUTINE COMPUTES THE DIRECTION COSINE MATRIX (DEL) RELATING ON
014103,000277: # -
014104,000278: # IS ROTATED WITH RESPECT TO THE FIRST BY AN ANGLE, A, ABOUT A UNIT VECTOR, U. THE FORMULA FOR THIS MATRIX IS
014105,000279:
014106,000280: # * * - -T *
014107,000281: # DEL = I COSA + U U (1 - COSA) + V SINA
014108,000282: # X
014109,000283:
014110,000284: # WHERE * ( 1 0 0 )
014111,000285: # I = ( 0 1 0 )
014112,000286: # ( 0 0 1 )
014113,000287:
014114,000288: # 2
014115,000289: # ( U U U U U )
014116,000290: # ( X X Y X Z )
014117,000291: # ( )
014118,000292: # - -T ( 2 )
014119,000293: # U U = ( U U U U U )
014120,000294: # ( Y X Y Y Z )
014121,000295: # ( )
014122,000296: # ( 2 )
014123,000297: # ( U U U U U )
014124,000298: # ( Z X Z Y Z )
014125,000299:
014126,000300:
014127,000301: # ( 0 -U U )
014128,000302: # ( Z Y )
014129,000303: # * ( )
014130,000304: # V = ( U 0 -U )
014131,000305: # X ( Z X )
014132,000306: # ( )
014133,000307: # ( -U U 0 )
014134,000308: # ( Y X )
014135,000309:
Page 348 |
014137,000311: # -
014138,000312: # U = UNIT ROTATION VECTOR RESOLVED INTO S/C AXES
014139,000313: # A = ROTATION ANGLE
014140,000314:
014141,000315: # *
014142,000316: # THE INTERPRETATION OF DEL IS AS FOLLOWS
014143,000317:
014144,000318: # IF A , A , A REPRESENT THE COMPONENT OF A VECTOR IN THE ROTATED FRAME, THEN THE COMPONENTS OF THE SAME
014145,000319: # X Y Z
014146,000320: # VECTOR IN THE ORIGINAL S/C AXES (B , B , B ) ARE
014147,000321: # X Y Z
014148,000322:
014149,000323: # ( B ) ( A )
014150,000324: # ( X ) ( X )
014151,000325: # ( ) * ( )
014152,000326: # ( B ) = DEL ( A )
014153,000327: # ( Y ) ( Y )
014154,000328: # ( ) ( )
014155,000329: # ( B ) ( A )
014156,000330: # ( Z ) ( Z )
014157,000331:
014158,000332: # THE ROUTINE WILL STORE THIS MATRIX (SCALED UNITY) IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY BEGINNING WITH
014159,000333: # -
014160,000334: # THE LOCATION CALLED DEL. IN ORDER TO USE THE ROUTINE, THE CALLING PROGRAM MUST FIRST STORE U (A HALF UNIT
014161,000335: # DOUBLE PRECISION VECTOR) IN THE SET OF ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS CALLED COF. THE ANGLE, A,
014162,000336: # MUST THEN BE LOADED INTO D(MPAC).
014163,000337: #
014164,000338: # INTERNALLY, THE PROGRAM ALSO USES THE FIRST 10 LOCATIONS OF THE PUSH DOWN LIST.
014165,000339:
014166,000340: # READCDUK
014167,000341: # --------
014168,000342:
014169,000343: # THIS BASIC LANGUAGE SUBROUTINE LOADS T(MPAC) WITH THE THREE CDU ANGLES.
014170,000344:
014171,000345: # SIGNMPAC
014172,000346: # --------
014173,000347:
014174,000348: # THIS IS A BASIC LANGUAGE SUBROUTINE WHICH LIMITS THE MAGNITUDE OF D(MPAC) TO + OR - DPOSMAX ON OVERFLOW.
014175,000349:
014176,000350: # PROGRAM STORAGE ALLOCATION
014177,000351:
014178,000352: # 1) FIXED MEMORY 1059 WORDS
014179,000353: # 2) ERASABLE MEMORY 98
014180,000354: # 3) STATE SWITCHES 3
Page 349 |
014182,000356: # 4) FLAGS 1
014183,000357:
014184,000358: # JOB PRIORITIES
014185,000359:
014186,000360: # 1) KALCMANU TBD
014187,000361: # 2) ONE SECOND UPDATE TBD
014188,000362:
014189,000363: # SUMMARY OF STATE SWITCHES AND FLAGWORDS USED BY KALCMANU.
014190,000364:
014191,000365: # STATE FLAGWRD 2 SETTING MEANING
014192,000366: # SWITCH NO. BIT NO.
014193,000367:
014194,000368: # *
014195,000369: # 31 14 0 MANEUVER WENT THROUGH GIMBAL LOCK
014196,000370: # 1 MANEUVER DID NOT GO THROUGH GIMBAL LOCK
014197,000371: # *
014198,000372: # 32 13 0 CONTINUE UPDATE PROCESS
014199,000373: # 1 START UPDATE PROCESS
014200,000374:
014201,000375: # 33 12 0 PERFORM FINAL P-AXIS YAW IF REQUIRED
014202,000376: # 1 IGNORE ANY FINAL P-AXIS YAW
014203,000377:
014204,000378: # 34 11 0 SIGNAL END OF KALCMANU
014205,000379: # 1 KALCMANU IN PROCESS USER MUST SET SWITCH BEFORE INITIATING
014206,000380:
014207,000381: # * INTERNAL TO KALCMANU
014208,000382:
014209,000383: # SUGGESTIONS FOR PROGRAM INTEGRATION
014210,000384:
014211,000385: # THE FOLLOWING VARIABLES SHOULD BE ASSIGNED TO UNSWITCH ERASABLE
014212,000386:
014213,000387: # CPHI
014214,000388: # CTHETA
014215,000389: # CPSI
014216,000390: # POINTVSM +5
014217,000391: # SCAXIS +5
014218,000392: # DELDCDU
014219,000393: # DELDCDU1
014220,000394: # DELDCDU2
014221,000395: # RATEINDX
014222,000396:
014223,000397: # THE FOLLOWING SUBROUTINES MAY BE PUT IN A DIFFERENT BANK
014224,000398:
014225,000399: # MXM3
Page 350 |
014227,000401: # TRANSPOS
014228,000402: # SIGNMPAC
014229,000403: # READCDUK
014230,000404: # CDUTODCM
014231,000405:
Page 351 |
014233,000407: 15,2050 BANK 15
014234,000408: 22,2000 SETLOC KALCMON1
014235,000409: 22,2000 BANK
014236,000410:
014237,000411: 22,2004 E6,1676 EBANK= BCDU
014238,000412:
014239,000413: # THE THREE DESIRED CDU ANGLES MUST BE STORED AS SINGLE PRECISION TWOS COMPLEMENT ANGLES IN THE THREE SUCCESSIVE
014240,000414: # LOCATIONS, CPHI, CTHETA, CPSI.
014241,000415:
014242,000416: 22,2004 COUNT* $$/KALC
014243,000417: 22,2004 06037 KALCMAN3 TC INTPRET # PICK UP THE CURRENT CDU ANGLES AND
014244,000418: 22,2005 77634 RTB # COMPUTE THE MATRIX FROM INITIAL S/C
014245,000419: 22,2006 44403 READCDUK # AXES TO FINAL S/C AXES
014246,000420: 22,2007 03277 STORE BCDU # STORE INITIAL S/C ANGLES
014247,000421: 22,2010 51535 SLOAD ABS # CHECK THE MAGNITUDE OF THE DESIRED
014248,000422: 22,2011 00324 CPSI # MIDDLE GIMBAL ANGLE
014249,000423: 22,2012 51025 DSU BPL
014250,000424: 22,2013 04403 LOCKANGL # IF GREATER THAN 70 DEG ABORT MANEUVER
014251,000425: 22,2014 44724 TOOBADF
014252,000426: 22,2015 72364 AXC,2 TLOAD
014253,000427: 22,2016 03246 MIS
014254,000428: 22,2017 03277 BCDU
014255,000429: 22,2020 77624 CALL # COMPUTE THE TRANSFORMATION FROM INITIAL
014256,000430: 22,2021 44410 CDUTODCM # S/C AXES TO STABLE MEMBER AXES
014257,000431: 22,2022 72364 AXC,2 TLOAD
014258,000432: 22,2023 02230 MFS # PREPARE TO CALCULATE ARRAY MFS
014259,000433: 22,2024 00322 CPHI
014260,000434: 22,2025 77624 CALL
014261,000435: 22,2026 44410 CDUTODCM
014262,000436: 22,2027 45160 SECAD AXC,1 CALL # MIS AND MFS ARRAYS CALCULATED $2
014263,000437: 22,2030 03246 MIS
014264,000438: 22,2031 44326 TRANSPOS
014265,000439: 22,2032 45575 VLOAD STADR
014266,000440: 22,2033 50457 STOVL TMIS +12D
014267,000441: 22,2034 77626 STADR
014268,000442: 22,2035 50465 STOVL TMIS +6
014269,000443: 22,2036 77626 STADR
014270,000444: 22,2037 74473 STORE TMIS # TMIS = TRANSPOSE(MIS) SCALED BY 2
014271,000445: 22,2040 75160 AXC,1 AXC,2
014272,000446: 22,2041 03303 TMIS
014273,000447: 22,2042 02230 MFS
014274,000448: 22,2043 77624 CALL
014275,000449: 22,2044 44312 MXM3
014276,000450: 22,2045 45575 VLOAD STADR
014277,000451: 22,2046 51532 STOVL MFI +12D
014278,000452: 22,2047 77626 STADR
014279,000453: 22,2050 51540 STOVL MFI +6
014280,000454: 22,2051 77626 STADR
014281,000455: 22,2052 75546 STORE MFI # MFI = TMIS MFS (SCALED BY 4)
014282,000456: 22,2053 45001 SETPD CALL # TRANSPOSE MFI IN PD LIST
Page 352 |
014284,000458: 22,2054 00023 18D
014285,000459: 22,2055 44335 TRNSPSPD
014286,000460: 22,2056 45575 VLOAD STADR
014287,000461: 22,2057 50457 STOVL TMFI +12D
014288,000462: 22,2060 77626 STADR
014289,000463: 22,2061 50465 STOVL TMFI +6
014290,000464: 22,2062 77626 STADR
014291,000465: 22,2063 74473 STORE TMFI # TMFI = TRANSPOSE (MFI) SCALED BY 4
014292,000466:
014293,000467: # CALCULATE COFSKEW AND MFISYM
014294,000468:
014295,000469: 22,2064 45345 DLOAD DSU
014296,000470: 22,2065 03306 TMFI +2
014297,000471: 22,2066 02233 MFI +2
014298,000472: 22,2067 45325 PDDL DSU # CALCULATE COF SCALED BY 2/SIN(AM)
014299,000473: 22,2070 02235 MFI +4
014300,000474: 22,2071 03310 TMFI +4
014301,000475: 22,2072 45325 PDDL DSU
014302,000476: 22,2073 03316 TMFI +10D
014303,000477: 22,2074 02243 MFI +10D
014304,000478: 22,2075 77666 VDEF
014305,000479: 22,2076 03326 STORE COFSKEW # EQUALS MFISKEW
014306,000480:
014307,000481: # CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
014308,000482:
014309,000483: 22,2077 43345 DLOAD DAD
014310,000484: 22,2100 02231 MFI
014311,000485: 22,2101 02251 MFI +16D
014312,000486: 22,2102 43225 DSU DAD
014313,000487: 22,2103 06512 DP1/4TH
014314,000488: 22,2104 02241 MFI +8D
014315,000489: 22,2105 03334 STORE CAM # CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
014316,000490: 22,2106 77726 ARCCOS
014317,000491: 22,2107 03336 STORE AM # AM=ARCCOS(CAM) (AM SCALED BY 2)
014318,000492: 22,2110 51025 DSU BPL
014319,000493: 22,2111 04363 MINANG
014320,000494: 22,2112 44117 CHECKMAX
014321,000495: 22,2113 77751 TLOAD # MANEUVER LESS THAN .25 DEGREES
014322,000496: 22,2114 00322 CPHI # GO DIRECTLY INTO ATTITUDE HOLD
014323,000497: 22,2115 37236 STCALL CDUXD # ABOUT COMMANDED ANGLES
014324,000498: 22,2116 44742 TOOBADI # STOP RATE AND EXIT
014325,000499:
014326,000500: 22,2117 45345 CHECKMAX DLOAD DSU
014327,000501: 22,2120 03336 AM
014328,000502: 22,2121 04365 MAXANG
014329,000503: 22,2122 77244 BPL VLOAD
014330,000504: 22,2123 44131 ALTCALC # UNIT
014331,000505: 22,2124 03326 COFSKEW # COFSKEW
014332,000506: 22,2125 77656 UNIT
014333,000507: 22,2126 03271 STORE COF # COF IS THE MANEUVER AXIS
Page 353 |
014335,000509: 22,2127 77650 GOTO # SEE IF MANEUVER GOES THRU GIMBAL LOCK
014336,000510: 22,2130 44744 LOCSKIRT
014337,000511: 22,2131 53375 ALTCALC VLOAD VAD # IF AM GREATER THAN 170 DEGREES
014338,000512: 22,2132 02231 MFI
014339,000513: 22,2133 03304 TMFI
014340,000514: 22,2134 77762 VSR1
014341,000515: 22,2135 27304 STOVL MFISYM
014342,000516: 22,2136 02237 MFI +6
014343,000517: 22,2137 74455 VAD VSR1
014344,000518: 22,2140 03312 TMFI +6
014345,000519: 22,2141 27312 STOVL MFISYM +6
014346,000520: 22,2142 02245 MFI +12D
014347,000521: 22,2143 74455 VAD VSR1
014348,000522: 22,2144 03320 TMFI +12D
014349,000523: 22,2145 03320 STORE MFISYM +12D # MFISYM=(MFI+TMFI)/2 SCALED BY 4
014350,000524:
014351,000525: # CALCULATE COF
014352,000526:
014353,000527: 22,2146 70545 DLOAD SR1
014354,000528: 22,2147 03334 CAM
014355,000529: 22,2150 45325 PDDL DSU # PDO CAM $4
014356,000530: 22,2151 06520 DPHALF
014357,000531: 22,2152 03334 CAM
014358,000532: 22,2153 65204 BOVB PDDL # PD2 1 - CAM $2
014359,000533: 22,2154 21712 SIGNMPAC
014360,000534: 22,2155 03324 MFISYM +16D
014361,000535: 22,2156 56225 DSU DDV
014362,000536: 22,2157 00001 0
014363,000537: 22,2160 00003 2
014364,000538: 22,2161 65366 SQRT PDDL # COFZ = SQRT(MFISYM8-CAM)/1-CAM)
014365,000539: 22,2162 03314 MFISYM +8D # $ ROOT 2
014366,000540: 22,2163 56225 DSU DDV
014367,000541: 22,2164 00001 0
014368,000542: 22,2165 00003 2
014369,000543: 22,2166 65366 SQRT PDDL # COFY = SQRT(MFISYM4-CAM)/(1-CAM) $ROOT2
014370,000544: 22,2167 03304 MFISYM
014371,000545: 22,2170 56225 DSU DDV
014372,000546: 22,2171 00001 0
014373,000547: 22,2172 00003 2
014374,000548: 22,2173 55566 SQRT VDEF # COFX = SQRT(MFISYM-CAM)/(1-CAM) $ROOT 2
014375,000549: 22,2174 77656 UNIT
014376,000550: 22,2175 03271 STORE COF
014377,000551:
014378,000552: # DETERMINE LARGEST COF AND ADJUST ACCORDINGLY
014379,000553:
014380,000554: 22,2176 45345 COFMAXGO DLOAD DSU
014381,000555: 22,2177 03271 COF
014382,000556: 22,2200 03273 COF +2
014383,000557: 22,2201 71240 BMN DLOAD # COFY G COFX
Page 354 |
014385,000559: 22,2202 44211 COMP12
014386,000560: 22,2203 03271 COF
014387,000561: 22,2204 50025 DSU BMN
014388,000562: 22,2205 03275 COF +4
014389,000563: 22,2206 44266 METHOD3 # COFZ G COFX OR COFY
014390,000564: 22,2207 77650 GOTO
014391,000565: 22,2210 44242 METHOD1 # COFX G COFY OR COFZ
014392,000566: 22,2211 45345 COMP12 DLOAD DSU
014393,000567: 22,2212 03273 COF +2
014394,000568: 22,2213 03275 COF +4
014395,000569: 22,2214 77640 BMN
014396,000570: 22,2215 44266 METHOD3 # COFZ G COFY OR COFX
014397,000571:
014398,000572: 22,2216 51145 METHOD2 DLOAD BPL # COFY MAX
014399,000573: 22,2217 03330 COFSKEW +2 # UY
014400,000574: 22,2220 44224 U2POS
014401,000575: 22,2221 57575 VLOAD VCOMP
014402,000576: 22,2222 03271 COF
014403,000577: 22,2223 03271 STORE COF
014404,000578: 22,2224 51145 U2POS DLOAD BPL
014405,000579: 22,2225 03306 MFISYM +2 # UX UY
014406,000580: 22,2226 44232 OKU21
014407,000581: 22,2227 57545 DLOAD DCOMP # SIGN OF UX OPPOSITE TO UY
014408,000582: 22,2230 03271 COF
014409,000583: 22,2231 03271 STORE COF
014410,000584: 22,2232 51145 OKU21 DLOAD BPL
014411,000585: 22,2233 03316 MFISYM +10D # UY UZ
014412,000586: 22,2234 44744 LOCSKIRT
014413,000587: 22,2235 57545 DLOAD DCOMP # SIGN OF UZ OPPOSITE TO UY
014414,000588: 22,2236 03275 COF +4
014415,000589: 22,2237 03275 STORE COF +4
014416,000590: 22,2240 77650 GOTO
014417,000591: 22,2241 44744 LOCSKIRT
014418,000592: 22,2242 51145 METHOD1 DLOAD BPL # COFX MAX
014419,000593: 22,2243 03326 COFSKEW # UX
014420,000594: 22,2244 44250 U1POS
014421,000595: 22,2245 57575 VLOAD VCOMP
014422,000596: 22,2246 03271 COF
014423,000597: 22,2247 03271 STORE COF
014424,000598: 22,2250 51145 U1POS DLOAD BPL
014425,000599: 22,2251 03306 MFISYM +2 # UX UY
014426,000600: 22,2252 44256 OKU12
014427,000601: 22,2253 57545 DLOAD DCOMP
014428,000602: 22,2254 03273 COF +2 # SIGN OF UY OPPOSITE TO UX
014429,000603: 22,2255 03273 STORE COF +2
014430,000604: 22,2256 51145 OKU12 DLOAD BPL
014431,000605: 22,2257 03310 MFISYM +4 # UX UZ
014432,000606: 22,2260 44744 LOCSKIRT
014433,000607: 22,2261 57545 DLOAD DCOMP # SIGN OF UZ OPPOSITE TO UY
014434,000608: 22,2262 03275 COF +4
Page 355 |
014436,000610: 22,2263 03275 STORE COF +4
014437,000611: 22,2264 77650 GOTO
014438,000612: 22,2265 44744 LOCSKIRT
014439,000613: 22,2266 51145 METHOD3 DLOAD BPL # COFZ MAX
014440,000614: 22,2267 03332 COFSKEW +4 # UZ
014441,000615: 22,2270 44274 U3POS
014442,000616: 22,2271 57575 VLOAD VCOMP
014443,000617: 22,2272 03271 COF
014444,000618: 22,2273 03271 STORE COF
014445,000619: 22,2274 51145 U3POS DLOAD BPL
014446,000620: 22,2275 03310 MFISYM +4 # UX UZ
014447,000621: 22,2276 44302 OKU31
014448,000622: 22,2277 57545 DLOAD DCOMP
014449,000623: 22,2300 03271 COF # SIGN OF UX OPPOSITE TO UZ
014450,000624: 22,2301 03271 STORE COF
014451,000625: 22,2302 51145 OKU31 DLOAD BPL
014452,000626: 22,2303 03316 MFISYM +10D # UY UZ
014453,000627: 22,2304 44744 LOCSKIRT
014454,000628: 22,2305 57545 DLOAD DCOMP
014455,000629: 22,2306 03273 COF +2 # SIGN OF UY OPPOSITE TO UZ
014456,000630: 22,2307 03273 STORE COF +2
014457,000631: 22,2310 77650 GOTO
014458,000632: 22,2311 44744 LOCSKIRT
Page 356 |
014460,000634: # MATRIX OPERATIONS
014461,000635:
014462,000636: 13,2207 BANK 13
014463,000637: 22,2000 SETLOC KALCMON2
014464,000638: 22,2000 BANK
014465,000639:
014466,000640: 22,2312 E6,1676 EBANK= BCDU
014467,000641:
014468,000642: 22,2312 76601 MXM3 SETPD VLOAD* # MXM3 MULTIPLIES 2 3X3 MATRICES
014469,000643: 22,2313 00001 0 # AND LEAVES RESULT IN PD LIST
014470,000644: 22,2314 00001 0,1 # AND MPAC
014471,000645: 22,2315 62703 VXM* PDVL*
014472,000646: 22,2316 77776 0,2
014473,000647: 22,2317 00007 6,1
014474,000648: 22,2320 62703 VXM* PDVL*
014475,000649: 22,2321 77776 0,2
014476,000650: 22,2322 00015 12D,1
014477,000651: 22,2323 41503 VXM* PUSH
014478,000652: 22,2324 77776 0,2
014479,000653: 22,2325 77616 RVQ
014480,000654:
014481,000655: # RETURN WITH M1XM2 IN PD LIST
014482,000656:
014483,000657: 22,2326 76601 TRANSPOS SETPD VLOAD* # TRANSPOS TRANSPOSES A 3X3 MATRIX
014484,000658: 22,2327 00001 0 # AND LEAVES RESULT IN PD LIST
014485,000659: 22,2330 00001 0,1 # MATRIX ADDRESS IN XR1
014486,000660: 22,2331 62713 PDVL* PDVL*
014487,000661: 22,2332 00007 6,1
014488,000662: 22,2333 00015 12D,1
014489,000663: 22,2334 77606 PUSH # MATRIX IN PD
014490,000664: 22,2335 77776 TRNSPSPD EXIT # ENTER WITH MATRIX AT 0 IN PD LIST
014491,000665: 22,2336 50120 INDEX FIXLOC
014492,000666: 22,2337 52013 DXCH 12
014493,000667: 22,2340 50120 INDEX FIXLOC
014494,000668: 22,2341 52017 DXCH 16
014495,000669: 22,2342 50120 INDEX FIXLOC
014496,000670: 22,2343 52013 DXCH 12
014497,000671: 22,2344 50120 INDEX FIXLOC
014498,000672: 22,2345 52015 DXCH 14
014499,000673: 22,2346 50120 INDEX FIXLOC
014500,000674: 22,2347 52005 DXCH 4
014501,000675: 22,2350 50120 INDEX FIXLOC
014502,000676: 22,2351 52015 DXCH 14
014503,000677: 22,2352 50120 INDEX FIXLOC
014504,000678: 22,2353 52003 DXCH 2
014505,000679: 22,2354 50120 INDEX FIXLOC
014506,000680: 22,2355 52007 DXCH 6
014507,000681: 22,2356 50120 INDEX FIXLOC
014508,000682: 22,2357 52003 DXCH 2
Page 357 |
014510,000684: 22,2360 06037 TC INTPRET
014511,000685: 22,2361 77616 RVQ
014512,000686:
014513,000687: 15,2050 BANK 15
014514,000688: 22,2000 SETLOC KALCMON1
014515,000689: 22,2000 BANK
014516,000690:
014517,000691: 22,2362 E6,1676 EBANK= BCDU
014518,000692:
014519,000693: 22,2362 00013 13563 MINANG 2DEC 0.00069375
014520,000694:
014521,000695: 22,2364 17070 34343 MAXANG 2DEC 0.472222222
014522,000696:
014523,000697: # GIMBAL LOCK CONSTANTS
014524,000698:
014525,000699: # D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
014526,000700: # NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
014527,000701:
014528,000702: 22,2366 15666 20443 SD 2DEC .433015 # = SIN(D) $2
014529,000703:
014530,000704: 22,2370 33555 01106 K3S1 2DEC .86603 # = SIN(D) $1
014531,000705:
014532,000706: 22,2372 67777 77777 K4 2DEC -.25 # = -COS(D) $2
014533,000707:
014534,000708: 22,2374 04000 00000 K4SQ 2DEC .125 # = COS(D)COS(D) $2
014535,000709:
014536,000710: 22,2376 00216 36323 SNGLCD 2DEC .008725 # = SIN(NGL)COS(D) $2
014537,000711:
014538,000712: 22,2400 17773 00057 CNGL 2DEC .499695 # COS(NGL) $2
014539,000713:
014540,000714: 22,2402 14344 LOCKANGL DEC .388889 # = 70 DEGREES
014541,000715:
014542,000716: # INTERPRETIVE SUBROUTINE TO READ THE CDU ANGLES
014543,000717:
014544,000718: 22,2403 30034 READCDUK CA CDUZ # LOAD T(MPAC) WITH CDU ANGLES
014545,000719: 22,2404 54156 TS MPAC +2
014546,000720: 22,2405 00006 EXTEND
014547,000721: 22,2406 30033 DCA CDUX # AND CHANGE MODE TO TRIPLE PRECISION
014548,000722: 22,2407 16476 TCF TLOAD +6
014549,000723:
014550,000724: 22,2410 66370 CDUTODCM AXT,1 SSP
014551,000725: 22,2411 00003 OCT 3
014552,000726: 22,2412 00051 S1
014553,000727: 22,2413 00001 OCT 1 # SET XR1, S1, AND PD FOR LOOP
014554,000728: 22,2414 00010 STORE 7
014555,000729: 22,2415 77601 SETPD
014556,000730: 22,2416 00001 0
014557,000731: 22,2417 47133 LOOPSIN SLOAD* RTB
014558,000732: 22,2420 00013 10D,1
014559,000733: 22,2421 21576 CDULOGIC
Page 358 |
014561,000735: 22,2422 00013 STORE 10D # LOAD PD WITH 0 SIN(PHI)
014562,000736: 22,2423 65356 SIN PDDL # 2 COS(PHI)
014563,000737: 22,2424 00013 10D # 4 SIN(THETA)
014564,000738: 22,2425 41546 COS PUSH # 6 COS(THETA)
014565,000739: 22,2426 71300 TIX,1 DLOAD # 8 SIN(PSI)
014566,000740: 22,2427 44417 LOOPSIN # 10 COS(PSI)
014567,000741: 22,2430 00007 6
014568,000742: 22,2431 72405 DMP SL1
014569,000743: 22,2432 00013 10D
014570,000744: 22,2433 10001 STORE 0,2 # C0 = COS(THETA)COS(PSI)
014571,000745: 22,2434 41345 DLOAD DMP
014572,000746: 22,2435 00005 4
014573,000747: 22,2436 00001 0
014574,000748: 22,2437 41325 PDDL DMP # (PD6 SIN(THETA)SIN(PHI))
014575,000749: 22,2440 00007 6
014576,000750: 22,2441 00011 8D
014577,000751: 22,2442 72405 DMP SL1
014578,000752: 22,2443 00003 2
014579,000753: 22,2444 72421 BDSU SL1
014580,000754: 22,2445 00015 12D
014581,000755: 22,2446 10003 STORE 2,2 # C1=-COS(THETA)SIN(PSI)COS(PHI)
014582,000756: 22,2447 41345 DLOAD DMP
014583,000757: 22,2450 00003 2
014584,000758: 22,2451 00005 4
014585,000759: 22,2452 41325 PDDL DMP # (PD7 COS(PHI)SIN(THETA)) SCALED 4
014586,000760: 22,2453 00007 6
014587,000761: 22,2454 00011 8D
014588,000762: 22,2455 72405 DMP SL1
014589,000763: 22,2456 00001 0
014590,000764: 22,2457 72415 DAD SL1
014591,000765: 22,2460 00017 14D
014592,000766: 22,2461 10005 STORE 4,2 # C2=COS(THETA)SIN(PSI)SIN(PHI)
014593,000767: 22,2462 77745 DLOAD
014594,000768: 22,2463 00011 8D
014595,000769: 22,2464 10007 STORE 6,2 # C3=SIN(PSI)
014596,000770: 22,2465 77745 DLOAD
014597,000771: 22,2466 00013 10D
014598,000772: 22,2467 72405 DMP SL1
014599,000773: 22,2470 00003 2
014600,000774: 22,2471 10011 STORE 8D,2 # C4=COS(PSI)COS(PHI)
014601,000775: 22,2472 41345 DLOAD DMP
014602,000776: 22,2473 00013 10D
014603,000777: 22,2474 00001 0
014604,000778: 22,2475 72476 DCOMP SL1
014605,000779: 22,2476 10013 STORE 10D,2 # C5=-COS(PSI)SIN(PHI)
014606,000780: 22,2477 41345 DLOAD DMP
014607,000781: 22,2500 00005 4
014608,000782: 22,2501 00013 10D
014609,000783: 22,2502 72476 DCOMP SL1
014610,000784: 22,2503 10015 STORE 12D,2 # C6=-SIN(THETA)COS(PSI)
Page 359 |
014612,000786: 22,2504 77745 DLOAD
014613,000787: 22,2505 72405 DMP SL1 # (PUSH UP 7)
014614,000788: 22,2506 00011 8D
014615,000789: 22,2507 41325 PDDL DMP # (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE 4
014616,000790: 22,2510 00007 6
014617,000791: 22,2511 00001 0
014618,000792: 22,2512 72415 DAD SL1 # (PUSH UP 7)
014619,000793: 22,2513 77626 STADR # C7=COS(PHI)SIN(THETA)SIN(PSI)
014620,000794: 22,2514 67760 STORE 14D,2 # +COS(THETA)SIN(PHI)
014621,000795: 22,2515 77745 DLOAD
014622,000796: 22,2516 72405 DMP SL1 # (PUSH UP 6)
014623,000797: 22,2517 00011 8D
014624,000798: 22,2520 41325 PDDL DMP # (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE 4
014625,000799: 22,2521 00007 6
014626,000800: 22,2522 00003 2
014627,000801: 22,2523 72425 DSU SL1 # (PUSH UP 6)
014628,000802: 22,2524 77626 STADR
014629,000803: 22,2525 67756 STORE 16D,2 # C8=-SIN(THETA)SIN(PHI)SIN(PSI)
014630,000804: 22,2526 77616 RVQ # +COS(THETA)COS(PHI)
014631,000805:
014632,000806: # CALCULATION OF THE MATRIX DEL......
014633,000807:
014634,000808: # * * --T *
014635,000809: # DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A) SCALED 1
014636,000810: # -
014637,000811: # WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
014638,000812: # A IS THE ANGLE OF ROTATION (DP SCALED 2)
014639,000813: # -
014640,000814: # UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
014641,000815:
014642,000816: 22,2527 41401 DELCOMP SETPD PUSH # MPAC CONTAINS THE ANGLE A
014643,000817: 22,2530 00001 0
014644,000818: 22,2531 65356 SIN PDDL # PD0 = SIN(A)
014645,000819: 22,2532 41546 COS PUSH # PD2 = COS(A)
014646,000820: 22,2533 65302 SR2 PDDL # PD2 = COS(A) $8
014647,000821: 22,2534 41021 BDSU BOVB
014648,000822: 22,2535 06520 DPHALF
014649,000823: 22,2536 21712 SIGNMPAC
014650,000824: 22,2537 77725 PDDL # PD4 = 1-COS(A)
014651,000825:
014652,000826: # COMPUTE THE DIAGONAL COMPONENTS OF DEL
014653,000827:
014654,000828: 22,2540 03271 COF
014655,000829: 22,2541 41316 DSQ DMP
014656,000830: 22,2542 00005 4
014657,000831: 22,2543 52415 DAD SL3
014658,000832: 22,2544 00003 2
014659,000833: 22,2545 77604 BOVB
014660,000834: 22,2546 21712 SIGNMPAC
Page 360 |
014662,000836: 22,2547 16231 STODL KEL # UX UX(1-COS(A)) +COS(A) $1
014663,000837: 22,2550 03273 COF +2
014664,000838: 22,2551 41316 DSQ DMP
014665,000839: 22,2552 00005 4
014666,000840: 22,2553 52415 DAD SL3
014667,000841: 22,2554 00003 2
014668,000842: 22,2555 77604 BOVB
014669,000843: 22,2556 21712 SIGNMPAC
014670,000844: 22,2557 16241 STODL KEL +8D # UY UY(1-COS(A)) +COS(A) $1
014671,000845: 22,2560 03275 COF +4
014672,000846: 22,2561 41316 DSQ DMP
014673,000847: 22,2562 00005 4
014674,000848: 22,2563 52415 DAD SL3
014675,000849: 22,2564 00003 2
014676,000850: 22,2565 77604 BOVB
014677,000851: 22,2566 21712 SIGNMPAC
014678,000852: 22,2567 02251 STORE KEL +16D # UZ UZ(1-COS(A)) +COS(A) $1
014679,000853:
014680,000854: # COMPUTE THE OFF DIAGONAL TERMS OF DEL
014681,000855:
014682,000856: 22,2570 41345 DLOAD DMP
014683,000857: 22,2571 03271 COF
014684,000858: 22,2572 03273 COF +2
014685,000859: 22,2573 72405 DMP SL1
014686,000860: 22,2574 00005 4
014687,000861: 22,2575 41325 PDDL DMP # D6 UX UY (1-COS A) $4
014688,000862: 22,2576 03275 COF +4
014689,000863: 22,2577 00001 0
014690,000864: 22,2600 43206 PUSH DAD # D8 UZ SIN A $4
014691,000865: 22,2601 00007 6
014692,000866: 22,2602 41112 SL2 BOVB
014693,000867: 22,2603 21712 SIGNMPAC
014694,000868: 22,2604 16237 STODL KEL +6
014695,000869: 22,2605 62421 BDSU SL2
014696,000870: 22,2606 77604 BOVB
014697,000871: 22,2607 21712 SIGNMPAC
014698,000872: 22,2610 16233 STODL KEL +2
014699,000873: 22,2611 03271 COF
014700,000874: 22,2612 41205 DMP DMP
014701,000875: 22,2613 03275 COF +4
014702,000876: 22,2614 00005 4
014703,000877: 22,2615 65352 SL1 PDDL # D6 UX UZ (1-COS A) $4
014704,000878: 22,2616 03273 COF +2
014705,000879: 22,2617 41405 DMP PUSH # D8 UY SIN(A)
014706,000880: 22,2620 00001 0
014707,000881: 22,2621 62415 DAD SL2
014708,000882: 22,2622 00007 6
014709,000883: 22,2623 77604 BOVB
014710,000884: 22,2624 21712 SIGNMPAC
014711,000885: 22,2625 16235 STODL KEL +4 # UX UZ (1-COS(A))+UY SIN(A)
Page 361 |
014713,000887: 22,2626 62421 BDSU SL2
014714,000888: 22,2627 77604 BOVB
014715,000889: 22,2630 21712 SIGNMPAC
014716,000890: 22,2631 16245 STODL KEL +12D # UX UZ (1-COS(A))-UY SIN(A)
014717,000891: 22,2632 03273 COF +2
014718,000892: 22,2633 41205 DMP DMP
014719,000893: 22,2634 03275 COF +4
014720,000894: 22,2635 00005 4
014721,000895: 22,2636 65352 SL1 PDDL # D6 UY UZ (1-COS(A)) $ 4
014722,000896: 22,2637 03271 COF
014723,000897: 22,2640 41405 DMP PUSH # D8 UX SIN(A)
014724,000898: 22,2641 00001 0
014725,000899: 22,2642 62415 DAD SL2
014726,000900: 22,2643 00007 6
014727,000901: 22,2644 77604 BOVB
014728,000902: 22,2645 21712 SIGNMPAC
014729,000903: 22,2646 16247 STODL KEL +14D # UY UZ(1-COS(A)) +UX SIN(A)
014730,000904: 22,2647 62421 BDSU SL2
014731,000905: 22,2650 77604 BOVB
014732,000906: 22,2651 21712 SIGNMPAC
014733,000907: 22,2652 02243 STORE KEL +10D # UY UZ (1-COS(A)) -UX SIN(A)
014734,000908: 22,2653 77616 RVQ
014735,000909:
014736,000910: # DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
014737,000911: # X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
014738,000912: # LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
014739,000913: # COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
014740,000914:
014741,000915: # THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS***
014742,000916:
014743,000917: # C = COS(THETA) COS(PSI)
014744,000918: # 0
014745,000919:
014746,000920: # C = -COS(THETA) SIN(PSI) COS(PHI) + SI (THETA) SIN(PHI)
014747,000921: # 1
014748,000922:
014749,000923: # C = COS(THETA) SIN(PSI) SIN(PHI) + S N(THETA) COS(PHI)
014750,000924: # 2
014751,000925:
014752,000926: # C = SIN(PSI)
014753,000927: # 3
014754,000928:
014755,000929: # C = COS(PSI) COS(PHI)
014756,000930: # 4
014757,000931:
014758,000932: # C = -COS(PSI) SIN(PHI)
014759,000933: # 5
014760,000934:
014761,000935: # C = -SIN(THETA) COS(PSI)
014762,000936: # 6
014763,000937:
014764,000938: # C = SIN(THETA) SIN(PSI) COS(PHI) + COS THETA) SIN(PHI)
014765,000939: # 7
014766,000940:
014767,000941: # C = -SIN(THETA) SIN(PSI) SIN(PHI) + CO (THETA)COS(PHI)
014768,000942: # 8
Page 362 |
014770,000944:
014771,000945: # WHERE PHI = OGA
014772,000946: # THETA = IGA
014773,000947: # PSI = MGA
014774,000948:
014775,000949: 22,2654 67543 DCMTOCDU DLOAD* ARCSIN
014776,000950: 22,2655 00007 6,1
014777,000951: 22,2656 71406 PUSH COS # PD +0 PSI
014778,000952: 22,2657 41152 SL1 BOVB
014779,000953: 22,2660 21712 SIGNMPAC
014780,000954: 22,2661 00051 STORE S1
014781,000955: 22,2662 57543 DLOAD* DCOMP
014782,000956: 22,2663 00015 12D,1
014783,000957: 22,2664 67471 DDV ARCSIN
014784,000958: 22,2665 00051 S1
014785,000959: 22,2666 51123 PDDL* BPL # PD +2 THETA
014786,000960: 22,2667 00001 0,1 # MUST CHECK THE SIGN OF COS(THETA)
014787,000961: 22,2670 44702 OKTHETA # TO DETERMINE THE PROPER QUADRANT
014788,000962: 22,2671 57545 DLOAD DCOMP
014789,000963: 22,2672 43244 BPL DAD
014790,000964: 22,2673 44677 SUHALFA
014791,000965: 22,2674 06520 DPHALF
014792,000966: 22,2675 77650 GOTO
014793,000967: 22,2676 44701 CALCPHI
014794,000968: 22,2677 77625 SUHALFA DSU
014795,000969: 22,2700 06520 DPHALF
014796,000970: 22,2701 77606 CALCPHI PUSH
014797,000971: 22,2702 57543 OKTHETA DLOAD* DCOMP
014798,000972: 22,2703 00013 10D,1
014799,000973: 22,2704 67471 DDV ARCSIN
014800,000974: 22,2705 00051 S1
014801,000975: 22,2706 51123 PDDL* BPL # PUSH DOWN PHI
014802,000976: 22,2707 00011 8D,1
014803,000977: 22,2710 44722 OKPHI
014804,000978: 22,2711 57545 DLOAD DCOMP # PUSH UP PHI
014805,000979: 22,2712 43244 BPL DAD
014806,000980: 22,2713 44717 SUHALFAP
014807,000981: 22,2714 06520 DPHALF
014808,000982: 22,2715 77650 GOTO
014809,000983: 22,2716 44723 VECOFANG
014810,000984: 22,2717 52025 SUHALFAP DSU GOTO
014811,000985: 22,2720 06520 DPHALF
014812,000986: 22,2721 44723 VECOFANG
014813,000987: 22,2722 77745 OKPHI DLOAD # PUSH UP PHI
014814,000988: 22,2723 43466 VECOFANG VDEF RVQ
Page 363 |
014816,000990: # ROUTINES FOR TERMINATING THE AUTOMATIC MANEUVER AND RETURNING TO USER
014817,000991:
014818,000992: 22,2724 77776 TOOBADF EXIT
014819,000993: 22,2725 05567 TC ALARM
014820,000994: 22,2726 00401 OCT 00401
014821,000995:
014822,000996: 22,2727 12732 TCF NOGO # DO NOT ZERO ATTITUDE ERRORS
014823,000997:
014824,000998: 22,2730 04616 TC BANKCALL
014825,000999: 22,2731 40153 CADR ZATTEROR # ZERO ATTITUDE ERRORS
014826,001000:
014827,001001: 22,2732 04616 NOGO TC BANKCALL
014828,001002: 22,2733 40165 CADR STOPRATE # STOP RATES
014829,001003:
014830,001004: 22,2734 34752 CAF TWO
014831,001005: 22,2735 00004 INHINT # ALL RETURNS ARE NOW MADE VIA GOODEND
014832,001006: 22,2736 05203 TC WAITLIST
014833,001007: 22,2737 E6,1676 EBANK= BCDU
014834,001008: 22,2737 03234 44066 2CADR GOODMANU
014835,001009:
014836,001010: 22,2741 15155 TCF ENDOFJOB
014837,001011:
014838,001012: 22,2742 77776 TOOBADI EXIT
014839,001013: 22,2743 12732 TCF NOGO
014840,001014:
014841,001015:
End of include-file ATTITUDE_MANEUVER_ROUTINE.agc. Parent file is MAIN.agc