Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of BURST120 (SUNBURST 120). They were scanned at archive.org's Boston facility, and the scanning was sponsored by Mike Stewart. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are in ALL-CAPS, whereas comments added later in transcription are in Mixed-Case. In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the BURST120 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: REVISION 0 OF PROGRAM BURST120 
	BY NASA 2021106-031 DEC 7, 1967

	THIS LISTING IS A COPY OF A VERSION OF THE PROGRAM INTENDED 
	FOR USE IN THE ON-BOARD PRIMARY GUIDANCE COMPUTER IN THE 
	UNMANNED FLIGHT OF APOLLO LUNAR MODULE 1 --- THE AS206 MISSION.
Note that the date is the date of the printout, not the date of the program revision.

026698,000002:                                                                                                  ## Copyright:   Public domain.
026699,000003:                                                                                                  ## Filename:    ATTITUDE_MANEUVER_ROUTINE.agc
026700,000004:                                                                                                  ## Purpose:     A module for revision 0 of BURST120 (Sunburst). It 
026701,000005:                                                                                                  ##              is part of the source code for the Lunar Module's
026702,000006:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 5.
026703,000007:                                                                                                  ## Assembler:   yaYUL
026704,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
026705,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
026706,000010:                                                                                                  ## Mod history: 2016-09-30 RSB  Created draft version.
026707,000011:                                                                                                  ##              2016-10-20 MAS  Began adapting from Luminary 099.
026708,000012:                                                                                                  ##              2016-10-21 MAS  Completed adapting/transcribing.
026709,000013:                                                                                                  ##              2016-10-31 RSB  Typos.
026710,000014:                                                                                                  ##              2016-11-01 RSB  More typos.
026711,000015:                                                                                                  ##              2016-11-02 RSB  More typos.
026712,000016:                                                                                                  ##              2016-12-06 RSB  Comment-proofing with octopus/ProoferComments,
026713,000017:                                                                                                  ##                              changes made.
026714,000018:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
026715,000019:                                                                                                  ##              2017-03-15 RSB  Comment-text fixes identified in 6-way
026716,000020:                                                                                                  ##                              side-by-side diff of Sunburst 120 and 
026717,000021:                                                                                                  ##                              Luminary 69/99/116/131/210.
026718,000022:                                                                                                  ##              2017-06-13 RSB  Some white-space corrections identified while
026719,000023:                                                                                                  ##                              transcribing Sunburst 37.
026720,000024: 

Page 636

026722,000026:                                                                                                  #  BLOCK 2 LGC ATTITUDE MANEUVER ROUTINE-KALCMANU
026723,000027: 
026724,000028: 
026725,000029: 
026726,000030:                                                                                                  #  MOD 1                          DATE  11/7/66       BY  DON KEENE
026727,000031:                                                                                                  #  PROGRAM DESCRIPTION
026728,000032: 
026729,000033:                                                                                                  #       KALCMANU IS A ROUTINE WHICH GENERATES COMMANDS FOR THE LM DAP TO CHANGE THE ATTITUDE OF THE SPACECRAFT
026730,000034:                                                                                                  #  DURING FREE FALL.  IT IS DESIGNED TO MANEUVER THE SPACECRAFT FROM ITS INITIAL ORIENTATION TO SOME DESIRED
026731,000035:                                                                                                  #  ORIENTATION SPECIFIED BY THE PROGRAM WHICH CALLS KALCMANU, AVOIDING GIMBAL LOCK IN THE PROCESS.  IN THE 
026732,000036:                                                                                                  #  MOD 1 VERSION, THIS DESIRED ATTITUDE CAN BE SPECIFIED IN ONE OF TWO WAYS
026733,000037: 
026734,000038:                                                                                                  #       A) BY A SET OF THREE COMMANDED CDU ANGLES
026735,000039: 
026736,000040:                                                                                                  #       B) BY A VECTOR IN STABLE MEMBER COORDINATES ALONG WHICH THE THRUST VECTOR (GIVEN IN SPACECRAFT
026737,000041:                                                                                                  #          COORDINATES IS TO BE ALIGNED.
026738,000042: 
026739,000043:                                                                                                  #       IF THE FIRST METHOD IS USED, THE THREE DESIRED CDU ANGLES MUST BE STORED AS 2:S COMPLEMENT SINGLE
026740,000044:                                                                                                  #  PRECISION ANGLES IN THE THREE CONSECUTIVE LOCATIONS, CPHI, CTHETA, CPSI, WHERE
026741,000045: 
026742,000046:                                                                                                  #       CPHI = COMMANDED OUTER GIMBAL ANGLE
026743,000047:                                                                                                  #       CTHETA = COMMANDED INNER GIMBAL ANGLE
026744,000048:                                                                                                  #       CPSI = COMMANDED MIDDLE GIMBAL ANGLE
026745,000049: 
026746,000050:                                                                                                  #  THE ENTRY POINT IN KALCMANU FOR THIS METHOD IS KALCMAN3 (SEE SECTION 4)
026747,000051: 
026748,000052:                                                                                                  #       THE SECOND METHOD MAY BE USED FOR POINTING THE THRUST AXIS OF THE SPACECRAFT.  IN THIS CASE THE AXIS TO
026749,000053:                                                                                                  #  BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
026750,000054:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS. THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
026751,000055:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
026752,000056:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF
026753,000057:                                                                                                  #  THIS VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.
026754,000058: 
026755,000059:                                                                                                  #                                                                             -
026756,000060:                                                                                                  #       KALCMANU DETERMINES THE DIRECTION OF THE SINGLE EQUIVALENT ROTATION (COF ALTERNATELY TERMED U) AND THE
026757,000061:                                                                                                  #  MAGNITUDE OF THE ROTATION (AM) TO BRING THE S/C FROM ITS INITIAL ORIENTATION TO ITS FINAL ORIENTATION.
026758,000062:                                                                                                  #  THIS DIRECTION REMAINS FIXED BOTH IN INERTIAL COORDINATES AND IN COMMANDED S/C AXES THROUGHOUT THE 
026759,000063:                                                                                                  #                   -
026760,000064:                                                                                                  #  MANEUVER.  ONCE COF AND AM HAVE BEEN DETERMINED, KALCMANU THEN EXAMINES THE MANEUVER TO SEE IF IT WILL BRING
026761,000065:                                                                                                  #                                        -
026762,000066:                                                                                                  #  THE S/C THROUGH GIMBAL LOCK.  IF SO, COF AND AM ARE READJUSTED SO THAT THE S/C WILL JUST SKIM THE GIMBAL
026763,000067:                                                                                                  #  LOCK ZONE AND ALIGN THE X-AXIS.  IN GENERAL A FINAL YAW  ABOUT X WILL BE NECESSARY TO COMPLETE THE MANEUVER.
026764,000068:                                                                                                  #  NEEDLESS TO SAY, NEITHER THE INITIAL NOR THE FINAL ORIENTATION CAN BE IN GIMBAL LOCK.
026765,000069: 
026766,000070:                                                                                                  #       FOR PROPER ATTITUDE CONTROL THE DIGITAL AUTOPILOT MUST BE GIVEN AN ATTITUDE REFERENCE WHICH IT CAN TRACK.
026767,000071:                                                                                                  #  KALCMANU DOES THIS BY GENERATING A REFERENCE OF DESIRED GIMBAL ANGLES (CDUXD, CDUYD, CDUZD) WHICH ARE UPDATED
026768,000072:                                                                                                  #  EVERY ONE SECOND DURING THE MANEUVER.  TO ACHIEVE A SMOOTHER SEQUENCE OF COMMANDS BETWEEN SUCCESSIVE UPDATES,
026769,000073:                                                                                                  #  THE PROGRAM ALSO GENERATES A SET OF INCREMENTAL CDU ANGLES (DELDCDU) TO BE ADDED TO CDU DESIRED BY THE DIGITAL
026770,000074:                                                                                                  #  AUTOPILOT.  KALCMANU ALSO CALCULATES THE COMPONENT MANEUVER RATES (OMEGAPD, OMEGAQD, OMEGARD), WHICH CAN
026771,000075:                                                                                                  #                                       -

Page 637

026773,000077:                                                                                                  #  BE DETERMINED SIMPLY BY MULTIPLYING COF BY SOME SCALAR (ARATE) CORRESPONDING TO THE DESIRED ROTATIONAL RATE.
026774,000078: 
026775,000079:                                                                                                  #       AUTOMATIC MANEUVERS ARE TIMED WITH THE HELP OF WAITLIST SO THAT AFTER A SPECIFIED INTERVAL THE Y AND Z
026776,000080:                                                                                                  #  DESIRED RATES ARE SET TO ZERO AND THE DESIRED CDU ANGLES (CDUYD, CDUZD) ARE SET EQUAL TO THE FINAL DESIRED CDU
026777,000081:                                                                                                  #  ANGLES (CTHETA, CPSI).  IF ANY YAW  REMAINS DUE TO GIMBAL LOCK AVOIDANCE, THE FINAL YAW  MANEUVER IS
026778,000082:                                                                                                  #  CALCULATED AND THE DESIRED YAW  RATE SET TO SOME FIXED VALUE (ROLLRATE = + OR - 2 DEGREES PER SEC).
026779,000083:                                                                                                  #  IN THIS CASE ONLY AN INCREMENTAL CDUX ANGLE (DELFROLL) IS SUPPLIED TO THE DAP.  AT THE END OF THE YAW
026780,000084:                                                                                                  #  MANEUVER OR IN THE EVENT THAT THERE WAS NO FINAL YAW,  CDUXD IS SET EQUAL TO CPHI AND THE X-AXIS DESIRED
026781,000085:                                                                                                  #  RATE SET TO ZERO.  THUS, UPON COMPLETION OF THE MANEUVER THE S/C WILL FINISH UP IN A LIMIT CYCLE ABOUT THE
026782,000086:                                                                                                  #  DESIRED FINAL GIMBAL ANGLES.
026783,000087: 
026784,000088: 
026785,000089: 
026786,000090:                                                                                                  #  PROGRAM LOGIC FLOW
026787,000091: 
026788,000092:                                                                                                  #       KALCMANU IS CALLED AS A HIGH PRIORITY JOB WITH ENTRY POINTS AT KALCMAN3 AND VECPOINT.  IT FIRST PICKS
026789,000093:                                                                                                  #  UP THE CURRENT CDU ANGLES TO BE USED AS THE BASIS FOR ALL COMPUTATIONS INVOLVING THE INITIAL S/C ORIENTATION.
026790,000094:                                                                                                  #  IT THEN DETERMINES THE DIRECTION COSINE MATRICES RELATING BOTH THE INITIAL AND FINAL S/C ORIENTATION TO STABLE
026791,000095:                                                                                                  #                *    *                                                                               *
026792,000096:                                                                                                  #  MEMBER AXES (MIS, MFS).  IT ALSO COMPUTES THE MATRIX RELATING FINAL S/C AXES TO INITIAL S/C AXES (MFI).  THE
026793,000097:                                                                                                  #  ANGLE OF ROTATION (AM) IS THEN EXTRACTED FROM THIS MATRIX, AND TESTS ARE MADE TO DETERMINE IF
026794,000098: 
026795,000099:                                                                                                  #       A)  AM LESS THAN .25 DEGREES (MINANG)
026796,000100:                                                                                                  #       B)  AM GREATER THAN 170 DEGREES (MAXANG)
026797,000101: 
026798,000102:                                                                                                  #       IF AM LESS THAN .25 DEGREES, NO COMPLICATED AUTOMATIC MANEUVERING IS NECESSARY.  THEREFORE WE CAN SIMPLY
026799,000103:                                                                                                  #  SET CDU DESIRED EQUAL TO THE FINAL CDU DESIRED ANGLES AND TERMINATE THE JOB.
026800,000104: 
026801,000105:                                                                                                  #       IF AM IS GREATER THAN .25 DEGREES BUT LESS THAN 170 DEGREES, THE AXES OF THE SINGLE EQUIVALENT ROTATION
026802,000106:                                                                                                  #    -                                                       *
026803,000107:                                                                                                  #  (COF) IS EXTRACTED FROM THE SKEW SYMMETRIC COMPONENTS OF MFI.                            *     *
026804,000108:                                                                                                  #       IF AM GREATER THAN 170 DEGREES AN ALTERNATE METHOD EMPLOYING THE SYMMETRIC PART OF MFI (MFISYM) IS USED
026805,000109:                                                                                                  #                -
026806,000110:                                                                                                  #  TO DETERMINE COF.
026807,000111: 
026808,000112:                                                                                                  #       THE PROGRAM THEN CHECKS TO SEE IF THE MANEUVER AS COMPUTED WILL BRING THE S/C THROUGH GIMBAL LOCK.  IF
026809,000113:                                                                                                  #  SO, A NEW MANEUVER IS CALCULATED WHICH WILL JUST SKIM THE GIMBAL LOCK ZONE AND ALIGN THE S/C X-AXIS.  THIS
026810,000114:                                                                                                  #  METHOD ASSURES THAT THE ADDITIONAL MANEUVERING TO AVOID GIMBAL LOCK WILL BE KEPT TO A MINIMUM.  SINCE A FINAL
026811,000115:                                                                                                  #  P AXIS YAW WILL BE NECESSARY, A SWITCH IS RESET (STATE SWITCH 31) TO ALLOW FOR THE COMPUTATION OF THIS FINAL
026812,000116:                                                                                                  #  YAW.
026813,000117: 
026814,000118:                                                                                                  #       AS STATED PREVIOUSLY KALCMANU GENERATES A SEQUENCE OF DESIRED GIMBAL ANGLES WHICH ARE UPDATED EVERY 
026815,000119:                                                                                                  #                                                                                               -
026816,000120:                                                                                                  #  SECOND.  THIS IS ACCOMPLISHED BY A SMALL ROTATION OF THE DESIRED S/C FRAME ABOUT THE VECTOR COF.  THE NEW
026817,000121:                                                                                                  #  DESIRED REFERENCE MATRIX IS THEN,
026818,000122: 
026819,000123:                                                                                                  #                   *              *         *
026820,000124:                                                                                                  #                  MIS       =    MIS       DEL
026821,000125:                                                                                                  #                     N+1            N

Page 638

026823,000127:                                                                                                  #         *
026824,000128:                                                                                                  #  WHERE DEL IS THE MATRIX CORRESPONDING TO THIS SMALL ROTATION.  THE NEW CDU ANGLES CAN THEN BE EXTRACTED
026825,000129:                                                                                                  #        *
026826,000130:                                                                                                  #  FROM MIS.
026827,000131: 
026828,000132:                                                                                                  #       AT THE BEGINNING OF THE MANEUVER THE AUTOPILOT DESIRED RATES (OMEGAPD, OMEGAQD, OMEGARD) AND THE 
026829,000133:                                                                                                  #  MANEUVER TIMINGS ARE ESTABLISHED.  ON THE FIRST PASS AND ON ALL SUBSEQUENT UPDATES THE CDU DESIRED
026830,000134:                                                                                                  #  ANGLES ARE LOADED WITH THE APPROPRIATE VALUES AND THE INCREMENTAL CDU ANGLES ARE COMPUTED.  THE AGC CLOCKS
026831,000135:                                                                                                  #  (TIME1 AND TIME2) ARE THAN CHECKED TO SEE IF THE MANEUVER WILL TERMINATE BEFORE THE NEXT UPDATE.  IF
026832,000136:                                                                                                  #  NOT, KALCMANU CALLS FOR ANOTHER UPDATE (RUN AS A JOB WITH PRIORITY TBD) IN ONE SECOND.  ANY DELAYS IN THIS
026833,000137:                                                                                                  #  CALLING SEQUENCE ARE AUTOMATICALLY COMPENSATED IN CALLING FOR THE NEXT UPDATE.
026834,000138: 
026835,000139:                                                                                                  #       IF IT IS FOUND THAT THE MANEUVER IS TO TERMINATE BEFORE THE NEXT UPDATE A ROUTINE IS CALLED (AS A WAIT-
026836,000140:                                                                                                  #  LIST TASK) TO STOP THE MANEUVER AT THE APPROPRIATE TIME AS EXPLAINED ABOVE.
026837,000141: 
026838,000142: 
026839,000143: 
026840,000144:                                                                                                  #  CALLING SEQUENCE
026841,000145: 
026842,000146:                                                                                                  #       THE ENTRY POINT IN KALCMANU FOR POINTING THE THRUST AXIS OF THE SPACECRAFT IS VECPOINT
026843,000147: 
026844,000148:                                                                                                  #       CAF        PRIO XX
026845,000149:                                                                                                  #                       --
026846,000150:                                                                                                  #       INHINT
026847,000151:                                                                                                  #       TC         FINDVAC
026848,000152:                                                                                                  #       2CADR      VECPOINT
026849,000153:                                                                                                  #       RELINT
026850,000154: 
026851,000155:                                                                                                  #       THE CALLING PROGRAM MUST ALSO SPECIFY THE DESIRED MANEUVERING RATES, PRESENTLY IN THE FORM OF A SINGLE
026852,000156:                                                                                                  #  PRECISION NUMBER (RATEINDEX), WHICH IS LOADED WITH ONE OF FOUR VALUES 0, 2, 4, OR 6, CORRESPONDING TO ANGULAR
026853,000157:                                                                                                  #  RATES OF .5, 2, 5, 10 DEGREES/SEC.  THERE IS ALSO A STATE SWITCH (33) WHICH MAY BE SET TO IGNORE ANY FINAL YAW
026854,000158:                                                                                                  #  INCURRED BY AVOIDING GIMBAL LOCK.
026855,000159: 
026856,000160:                                                                                                  #       WITH THIS INFORMATION KALCMANU WILL THEN GENERATE A SEQUENCE OF THREE CDU DESIRED ANGLES (CDUXD, CDUYD,
026857,000161:                                                                                                  #  CDUZD), AND THREE INCREMENTAL ANGLES (DELDCDU, DELDCDU1, DELDCDU2) AS WELL AS THE COMPONENT MANEUVER RATES
026858,000162:                                                                                                  #  (IN S/C AXES) TO BE USED BY THE LEM DAP IN PERFORMING THE AUTOMATIC MANEUVER.
026859,000163: 
026860,000164:                                                                                                  #       THERE ARE TWO WAYS IN WHICH KALCMANU MAY BE INITIATED CORRESPONDING TO THE TWO METHODS OF SPECIFYING THE
026861,000165:                                                                                                  #  DESIRED ATTITUDE OF THE SPACECRAFT.  IF METHOD 1 IS USED, THE COMMANDED GIMBAL ANGLES MUST BE PRECOMPUTED AND
026862,000166:                                                                                                  #  STORED IN LOCATIONS CPHI, CTHETA, CPSI.  THE USER:S PROGRAM MUST THEN CLEAR STATE SWITCH NO 33 TO ALLOW THE 
026863,000167:                                                                                                  #  ATTITUDE MANEUVER ROUTINE TO PERFORM ANY FINAL P-AXIS YAW INCURRED BY AVOIDING GIMBAL LOCK.  THE MANEUVER IS
026864,000168:                                                                                                  #  THEN INITIATED BY ESTABLISHING THE FOLLOWING EXECUTIVE JOB
026865,000169: 
026866,000170:                                                                                                  #                         *
026867,000171:                                                                                                  #       CAF     PRIO    XX
026868,000172:                                                                                                  #                       --
026869,000173:                                                                                                  #       INHINT
026870,000174:                                                                                                  #       TC         FINDVAC
026871,000175:                                                                                                  #       2CADR      KALCMAN3
026872,000176:                                                                                                  #       RELINT
026873,000177: 

Page 639

026875,000179:                                                                                                  #  THE USER:S PROGRAM MAY EITHER CONTINUE OR WAIT FOR THE TERMINATION OF THE MANEUVER.  IF THE USER WISHES TO
026876,000180:                                                                                                  #  WAIT, HE MAY PUT HIS JOB TO SLEEP WITH THE FOLLOWING INSTRUCTIONS
026877,000181: 
026878,000182:                                                                                                  #       L          TC        BANKCALL
026879,000183:                                                                                                  #       L+1        CADR      ATTSTALL
026880,000184:                                                                                                  #       L+2        (BAD      RETURN)
026881,000185:                                                                                                  #       L+3        (GOOD     RETURN)
026882,000186: 
026883,000187:                                                                                                  #       UPON COMPLETION OF THE MANEUVER, THE PROGRAM WILL BE AWAKENED AT L+3 IF THE MANEUVER WAS COMPLETED
026884,000188:                                                                                                  #  SUCCESSFULLY, OR AT L+2 IF THE MANEUVER WAS ABORTED.  THIS ABORT WOULD OCCUR IF THE INITIAL OR FINAL ATTITUDE
026885,000189:                                                                                                  #  WAS IN GIMBAL LOCK.
026886,000190:                                                                                                  #                                                                   -
026887,000191:                                                                                                  #       IF THE SECOND METHOD IS USED, THE DESIRED THRUST DIRECTION, V , MUST BE COMPUTED AND STORED IN THE SIX
026888,000192:                                                                                                  #                                                                    F
026889,000193:                                                                                                  #  ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS POINTVSM.  THE THRUST AXIS MUST BE LOADED INTO THE SIX ERASABLE
026890,000194:                                                                                                  #  LOCATIONS BEGINNING WITH SC AXIS.  THE CALLER MUST THEN CLEAR (OR SET) STATE SWITCH NO 33 AND SPECIFY THE
026891,000195:                                                                                                  #  DESIRED MANEUVERING RATE AS BEFORE.  THE MANEUVER IS THEN INITIATED BY THE EXECUTIVE CALL.
026892,000196: 
026893,000197: 
026894,000198: 
026895,000199:                                                                                                  #  SUBROUTINES
026896,000200: 
026897,000201:                                                                                                  #       KALCMANU USES A NUMBER OF INTERPRETIVE SUBROUTINES WHICH MAY BE OF GENERAL INTEREST.  SINCE THESE ROUTINES
026898,000202:                                                                                                  #  WERE PROGRAMMED EXCLUSIVELY FOR KALCMANU, THEY ARE NOT, AS YET, GENERALLY AVAILABLE FOR USE BY OTHER PROGRAMS.
026899,000203: 
026900,000204:                                                                                                  #       MXM3
026901,000205:                                                                                                  #       ----
026902,000206: 
026903,000207:                                                                                                  #       THIS SUBROUTINE MULTIPLIES TWO 3X3 MATRICES AND LEAVES THE RESULT IN THE FIRST 18 LOCATIONS OF THE PUSH
026904,000208:                                                                                                  #  DOWN LIST, I.E.,
026905,000209: 
026906,000210:                                                                                                  #                 (M    M    M )
026907,000211:                                                                                                  #                 ( 0    1    2)
026908,000212:                                                                                                  #        *        (            )       *         *
026909,000213:                                                                                                  #        M    =   (M    M    M )  =    M1   X    M2
026910,000214:                                                                                                  #                 ( 3    4    5)
026911,000215:                                                                                                  #                 (            )
026912,000216:                                                                                                  #                 (M    M    M )
026913,000217:                                                                                                  #                 ( 6    7    8)
026914,000218: 
026915,000219:                                                                                                  #                                                                                        *
026916,000220:                                                                                                  #       INDEX REGISTER X1 MUST BE LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M1, AND X2 MUST BE
026917,000221:                                                                                                  #                                                         *
026918,000222:                                                                                                  #  LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M2.   THE ROUTINE USES THE FIRST 20 LOCATIONS OF THE PUSH
026919,000223:                                                                                                  #  DOWN LIST.  THE FIRST ELEMENT OF THE MATRIX APPEARS IN PDO.  PUSH UP FOR M .
026920,000224:                                                                                                  #                                                                            8
026921,000225: 
026922,000226:                                                                                                  #       TRANSPOS
026923,000227:                                                                                                  #       --------

Page 640

026925,000229:                                                                                                  #       THIS ROUTINE TRANSPOSES A 3X3 MATRIX AND LEAVES THE RESULT IN THE PUSH DOWN LIST, I.E.,
026926,000230:                                                                                                  #  
026927,000231:                                                                                                  #        *         * T
026928,000232:                                                                                                  #        M    =    M1
026929,000233: 
026930,000234:                                                                                                  #  INDEX REGISTER X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M1.  PUSH UP FOR THE FIRST AND SUB-
026931,000235:                                                                                                  #                        *
026932,000236:                                                                                                  #  SEQUENT COMPONENTS OF M.   THIS SUBROUTINE ALSO USES THE FIRST 20 LOCATIONS OF THE PUSH DOWN LIST.
026933,000237: 
026934,000238:                                                                                                  #       CDU TO DCM
026935,000239:                                                                                                  #       ----------
026936,000240: 
026937,000241:                                                                                                  #       THIS SUBROUTINE CONVERTS THREE CDU ANGLES IN T(MPAC) TO A DIRECTION COSINE MATRIX (SCALED BY 2) RELATING
026938,000242:                                                                                                  #  THE CORRESPONDING S/C ORIENTATIONS TO THE STABLE MEMBER FRAME.  THE FORMULAS FOR THIS CONVERSION ARE
026939,000243: 
026940,000244:                                                                                                  #        M    =    COSY  COSZ
026941,000245:                                                                                                  #         0
026942,000246: 
026943,000247:                                                                                                  #        M    =    -COSY  SINZ  COSX  +  SINY  SINX
026944,000248:                                                                                                  #         1
026945,000249: 
026946,000250:                                                                                                  #        M    =    COSY  SINZ  SINX  +  SINY  COSX
026947,000251:                                                                                                  #         2
026948,000252: 
026949,000253:                                                                                                  #        M    =    SINZ
026950,000254:                                                                                                  #         3
026951,000255: 
026952,000256:                                                                                                  #        M    =    COSZ  COSX
026953,000257:                                                                                                  #         4
026954,000258: 
026955,000259:                                                                                                  #        M    =    -COSZ  SINX
026956,000260:                                                                                                  #         5
026957,000261: 
026958,000262:                                                                                                  #        M    =    -SINY  COSZ
026959,000263:                                                                                                  #         6
026960,000264: 
026961,000265:                                                                                                  #        M    =    SINY  SINZ  COSX  +  COSY  SINX
026962,000266:                                                                                                  #         7
026963,000267: 
026964,000268:                                                                                                  #        M    =    -SINY  SINZ  SINX  +  COSY  COSX
026965,000269:                                                                                                  #         8
026966,000270: 
026967,000271:                                                                                                  #  WHERE      X    =    OUTER GIMBAL ANGLE
026968,000272:                                                                                                  #             Y    =    INNER GIMBAL ANGLE
026969,000273:                                                                                                  #             Z    =    MIDDLE GIMBAL ANGLE
026970,000274: 
026971,000275:                                                                                                  #       THE INTERPRETATION OF THIS MATRIX IS AS FOLLOWS
026972,000276: 
026973,000277:                                                                                                  #       IF A , A , A  REPRESENT THE COMPONENTS OF A VECTOR IN S/C AXES THEN THE COMPONENTS OF THE SAME VECTOR IN
026974,000278:                                                                                                  #           X   Y   Z

Page 641

026976,000280:                                                                                                  #  STABLE MEMBER AXES (B , B , B ) ARE
026977,000281:                                                                                                  #                       X   Y   Z
026978,000282: 
026979,000283:                                                                                                  #             (B )                (A )
026980,000284:                                                                                                  #             ( X)                ( X)
026981,000285:                                                                                                  #             (  )                (  )
026982,000286:                                                                                                  #             (  )           *    (  )
026983,000287:                                                                                                  #             (B )      =    M    (A )
026984,000288:                                                                                                  #             ( Y)                ( Y)
026985,000289:                                                                                                  #             (  )                (  )
026986,000290:                                                                                                  #             (B )                (A )
026987,000291:                                                                                                  #             ( Z)                ( Z)
026988,000292: 
026989,000293:                                                                                                  #      THE SUBROUTINE WILL STORE THIS MATRIX IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY AS SPECIFIED BY THE CALLING
026990,000294:                                                                                                  #                                                                                                              *
026991,000295:                                                                                                  #  PROGRAM.  TO DO THIS THE CALLING PROGRAM MUST FIRST LOAD X2 WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M.
026992,000296: 
026993,000297:                                                                                                  #       INTERNALLY, THE ROUTINE USES THE FIRST 16 LOCATIONS OF THE PUSH DOWN LIST, ALSO STEP REGISTER S1 AND INDEX
026994,000298:                                                                                                  #  REGISTER X2.
026995,000299: 
026996,000300: 
026997,000301: 
026998,000302:                                                                                                  #       DCM TO CDU
026999,000303:                                                                                                  #       ----------
027000,000304:                                                                                                  #                                                                            *
027001,000305:                                                                                                  #       THIS ROUTINE EXTRACTS THE CDU ANGLES FROM A DIRECTION COSINE MATRIX (M SCALED BY 2) RELATING S/C AXIS TO
027002,000306:                                                                                                  #                                                                                  *
027003,000307:                                                                                                  #  STABLE MEMBER AXES.  X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M.  THE SUBROUTINE LEAVES THE
027004,000308:                                                                                                  #  CORRESPONDING GIMBAL ANGLES IN V(MPAC) AS DOUBLE PRECISION 1:S COMPLEMENT ANGLES SCALED BY 2PI.  THE FORMULAS
027005,000309:                                                                                                  #  FOR THIS CONVERSION ARE
027006,000310: 
027007,000311:                                                                                                  #        Z    =    ARCSIN (M  )
027008,000312:                                                                                                  #                            3
027009,000313: 
027010,000314:                                                                                                  #        Y    =    ARCSIN (-M /COSZ)
027011,000315:                                                                                                  #                            6
027012,000316: 
027013,000317:                                                                                                  #  IF M  IS NEGATIVE, Y IS REPLACED BY PI SGN Y - Y
027014,000318:                                                                                                  #      0
027015,000319: 
027016,000320:                                                                                                  #        X    =    ARCSIN (-M /COSZ)
027017,000321:                                                                                                  #                            5
027018,000322: 
027019,000323:                                                                                                  #  IF M  IS NEGATIVE X IS REPLACED BY PI SGN X - X
027020,000324:                                                                                                  #      4
027021,000325: 
027022,000326:                                                                                                  #       THIS ROUTINE DOES NOT SET THE PUSH DOWN POINTER, BUT USES THE NEXT 8 LOCATIONS OF THE PUSH DOWN LIST AND
027023,000327:                                                                                                  #  RETURNS THE POINTER TO ITS ORIGINAL SETTING.  THIS PROCEDURE ALLOWS THE CALLER TO STORE THE MATRIX AT THE TOP OF
027024,000328:                                                                                                  #  THE PUSH DOWN LIST.
027025,000329: 

Page 642

027027,000331:                                                                                                  #       DELCOMP
027028,000332:                                                                                                  #       -------
027029,000333: 
027030,000334:                                                                                                  #                                                           *
027031,000335:                                                                                                  #       THIS ROUTINE COMPUTES THE DIRECTION COSINE MATRIX (DEL) RELATING ON
027032,000336:                                                                                                  #                                                                           -
027033,000337:                                                                                                  #  IS ROTATED WITH RESPECT TO THE FIRST BY AN ANGLE, A, ABOUT A UNIT VECTOR, U.  THE FORMULA FOR THIS MATRIX IS
027034,000338: 
027035,000339:                                                                                                  #        *         *           --T           *
027036,000340:                                                                                                  #        DEL  =    I  COSA  +  UU (1-COSA) + V SINA
027037,000341:                                                                                                  #                                             X
027038,000342: 
027039,000343:                                                                                                  #  WHERE      *         (1   0    0)
027040,000344:                                                                                                  #             I    =    (0   1    0)
027041,000345:                                                                                                  #                       (0   0    1)
027042,000346: 
027043,000347: 
027044,000348:                                                                                                  #                          2                              
027045,000349:                                                                                                  #                       (U        U U       U U )
027046,000350:                                                                                                  #                       ( X        X Y       X Z)
027047,000351:                                                                                                  #                       (                       )
027048,000352:                                                                                                  #             --T       (           2           )
027049,000353:                                                                                                  #             UU   =    (U U      U         U U )
027050,000354:                                                                                                  #                       ( Y X      Y         Y Z)
027051,000355:                                                                                                  #                       (                       )
027052,000356:                                                                                                  #                       (                     2 )
027053,000357:                                                                                                  #                       (U U      U U       U  )
027054,000358:                                                                                                  #                       ( Z X      Z Y       Z  )
027055,000359: 
027056,000360: 
027057,000361:                                                                                                  #                       (0        -U        U  )
027058,000362:                                                                                                  #                       (           Z        Y )
027059,000363:                                                                                                  #             *         (                      )
027060,000364:                                                                                                  #             V    =    (U        0         -U )
027061,000365:                                                                                                  #              X        ( Z                   X)
027062,000366:                                                                                                  #                       (                      )
027063,000367:                                                                                                  #                       (-U       U         0  )
027064,000368:                                                                                                  #                       (  Y       X           )
027065,000369: 
027066,000370:                                                                                                  #             -
027067,000371:                                                                                                  #             U    =    UNIT ROTATION VECTOR RESOLVED INTO S/C AXES
027068,000372:                                                                                                  #             A    =    ROTATION ANGLE
027069,000373: 
027070,000374:                                                                                                  #                              *
027071,000375:                                                                                                  #       THE INTERPRETATION OF DEL IS AS FOLLOWS
027072,000376: 
027073,000377:                                                                                                  #       IF A , A , A  REPRESENT THE COMPONENT OF A VECTOR IN THE ROTATED FRAME, THEN THE COMPONENTS OF THE SAME
027074,000378:                                                                                                  #           X   Y   Z
027075,000379:                                                                                                  #  VECTOR IN THE ORIGINAL S/C AXES (B , B , B ) ARE
027076,000380:                                                                                                  #                                    X   Y   Z

Page 643

027078,000382:                                                                                                  #             (B )                     (A )
027079,000383:                                                                                                  #             ( X)                     ( X)
027080,000384:                                                                                                  #             (  )            *        (  )
027081,000385:                                                                                                  #             (B )      =    DEL       (A )
027082,000386:                                                                                                  #             ( Y)                     ( Y)
027083,000387:                                                                                                  #             (  )                     (  )
027084,000388:                                                                                                  #             (B )                     (A )
027085,000389:                                                                                                  #             ( Z)                     ( Z)
027086,000390: 
027087,000391:                                                                                                  #       THE ROUTINE WILL STORE THIS MATRIX (SCALED UNITY) IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY BEGINNING WITH
027088,000392:                                                                                                  #                                                                                              -
027089,000393:                                                                                                  #  THE LOCATION CALLED DEL.  IN ORDER TO USE THE ROUTINE, THE CALLING PROGRAM MUST FIRST STORE U (A HALF UNIT
027090,000394:                                                                                                  #  DOUBLE PRECISION VECTOR) IN THE SET OF ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS CALLED COF.  THE ANGLE, A,
027091,000395:                                                                                                  #  MUST THEN BE LOADED INTO D(MPAC).
027092,000396:                                                                                                  #  
027093,000397:                                                                                                  #       INTERNALLY, THE PROGRAM ALSO USES THE FIRST 10 LOCATIONS OF THE PUSH DOWN LIST.
027094,000398: 
027095,000399: 
027096,000400: 
027097,000401:                                                                                                  #       READCDUK
027098,000402:                                                                                                  #       --------
027099,000403: 
027100,000404:                                                                                                  #       THIS BASIC LANGUAGE SUBROUTINE LOADS T(MPAC) WITH THE THREE CDU ANGLES.
027101,000405: 
027102,000406: 
027103,000407: 
027104,000408:                                                                                                  #      SIGNMPAC
027105,000409:                                                                                                  #       --------
027106,000410: 
027107,000411:                                                                                                  #       THIS IS A BASIC LANGUAGE SUBROUTINE WHICH LIMITS THE MAGNITUDE OF D(MPAC) TO + OR - DPOSMAX ON OVERFLOW.
027108,000412: 
027109,000413: 
027110,000414: 
027111,000415:                                                                                                  #       PROGRAM STORAGE ALLOCATION
027112,000416: 
027113,000417:                                                                                                  #             1)   FIXED MEMORY                       1059 WORDS
027114,000418:                                                                                                  #             2)   ERASABLE MEMORY                      98
027115,000419:                                                                                                  #             3)   STATE SWITCHES                        3
027116,000420:                                                                                                  #             4)   FLAGS                                 1
027117,000421: 
027118,000422: 
027119,000423: 
027120,000424:                                                                                                  #       JOB PRIORITIES
027121,000425: 
027122,000426:                                                                                                  #             1)   KALCMANU                            TBD
027123,000427:                                                                                                  #             2)   ONE SECOND UPDATE                   TBD
027124,000428: 
027125,000429: 
027126,000430: 
027127,000431: 
027128,000432:                                                                                                  #       SUMMARY OF STATE SWITCHES AND FLAGWORDS USED BY KALCMANU.

Page 644

027130,000434:                                                                                                  #  STATE                FLAGWRD 2      SETTING             MEANING
027131,000435:                                                                                                  #  SWITCH NO.            BIT NO.
027132,000436: 
027133,000437:                                                                                                  #    *
027134,000438:                                                                                                  #  31                      14            0       MANEUVER WENT THROUGH GIMBAL LOCK
027135,000439:                                                                                                  #                                        1       MANEUVER DID NOT GO THROUGH GIMBAL LOCK
027136,000440: 
027137,000441:                                                                                                  #    *
027138,000442:                                                                                                  #  32                      13            0       CONTINUE UPDATE PROCESS
027139,000443:                                                                                                  #                                        1       START UPDATE PROCESS
027140,000444: 
027141,000445:                                                                                                  #  33                      12            0       PERFORM FINAL P-AXIS YAW IF REQUIRED
027142,000446:                                                                                                  #                                        1       IGNORE ANY FINAL P-AXIS YAW
027143,000447: 
027144,000448:                                                                                                  #  34                      11            0       SIGNAL END OF KALCMANU
027145,000449:                                                                                                  #                                        1       KALCMANU IN PROCESS       USER MUST SET SWITCH BEFORE INITIATING
027146,000450: 
027147,000451: 
027148,000452:                                                                                                  #          *  INTERNAL TO KALCMANU
027149,000453: 
027150,000454: 
027151,000455: 
027152,000456:                                                                                                  #       SUGGESTIONS FOR PROGRAM INTEGRATION
027153,000457: 
027154,000458:                                                                                                  #       THE FOLLOWING VARIABLES SHOULD BE ASSIGNED TO UNSWITCH ERASABLE
027155,000459: 
027156,000460:                                                                                                  #                       CPHI
027157,000461:                                                                                                  #                       CTHETA
027158,000462:                                                                                                  #                       CPSI
027159,000463:                                                                                                  #                       POINTVSM  +5
027160,000464:                                                                                                  #                       SCAXIS    +5
027161,000465:                                                                                                  #                       DELDCDU
027162,000466:                                                                                                  #                       DELDCDU1
027163,000467:                                                                                                  #                       DELDCDU2
027164,000468:                                                                                                  #                       RATEINDX
027165,000469: 
027166,000470:                                                                                                  #       THE FOLLOWING SUBROUTINES MAY BE PUT IN A DIFFERENT BANK
027167,000471: 
027168,000472:                                                                                                  #                       MXM3
027169,000473:                                                                                                  #                       TRANSPOS
027170,000474:                                                                                                  #                       SIGNMPAC
027171,000475:                                                                                                  #                       READCDUK
027172,000476:                                                                                                  #                       CDUTODCM
027173,000477: 

Page 645

027175,000479: 34,2000                                           BANK     34                                    
027176,000480: 34,2000  E3,1535                                  EBANK=   MIS                                   
027177,000481: 34,2000           12001                           NOOP                                           
027178,000482: 34,2001           06112        VECPOINT           TC       INTPRET                               
027179,000483: 34,2002           77634                           RTB                                            
027180,000484: 34,2003           73513                                    READCDUK                              #  READ THE PRESENT CDU ANGLES
027181,000485: 34,2004           01533                           STORE    BCDU                                  
027182,000486: 34,2005           45164                           AXC,2    CALL                                  #  COMPUTE THE TRANSFORMATION FROM INITIAL
027183,000487: 34,2006           01535                                    MIS                                   #  S/C AXES TO STABLE MEMBER AXES (MIS)
027184,000488: 34,2007           70445                                    CDUTODCM                              
027185,000489: 34,2010           61375                           VLOAD    VXM                                   #                                 -
027186,000490: 34,2011           01656                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VS INTO
027187,000491: 34,2012           01536                                    MIS                                   #  INITIAL S/C AXES
027188,000492: 34,2013           41456                           UNIT     PUSH                                  
027189,000493: 34,2014           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
027190,000494: 34,2015           01664                                    SCAXIS                                #  WHERE VI = SCAXIS
027191,000495: 34,2016           57400                           BOV      VCOMP                                 
027192,000496: 34,2017           70042                                    PICKAXIS                              
027193,000497: 34,2020           25624                           STOVL    COF                                   
027194,000498: 34,2021           01664                                    SCAXIS                                
027195,000499: 34,2022           72441                           DOT      SL1                                   
027196,000500: 34,2023           77726                           ARCCOS                                         
027197,000501: 34,2024           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
027198,000502: 34,2025           70564                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES = MFI
027199,000503: 34,2026           75160                           AXC,1    AXC,2                                 #  COMPUTE THE TRANSFORMATION FROM FINAL
027200,000504: 34,2027           01535                                    MIS                                   #  S/C AXES TO STABLE MEMBER AXES
027201,000505: 34,2030           01557                                    KEL                                   
027202,000506: 34,2031           77624                           CALL                                           
027203,000507: 34,2032           73417                                    MXM3                                  #  MFS IN PD LIST
027204,000508: 34,2033           45160                           AXC,1    CALL                                  
027205,000509: 34,2034           00000                                    0                                     #  EXTRACT THE CDU ANGLES FROM THIS MATRIX
027206,000510: 34,2035           70711                                    DCMTOCDU                              
027207,000511: 34,2036           77634                           RTB                                            
027208,000512: 34,2037           33526                                    V1STO2S                               #  AND USE THEM AS THE COMMANDED CDU ANGLES
027209,000513: 34,2040           35632                           STCALL   CPHI                                  
027210,000514: 34,2041           70070                                    KALCMAN3   +1                         #  PROCEED AS IF WE HAD BEEN GIVEN COMMAND
027211,000515:                                                                                                  #  CDU ANGLES
027212,000516: 34,2042           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0. PUSH UP FOR VF
027213,000517: 34,2043           01664                                    SCAXIS                                #  FIND VF . VI
027214,000518: 34,2044           72240                           BMN      TLOAD                                 #  IF ANTIPARALLEL
027215,000519: 34,2045           70051                                    ROT180                                
027216,000520: 34,2046           01533                                    BCDU                                  
027217,000521: 34,2047           35632                           STCALL   CPHI                                  #  IF VF = VI
027218,000522: 34,2050           70070                                    KALCMAN3   +1                         
027219,000523: 
027220,000524: 34,2051           47375        ROT180             VLOAD    VXV                                   #  180 DEG ROTATION IS REQUIRED
027221,000525: 34,2052           01544                                    MIS        +6                         #  Y STABLE MEMBER AXIS IN INITIAL S/C AXES
027222,000526: 34,2053           30414                                    HALFA                                 
027223,000527: 34,2054           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
027224,000528: 34,2055           01664                                    SCAXIS                                #  FIND UNIT (VI X UNIT(Y(SM) X X(I)))

Page 646

027226,000530: 34,2056           40056                           UNIT     BOV                                   #  PICK A VECTOR PERPENDICULAR TO VI IN THE
027227,000531: 34,2057           70064                                    PICKX                                 #  PLANE CONTAINING Y(SM) AND X(I) SO THAT
027228,000532: 34,2060           15624        XROT               STODL    COF                                   #  MANEUVER DOES NOT GO THRU GIMBAL LOCK
027229,000533: 34,2061           30414                                    HALFA                                 
027230,000534: 34,2062           77650                           GOTO                                           
027231,000535: 34,2063           70024                                    COMPMATX                              
027232,000536: 34,2064           52175        PICKX              VLOAD    GOTO                                  #  PICK THE X AXIS IN THIS CASE
027233,000537: 34,2065           30414                                    HALFA                                 
027234,000538: 34,2066           70060                                    XROT                                  
027235,000539: 
027236,000540:                                                                                                  #  FIRST ENTRY POINT- KALCMAN3
027237,000541: 
027238,000542:                                                                                                  #  THE THREE DESIRED CDU ANGLES MUST BE STORED AS SINGLE PRECISION TWOS COMPLEMENT ANGLES IN THE THREE SUCCESSIVE
027239,000543:                                                                                                  #  LOCATIONS, CPHI, CTHETA, CPSI.
027240,000544: 
027241,000545: 34,2067           06112        KALCMAN3           TC       INTPRET                               #  PICK UP THE CURRENT CDU ANGLES AND
027242,000546: 34,2070           77634                           RTB                                            #    COMPUTE THE MATRIX FROM INITIAL S/C
027243,000547: 34,2071           73513                                    READCDUK                              #    AXES TO FINAL S/C AXES
027244,000548: 34,2072           01533                           STORE    BCDU                                  #  STORE INITIAL S/C ANGLES
027245,000549: 34,2073           51535                           SLOAD    ABS                                   
027246,000550: 34,2074           01535                                    BCDU       +2                         #  CHECK MAGNITUDE OF MIDDLE GIMBAL ANGLE
027247,000551: 34,2075           51025                           DSU      BPL                                   
027248,000552: 34,2076           30444                                    LOCKANGL                              #  IF GREATER THAN 60 DEG, ABORT MANEUVER
027249,000553: 34,2077           70771                                    TOOBAD                                
027250,000554: 34,2100           72364                           AXC,2    TLOAD                                 
027251,000555: 34,2101           01535                                    MIS                                   
027252,000556: 34,2102           01533                                    BCDU                                  
027253,000557: 34,2103           77624                           CALL                                           #  COMPUTE THE TRANSFORMATION FROM INITIAL
027254,000558: 34,2104           70445                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES
027255,000559: 34,2105           51535                           SLOAD    ABS                                   #  CHECK THE MAGNITUDE OF THE DESIRED
027256,000560: 34,2106           01634                                    CPSI                                  #  MIDDLE GIMBAL ANGLE
027257,000561: 34,2107           51025                           DSU      BPL                                   
027258,000562: 34,2110           30444                                    LOCKANGL                              #  IF GREATER THAN 60 DEG, ABORT MANEUVER
027259,000563: 34,2111           70771                                    TOOBAD                                
027260,000564: 34,2112           72364                           AXC,2    TLOAD                                 
027261,000565: 34,2113           01557                                    MFS                                   #  PREPARE TO CALCULATE ARRAY MFS
027262,000566: 34,2114           01632                                    CPHI                                  
027263,000567: 34,2115           77624                           CALL                                           
027264,000568: 34,2116           70445                                    CDUTODCM                              
027265,000569: 34,2117           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED        $2
027266,000570: 34,2120           01535                                    MIS                                   
027267,000571: 34,2121           73447                                    TRANSPOS                              
027268,000572: 34,2122           77775                           VLOAD                                          
027269,000573: 34,2123           77626                           STADR                                          
027270,000574: 34,2124           52161                           STOVL    TMIS       +12D                       
027271,000575: 34,2125           77626                           STADR                                          
027272,000576: 34,2126           52167                           STOVL    TMIS       +6                         
027273,000577: 34,2127           77626                           STADR                                          
027274,000578: 34,2130           76175                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
027275,000579: 34,2131           75160                           AXC,1    AXC,2                                 

Page 647

027277,000581: 34,2132           01601                                    TMIS                                  
027278,000582: 34,2133           01557                                    MFS                                   
027279,000583: 34,2134           77624                           CALL                                           
027280,000584: 34,2135           73417                                    MXM3                                  
027281,000585: 34,2136           45575                           VLOAD    STADR                                 
027282,000586: 34,2137           52203                           STOVL    MFI        +12D                       
027283,000587: 34,2140           77626                           STADR                                          
027284,000588: 34,2141           52211                           STOVL    MFI        +6                         
027285,000589: 34,2142           77626                           STADR                                          
027286,000590: 34,2143           76217                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
027287,000591: 34,2144           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST
027288,000592: 34,2145           00023                                    18D                                   
027289,000593: 34,2146           73456                                    TRNSPSPD                              
027290,000594: 34,2147           45575                           VLOAD    STADR                                 
027291,000595: 34,2150           52161                           STOVL    TMFI       +12D                       
027292,000596: 34,2151           77626                           STADR                                          
027293,000597: 34,2152           52167                           STOVL    TMFI       +6                         
027294,000598: 34,2153           77626                           STADR                                          
027295,000599: 34,2154           76175                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI)  SCALED BY 4
027296,000600: 
027297,000601:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
027298,000602: 
027299,000603: 34,2155           45345                           DLOAD    DSU                                   
027300,000604: 34,2156           01604                                    TMFI       +2                         
027301,000605: 34,2157           01562                                    MFI        +2                         
027302,000606: 34,2160           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
027303,000607: 34,2161           01564                                    MFI        +4                         
027304,000608: 34,2162           01606                                    TMFI       +4                         
027305,000609: 34,2163           45325                           PDDL     DSU                                   
027306,000610: 34,2164           01614                                    TMFI       +10D                       
027307,000611: 34,2165           01572                                    MFI        +10D                       
027308,000612: 34,2166           77666                           VDEF                                           
027309,000613: 34,2167           01635                           STORE    COFSKEW                               #  EQUALS MFISKEW
027310,000614: 
027311,000615:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
027312,000616: 
027313,000617: 34,2170           43345                           DLOAD    DAD                                   
027314,000618: 34,2171           01560                                    MFI                                   
027315,000619: 34,2172           01600                                    MFI        +16D                       
027316,000620: 34,2173           43225                           DSU      DAD                                   
027317,000621: 34,2174           30426                                    QUARTA                                
027318,000622: 34,2175           01570                                    MFI        +8D                        
027319,000623: 34,2176           01645                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
027320,000624: 34,2177           77726                           ARCCOS                                         
027321,000625: 34,2200           01643                           STORE    AM                                    #  AM=ARCCOS(CAM)  (AM SCALED BY 2)
027322,000626: 34,2201           51025                           DSU      BPL                                   
027323,000627: 34,2202           30410                                    MINANG                                
027324,000628: 34,2203           70214                                    CHECKMAX                              
027325,000629: 34,2204           77751                           TLOAD                                          #  MANEUVER LESS THAN .25 DEGREES
027326,000630: 34,2205           01632                                    CPHI                                  #  GO DIRECTLY INTO ATTITUDE HOLD

Page 648

027328,000632: 34,2206           00767                           STORE    CDUXD                                 #  ABOUT COMMANDED ANGLES
027329,000633: 34,2207           77751                           TLOAD                                          
027330,000634: 34,2210           30416                                    NIL                                   
027331,000635: 34,2211           00775                           STORE    OMEGAPD                               #  ZERO DESIRED RATES
027332,000636: 34,2212           34772                           STCALL   DELDCDU                               #  PREPARE TO END MANEUVER ON GOOD RETURN
027333,000637: 34,2213           70761                                    ENDMANU                               
027334,000638: 34,2214           45345        CHECKMAX           DLOAD    DSU                                   
027335,000639: 34,2215           01643                                    AM                                    
027336,000640: 34,2216           30412                                    MAXANG                                
027337,000641: 34,2217           77244                           BPL      VLOAD                                 
027338,000642: 34,2220           70226                                    ALTCALC                               #  UNIT
027339,000643: 34,2221           01635                                    COFSKEW                               #  COFSKEW
027340,000644: 34,2222           77656                           UNIT                                           
027341,000645: 34,2223           01624                           STORE    COF                                   #  COF IS THE MANEUVER AXIS
027342,000646: 34,2224           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
027343,000647: 34,2225           71006                                    LOCSKIRT                              
027344,000648: 34,2226           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
027345,000649: 34,2227           01560                                    MFI                                   
027346,000650: 34,2230           01602                                    TMFI                                  
027347,000651: 34,2231           77762                           VSR1                                           
027348,000652: 34,2232           25602                           STOVL    MFISYM                                
027349,000653: 34,2233           01566                                    MFI        +6                         
027350,000654: 34,2234           74455                           VAD      VSR1                                  
027351,000655: 34,2235           01610                                    TMFI       +6                         
027352,000656: 34,2236           25610                           STOVL    MFISYM     +6                         
027353,000657: 34,2237           01574                                    MFI        +12D                       
027354,000658: 34,2240           74455                           VAD      VSR1                                  
027355,000659: 34,2241           01616                                    TMFI       +12D                       
027356,000660: 34,2242           01616                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
027357,000661: 
027358,000662:                                                                                                  #  CALCULATE COF
027359,000663: 
027360,000664: 34,2243           70545                           DLOAD    SR1                                   
027361,000665: 34,2244           01645                                    CAM                                   
027362,000666: 34,2245           45325                           PDDL     DSU                                   #  PDO CAM                               $4
027363,000667: 34,2246           30414                                    HALFA                                 
027364,000668: 34,2247           01645                                    CAM                                   
027365,000669: 34,2250           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                           $2
027366,000670: 34,2251           73501                                    SIGNMPAC                              
027367,000671: 34,2252           01622                                    MFISYM     +16D                       
027368,000672: 34,2253           56225                           DSU      DDV                                   
027369,000673: 34,2254           00001                                    0                                     
027370,000674: 34,2255           00003                                    2                                     
027371,000675: 34,2256           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
027372,000676: 34,2257           01612                                    MFISYM     +8D                        #                                $ ROOT 2
027373,000677: 34,2260           56225                           DSU      DDV                                   
027374,000678: 34,2261           00001                                    0                                     
027375,000679: 34,2262           00003                                    2                                     
027376,000680: 34,2263           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM)  $ROOT2

Page 649

027378,000682: 34,2264           01602                                    MFISYM                                
027379,000683: 34,2265           56225                           DSU      DDV                                   
027380,000684: 34,2266           00001                                    0                                     
027381,000685: 34,2267           00003                                    2                                     
027382,000686: 34,2270           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM)  $ROOT 2
027383,000687: 34,2271           77656                           UNIT                                           
027384,000688: 34,2272           01624                           STORE    COF                                   
027385,000689: 
027386,000690:                                                                                                  #  DETERMINE  LARGEST COF AND ADJUST ACCORDINGLY
027387,000691: 
027388,000692: 34,2273           45345        COFMAXGO           DLOAD    DSU                                   
027389,000693: 34,2274           01624                                    COF                                   
027390,000694: 34,2275           01626                                    COF        +2                         
027391,000695: 34,2276           71240                           BMN      DLOAD                                 #  COFY G COFX
027392,000696: 34,2277           70306                                    COMP12                                
027393,000697: 34,2300           01624                                    COF                                   
027394,000698: 34,2301           50025                           DSU      BMN                                   
027395,000699: 34,2302           01630                                    COF        +4                         
027396,000700: 34,2303           70363                                    METHOD3                               #  COFZ G COFX OR COFY
027397,000701: 34,2304           77650                           GOTO                                           
027398,000702: 34,2305           70337                                    METHOD1                               #  COFX G COFY OR COFZ
027399,000703: 34,2306           45345        COMP12             DLOAD    DSU                                   
027400,000704: 34,2307           01626                                    COF        +2                         
027401,000705: 34,2310           01630                                    COF        +4                         
027402,000706: 34,2311           77640                           BMN                                            
027403,000707: 34,2312           70363                                    METHOD3                               #  COFZ G COFY OR COFX
027404,000708: 
027405,000709: 34,2313           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
027406,000710: 34,2314           01637                                    COFSKEW    +2                         #  UY
027407,000711: 34,2315           70321                                    U2POS                                 
027408,000712: 34,2316           57575                           VLOAD    VCOMP                                 
027409,000713: 34,2317           01624                                    COF                                   
027410,000714: 34,2320           01624                           STORE    COF                                   
027411,000715: 34,2321           51145        U2POS              DLOAD    BPL                                   
027412,000716: 34,2322           01604                                    MFISYM     +2                         #  UX UY
027413,000717: 34,2323           70327                                    OKU21                                 
027414,000718: 34,2324           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
027415,000719: 34,2325           01624                                    COF                                   
027416,000720: 34,2326           01624                           STORE    COF                                   
027417,000721: 34,2327           51145        OKU21              DLOAD    BPL                                   
027418,000722: 34,2330           01614                                    MFISYM     +10D                       #  UY UZ
027419,000723: 34,2331           71006                                    LOCSKIRT                              
027420,000724: 34,2332           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
027421,000725: 34,2333           01630                                    COF        +4                         
027422,000726: 34,2334           01630                           STORE    COF        +4                         
027423,000727: 34,2335           77650                           GOTO                                           
027424,000728: 34,2336           71006                                    LOCSKIRT                              
027425,000729: 34,2337           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
027426,000730: 34,2340           01635                                    COFSKEW                               #  UX
027427,000731: 34,2341           70345                                    U1POS                                 

Page 650

027429,000733: 34,2342           57575                           VLOAD    VCOMP                                 
027430,000734: 34,2343           01624                                    COF                                   
027431,000735: 34,2344           01624                           STORE    COF                                   
027432,000736: 34,2345           51145        U1POS              DLOAD    BPL                                   
027433,000737: 34,2346           01604                                    MFISYM     +2                         #  UX UY
027434,000738: 34,2347           70353                                    OKU12                                 
027435,000739: 34,2350           57545                           DLOAD    DCOMP                                 
027436,000740: 34,2351           01626                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
027437,000741: 34,2352           01626                           STORE    COF        +2                         
027438,000742: 34,2353           51145        OKU12              DLOAD    BPL                                   
027439,000743: 34,2354           01606                                    MFISYM     +4                         #  UX UZ
027440,000744: 34,2355           71006                                    LOCSKIRT                              
027441,000745: 34,2356           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
027442,000746: 34,2357           01630                                    COF        +4                         
027443,000747: 34,2360           01630                           STORE    COF        +4                         
027444,000748: 34,2361           77650                           GOTO                                           
027445,000749: 34,2362           71006                                    LOCSKIRT                              
027446,000750: 34,2363           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX
027447,000751: 34,2364           01641                                    COFSKEW    +4                         #  UZ
027448,000752: 34,2365           70371                                    U3POS                                 
027449,000753: 34,2366           57575                           VLOAD    VCOMP                                 
027450,000754: 34,2367           01624                                    COF                                   
027451,000755: 34,2370           01624                           STORE    COF                                   
027452,000756: 34,2371           51145        U3POS              DLOAD    BPL                                   
027453,000757: 34,2372           01606                                    MFISYM     +4                         #  UX UZ
027454,000758: 34,2373           70377                                    OKU31                                 
027455,000759: 34,2374           57545                           DLOAD    DCOMP                                 
027456,000760: 34,2375           01624                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
027457,000761: 34,2376           01624                           STORE    COF                                   
027458,000762: 34,2377           51145        OKU31              DLOAD    BPL                                   
027459,000763: 34,2400           01614                                    MFISYM     +10D                       #  UY UZ
027460,000764: 34,2401           71006                                    LOCSKIRT                              
027461,000765: 34,2402           57545                           DLOAD    DCOMP                                 
027462,000766: 34,2403           01626                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
027463,000767: 34,2404           01626                           STORE    COF        +2                         
027464,000768: 34,2405           77650                           GOTO                                           
027465,000769: 34,2406           71006                                    LOCSKIRT                              
027466,000770: 

Page 651

027468,000772:                                                                                                  #  MATRIX OPERATIONS
027469,000773: 
027470,000774: 35,3417                                           BANK     35                                    
027471,000775: 35,3417  E3,1535                                  EBANK=   MIS                                   
027472,000776: 
027473,000777: 35,3417           77601        MXM3               SETPD                                          #  MXM3 MULTIPLIES 2 3X3 MATRICES
027474,000778: 35,3420           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
027475,000779: 35,3421           64743                           DLOAD*   PDDL*                                 #  ADDRESS OF 1ST MATRIX IN XR1
027476,000780: 35,3422           77762                                    12D,2                                 #  ADDRESS OF 2ND MATRIX IN XR2
027477,000781: 35,3423           77770                                    6,2                                   
027478,000782: 35,3424           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 1)
027479,000783: 35,3425           77776                                    0,2                                   
027480,000784: 35,3426           64717                           MXV*     PDDL*                                 #  M1XM2(COL 1) IN PD
027481,000785: 35,3427           00001                                    0,1                                   
027482,000786: 35,3430           77760                                    14D,2                                 
027483,000787: 35,3431           64723                           PDDL*    PDDL*                                 
027484,000788: 35,3432           77766                                    8D,2                                  
027485,000789: 35,3433           77774                                    2,2                                   
027486,000790: 35,3434           63666                           VDEF     MXV*                                  #  DEFINE VECTOR M2(COL 2)
027487,000791: 35,3435           00001                                    0,1                                   
027488,000792: 35,3436           64723                           PDDL*    PDDL*                                 #  M1XM2(COL 2) IN PD
027489,000793: 35,3437           77756                                    16D,2                                 
027490,000794: 35,3440           77764                                    10D,2                                 
027491,000795: 35,3441           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 3)
027492,000796: 35,3442           77772                                    4,2                                   
027493,000797: 35,3443           41517                           MXV*     PUSH                                  #  M1XM2(COL 3) IN PD
027494,000798: 35,3444           00001                                    0,1                                   
027495,000799: 35,3445           77650                           GOTO                                           
027496,000800: 35,3446           73456                                    TRNSPSPD                              #  REVERSE ROWS AND COLS IN PD AND 
027497,000801:                                                                                                  #                                  RETURN WITH M1XM2 IN PD LIST
027498,000802: 
027499,000803: 35,3447           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
027500,000804: 35,3450           00001                                    0                                     #   AND LEAVES RESULT IN PD LIST
027501,000805: 35,3451           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
027502,000806: 35,3452           62713                           PDVL*    PDVL*                                 
027503,000807: 35,3453           00007                                    6,1                                   
027504,000808: 35,3454           00015                                    12D,1                                 
027505,000809: 35,3455           77606                           PUSH                                           #  MATRIX IN PD
027506,000810: 35,3456           65345        TRNSPSPD           DLOAD    PDDL                                  #  ENTER WITH MATRIX IN PD LIST
027507,000811: 35,3457           00003                                    2                                     
027508,000812: 35,3460           00007                                    6                                     
027509,000813: 35,3461           14003                           STODL    2                                     
027510,000814: 35,3462           77626                           STADR                                          
027511,000815: 35,3463           63770                           STODL    6                                     
027512,000816: 35,3464           00005                                    4                                     
027513,000817: 35,3465           77725                           PDDL                                           
027514,000818: 35,3466           00015                                    12D                                   
027515,000819: 35,3467           14005                           STODL    4                                     
027516,000820: 35,3470           77626                           STADR                                          
027517,000821: 35,3471           63762                           STODL    12D                                   

Page 652

027519,000823: 35,3472           00013                                    10D                                   
027520,000824: 35,3473           77725                           PDDL                                           
027521,000825: 35,3474           00017                                    14D                                   
027522,000826: 35,3475           14013                           STODL    10D                                   
027523,000827: 35,3476           77626                           STADR                                          
027524,000828: 35,3477           77760                           STORE    14D                                   
027525,000829: 35,3500           77616                           RVQ                                            #  RETURN WITH TRANSPOSED MATRIX IN PD LIST
027526,000830: 

Page 653

027528,000832: 34,2407                                           BANK     34                                    
027529,000833: 34,2407  E3,1535                                  EBANK=   MIS                                   
027530,000834: 
027531,000835: 34,2407           00013 13563  MINANG             2DEC     0.00069375                            
027532,000836: 
027533,000837: 34,2411           17070 34343  MAXANG             2DEC     0.472222222                            
027534,000838: 
027535,000839: 34,2413           20000 00000  HALFA              2DEC     0.5                                   
027536,000840: 
027537,000841: 34,2415           00000 00000  NIL                2DEC     0.0                                   
027538,000842: 
027539,000843: 34,2417           00000 00000                     2DEC     0.0                                   
027540,000844: 
027541,000845: 34,2421           00000 00000                     2DEC     0.0                                   
027542,000846: 
027543,000847: 34,2423           20000 00000                     2DEC     0.5                                   
027544,000848: 
027545,000849: 34,2425           10000 00000  QUARTA             2DEC     .25                                   
027546,000850:                                                                                                  #           GIMBAL LOCK CONSTANTS
027547,000851: 
027548,000852:                                                                                                  #  D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
027549,000853:                                                                                                  #           NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
027550,000854: 
027551,000855: 34,2427           15666 20443  SD                 2DEC     .433015                               #  = SIN(D)                      $2
027552,000856: 
027553,000857: 34,2431           33555 01106  K3S1               2DEC     .86603                                #  = SIN(D)                      $1
027554,000858: 
027555,000859: 34,2433           67777 77777  K4                 2DEC     -.25                                  #  = -COS(D)                     $2
027556,000860: 
027557,000861: 34,2435           04000 00000  K4SQ               2DEC     .125                                  #  = COS(D)COS(D)                $2
027558,000862: 
027559,000863: 34,2437           00216 36323  SNGLCD             2DEC     .008725                               #  = SIN(NGL)COS(D)              $2
027560,000864: 
027561,000865: 34,2441           17773 00057  CNGL               2DEC     .499695                               #  COS(NGL)                      $2
027562,000866: 
027563,000867: 34,2443           12525 12525  LOCKANGL           2DEC     .3333333333                            #  $60DEGG
027564,000868: 
027565,000869: 35,3501                                           BANK     35                                    
027566,000870: 35,3501  E3,1535                                  EBANK=   MIS                                   
027567,000871:                                                                                                  #  ROUTINE FOR LIMITING THE SIZE OF MPAC ON OVERFLOW TO DP POSMAX OR DP NEGMAX
027568,000872: 
027569,000873: 35,3501           00006        SIGNMPAC           EXTEND                                         
027570,000874: 35,3502           37743                           DCA      DPOSMAX                               
027571,000875: 35,3503           52145                           DXCH     MPAC                                  
027572,000876: 35,3504           10000                           CCS      A                                     
027573,000877: 35,3505           37767                           CAF      ZERO                                  
027574,000878: 35,3506           16544                           TCF      SLOAD2     +2                         
027575,000879: 35,3507           13510                           TCF      +1                                    
027576,000880: 35,3510           00006                           EXTEND                                         

Page 654

027578,000882: 35,3511           47743                           DCS      DPOSMAX                               
027579,000883: 35,3512           16542                           TCF      SLOAD2                                
027580,000884: 
027581,000885: 
027582,000886: 
027583,000887:                                                                                                  #  INTERPRETIVE SUBROUTINE TO READ THE CDU ANGLES
027584,000888: 
027585,000889: 35,3513           30034        READCDUK           CA       CDUZ                                  #  LOAD T(MPAC) WITH CDU ANGLES
027586,000890: 35,3514           54146                           TS       MPAC       +2                         
027587,000891: 35,3515           00006                           EXTEND                                         
027588,000892: 35,3516           30033                           DCA      CDUX                                  #  AND CHANGE MODE TO TRIPLE PRECISION
027589,000893: 35,3517           16554                           TCF      TLOAD      +6                         
027590,000894: 
027591,000895: 
027592,000896: 
027593,000897: 34,2445                                           BANK     34                                    
027594,000898: 34,2445  E3,1535                                  EBANK=   MIS                                   
027595,000899: 34,2445           66370        CDUTODCM           AXT,1    SSP                                   
027596,000900: 34,2446           00003                           OCT      3                                     
027597,000901: 34,2447           00051                                    S1                                    
027598,000902: 34,2450           00001                           OCT      1                                     #  SET XR1, S1, AND PD FOR LOOP
027599,000903: 34,2451           00010                           STORE    7                                     
027600,000904: 34,2452           77601                           SETPD                                          
027601,000905: 34,2453           00001                                    0                                     
027602,000906: 34,2454           47133        LOOPSIN            SLOAD*   RTB                                   
027603,000907: 34,2455           00013                                    10D,1                                 
027604,000908: 34,2456           33457                                    CDULOGIC                              
027605,000909: 34,2457           00013                           STORE    10D                                   #  LOAD PD WITH 0 SIN(PHI)
027606,000910: 34,2460           65356                           SIN      PDDL                                  #               2 COS(PHI)
027607,000911: 34,2461           00013                                    10D                                   #               4 SIN(THETA)
027608,000912: 34,2462           41546                           COS      PUSH                                  #               6 COS(THETA)
027609,000913: 34,2463           71300                           TIX,1    DLOAD                                 #               8 SIN(PSI)
027610,000914: 34,2464           70454                                    LOOPSIN                               #              10 COS(PSI)
027611,000915: 34,2465           00007                                    6                                     
027612,000916: 34,2466           72405                           DMP      SL1                                   
027613,000917: 34,2467           00013                                    10D                                   
027614,000918: 34,2470           10001                           STORE    0,2                                   #  C0=COS(THETA)COS(PSI)
027615,000919: 34,2471           41345                           DLOAD    DMP                                   
027616,000920: 34,2472           00005                                    4                                     
027617,000921: 34,2473           00001                                    0                                     
027618,000922: 34,2474           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI))
027619,000923: 34,2475           00007                                    6                                     
027620,000924: 34,2476           00011                                    8D                                    
027621,000925: 34,2477           72405                           DMP      SL1                                   
027622,000926: 34,2500           00003                                    2                                     
027623,000927: 34,2501           72421                           BDSU     SL1                                   
027624,000928: 34,2502           00015                                    12D                                   
027625,000929: 34,2503           10003                           STORE    2,2                                   #  C1=-COS(THETA)SIN(PSI)COS(PHI)
027626,000930: 34,2504           41345                           DLOAD    DMP                                   
027627,000931: 34,2505           00003                                    2                                     

Page 655

027629,000933: 34,2506           00005                                    4                                     
027630,000934: 34,2507           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
027631,000935: 34,2510           00007                                    6                                     
027632,000936: 34,2511           00011                                    8D                                    
027633,000937: 34,2512           72405                           DMP      SL1                                   
027634,000938: 34,2513           00001                                    0                                     
027635,000939: 34,2514           72415                           DAD      SL1                                   
027636,000940: 34,2515           00017                                    14D                                   
027637,000941: 34,2516           10005                           STORE    4,2                                   #  C2=COS(THETA)SIN(PSI)SIN(PHI)
027638,000942: 34,2517           77745                           DLOAD                                          
027639,000943: 34,2520           00011                                    8D                                    
027640,000944: 34,2521           10007                           STORE    6,2                                   #  C3=SIN(PSI)
027641,000945: 34,2522           77745                           DLOAD                                          
027642,000946: 34,2523           00013                                    10D                                   
027643,000947: 34,2524           72405                           DMP      SL1                                   
027644,000948: 34,2525           00003                                    2                                     
027645,000949: 34,2526           10011                           STORE    8D,2                                  #  C4=COS(PSI)COS(PHI)
027646,000950: 34,2527           41345                           DLOAD    DMP                                   
027647,000951: 34,2530           00013                                    10D                                   
027648,000952: 34,2531           00001                                    0                                     
027649,000953: 34,2532           72476                           DCOMP    SL1                                   
027650,000954: 34,2533           10013                           STORE    10D,2                                 #  C5=-COS(PSI)SIN(PHI)
027651,000955: 34,2534           41345                           DLOAD    DMP                                   
027652,000956: 34,2535           00005                                    4                                     
027653,000957: 34,2536           00013                                    10D                                   
027654,000958: 34,2537           72476                           DCOMP    SL1                                   
027655,000959: 34,2540           10015                           STORE    12D,2                                 #  C6=-SIN(THETA)COS(PSI)
027656,000960: 34,2541           77745                           DLOAD                                          
027657,000961: 34,2542           72405                           DMP      SL1                                   #   (PUSH UP 7)
027658,000962: 34,2543           00011                                    8D                                    
027659,000963: 34,2544           41325                           PDDL     DMP                                   #   (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE 4
027660,000964: 34,2545           00007                                    6                                     
027661,000965: 34,2546           00001                                    0                                     
027662,000966: 34,2547           72415                           DAD      SL1                                   #   (PUSH UP 7)
027663,000967: 34,2550           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
027664,000968: 34,2551           67760                           STORE    14D,2                                 #   +COS(THETA)SIN(PHI)
027665,000969: 34,2552           77745                           DLOAD                                          
027666,000970: 34,2553           72405                           DMP      SL1                                   #   (PUSH UP 6)
027667,000971: 34,2554           00011                                    8D                                    
027668,000972: 34,2555           41325                           PDDL     DMP                                   #   (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE 4
027669,000973: 34,2556           00007                                    6                                     
027670,000974: 34,2557           00003                                    2                                     
027671,000975: 34,2560           72425                           DSU      SL1                                   #   (PUSH UP 6)
027672,000976: 34,2561           77626                           STADR                                          
027673,000977: 34,2562           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
027674,000978: 34,2563           77616                           RVQ                                            #   +COS(THETA)COS(PHI)
027675,000979: 
027676,000980:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
027677,000981: 
027678,000982:                                                                                                  #           *      *               --T           *

Page 656

027680,000984:                                                                                                  #           DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)         SCALED 1
027681,000985:                                                                                                  #                 -
027682,000986:                                                                                                  #           WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
027683,000987:                                                                                                  #           A IS THE ANGLE OF ROTATION (DP SCALED 2)
027684,000988:                                                                                                  #                                              -
027685,000989:                                                                                                  #           UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
027686,000990: 
027687,000991: 34,2564           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
027688,000992: 34,2565           00001                                    0                                     
027689,000993: 34,2566           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
027690,000994: 34,2567           41546                           COS      PUSH                                  #  PD2 = COS(A)
027691,000995: 34,2570           65302                           SR2      PDDL                                  #  PD2 = COS(A)                          $8
027692,000996: 34,2571           41021                           BDSU     BOVB                                  
027693,000997: 34,2572           30414                                    HALFA                                 
027694,000998: 34,2573           73501                                    SIGNMPAC                              
027695,000999: 34,2574           77725                           PDDL                                           #  PD4 = 1-COS(A)
027696,001000: 
027697,001001:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
027698,001002: 
027699,001003: 34,2575           01624                                    COF                                   
027700,001004: 34,2576           41316                           DSQ      DMP                                   
027701,001005: 34,2577           00005                                    4                                     
027702,001006: 34,2600           52415                           DAD      SL3                                   #  UXUX(1-COS(A))                        $8
027703,001007: 34,2601           00003                                    2                                     
027704,001008: 34,2602           77604                           BOVB                                           
027705,001009: 34,2603           73501                                    SIGNMPAC                              
027706,001010: 34,2604           15560                           STODL    KEL                                   #  UX UX(1-COS(A)) +COS(A)                $1
027707,001011: 34,2605           01626                                    COF        +2                         
027708,001012: 34,2606           41316                           DSQ      DMP                                   
027709,001013: 34,2607           00005                                    4                                     
027710,001014: 34,2610           52415                           DAD      SL3                                   #  UYUY(1-COS(A))                        $8
027711,001015: 34,2611           00003                                    2                                     
027712,001016: 34,2612           77604                           BOVB                                           
027713,001017: 34,2613           73501                                    SIGNMPAC                              
027714,001018: 34,2614           15570                           STODL    KEL        +8D                        #  UY UY(1-COS(A)) +COS(A)                $1
027715,001019: 34,2615           01630                                    COF        +4                         
027716,001020: 34,2616           41316                           DSQ      DMP                                   
027717,001021: 34,2617           00005                                    4                                     
027718,001022: 34,2620           52415                           DAD      SL3                                   #  UZUZ(1-COS(A))                        $8
027719,001023: 34,2621           00003                                    2                                     
027720,001024: 34,2622           77604                           BOVB                                           
027721,001025: 34,2623           73501                                    SIGNMPAC                              
027722,001026: 34,2624           01600                           STORE    KEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)                $1
027723,001027: 
027724,001028:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
027725,001029: 
027726,001030: 34,2625           41345                           DLOAD    DMP                                   
027727,001031: 34,2626           01624                                    COF                                   
027728,001032: 34,2627           01626                                    COF        +2                         

Page 657

027730,001034: 34,2630           72405                           DMP      SL1                                   
027731,001035: 34,2631           00005                                    4                                     
027732,001036: 34,2632           41325                           PDDL     DMP                                   #  D6  UX UY (1-COS A)                $ 4
027733,001037: 34,2633           01630                                    COF        +4                         
027734,001038: 34,2634           00001                                    0                                     
027735,001039: 34,2635           43206                           PUSH     DAD                                   #  D8  UZ SIN A                       $ 4
027736,001040: 34,2636           00007                                    6                                     
027737,001041: 34,2637           41112                           SL2      BOVB                                  
027738,001042: 34,2640           73501                                    SIGNMPAC                              
027739,001043: 34,2641           15566                           STODL    KEL        +6                         
027740,001044: 34,2642           62421                           BDSU     SL2                                   
027741,001045: 34,2643           77604                           BOVB                                           
027742,001046: 34,2644           73501                                    SIGNMPAC                              
027743,001047: 34,2645           15562                           STODL    KEL        +2                         
027744,001048: 34,2646           01624                                    COF                                   
027745,001049: 34,2647           41205                           DMP      DMP                                   
027746,001050: 34,2650           01630                                    COF        +4                         
027747,001051: 34,2651           00005                                    4                                     
027748,001052: 34,2652           65352                           SL1      PDDL                                  #  D6  UX UZ (1-COS A )                $ 4
027749,001053: 34,2653           01626                                    COF        +2                         
027750,001054: 34,2654           41405                           DMP      PUSH                                  #  D8  UY SIN(A)
027751,001055: 34,2655           00001                                    0                                     
027752,001056: 34,2656           62415                           DAD      SL2                                   
027753,001057: 34,2657           00007                                    6                                     
027754,001058: 34,2660           77604                           BOVB                                           
027755,001059: 34,2661           73501                                    SIGNMPAC                              
027756,001060: 34,2662           15564                           STODL    KEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)
027757,001061: 34,2663           62421                           BDSU     SL2                                   
027758,001062: 34,2664           77604                           BOVB                                           
027759,001063: 34,2665           73501                                    SIGNMPAC                              
027760,001064: 34,2666           15574                           STODL    KEL        +12D                       #  UX UZ (1-COS(A))-UY SIN(A)
027761,001065: 34,2667           01626                                    COF        +2                         
027762,001066: 34,2670           41205                           DMP      DMP                                   
027763,001067: 34,2671           01630                                    COF        +4                         
027764,001068: 34,2672           00005                                    4                                     
027765,001069: 34,2673           65352                           SL1      PDDL                                  #  D6  UY UZ (1-COS(A))                $ 4
027766,001070: 34,2674           01624                                    COF                                   
027767,001071: 34,2675           41405                           DMP      PUSH                                  #  D8  UX SIN(A)
027768,001072: 34,2676           00001                                    0                                     
027769,001073: 34,2677           62415                           DAD      SL2                                   
027770,001074: 34,2700           00007                                    6                                     
027771,001075: 34,2701           77604                           BOVB                                           
027772,001076: 34,2702           73501                                    SIGNMPAC                              
027773,001077: 34,2703           15576                           STODL    KEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
027774,001078: 34,2704           62421                           BDSU     SL2                                   
027775,001079: 34,2705           77604                           BOVB                                           
027776,001080: 34,2706           73501                                    SIGNMPAC                              
027777,001081: 34,2707           01572                           STORE    KEL        +10D                       #  UY UZ (1-COS(A)) -UX SIN(A)
027778,001082: 34,2710           77616                           RVQ                                            
027779,001083: 

Page 658

027781,001085:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
027782,001086:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
027783,001087:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
027784,001088:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
027785,001089: 
027786,001090:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS***
027787,001091: 
027788,001092:                                                                                                  #           C =COS(THETA)COS(PSI)
027789,001093:                                                                                                  #            0
027790,001094: 
027791,001095:                                                                                                  #           C =-COS(THETA)SIN(PSI)COS(PHI)+SI (THETA)SIN(PHI)
027792,001096:                                                                                                  #            1
027793,001097: 
027794,001098:                                                                                                  #           C =COS(THETA)SIN(PSI)SIN(PHI) + S N(THETA)COS(PHI)
027795,001099:                                                                                                  #            2
027796,001100: 
027797,001101:                                                                                                  #           C =SIN(PSI)
027798,001102:                                                                                                  #            3
027799,001103: 
027800,001104:                                                                                                  #           C =COS(PSI)COS(PHI)
027801,001105:                                                                                                  #            4
027802,001106: 
027803,001107:                                                                                                  #           C =-COS(PSI)SIN(PHI)
027804,001108:                                                                                                  #            5
027805,001109: 
027806,001110:                                                                                                  #           C =-SIN(THETA)COS(PSI)
027807,001111:                                                                                                  #            6
027808,001112: 
027809,001113:                                                                                                  #           C =SIN(THETA)SIN(PSI)COS(PHI)+COS THETA)SIN(PHI)
027810,001114:                                                                                                  #            7
027811,001115: 
027812,001116:                                                                                                  #           C =-SIN(THETA)SIN(PSI)SIN(PHI)+CO (THETA)COS(PHI)
027813,001117:                                                                                                  #            8
027814,001118: 
027815,001119:                                                                                                  #           WHERE PHI = OGA
027816,001120:                                                                                                  #                 THETA = IGA
027817,001121:                                                                                                  #                 PSI = MGA
027818,001122: 
027819,001123: 34,2711           67543        DCMTOCDU           DLOAD*   ARCSIN                                
027820,001124: 34,2712           00007                                    6,1                                   
027821,001125: 34,2713           71406                           PUSH     COS                                   #  PD +0   PSI
027822,001126: 34,2714           41152                           SL1      BOVB                                  
027823,001127: 34,2715           73501                                    SIGNMPAC                              
027824,001128: 34,2716           00051                           STORE    S1                                    
027825,001129: 34,2717           57543                           DLOAD*   DCOMP                                 
027826,001130: 34,2720           00015                                    12D,1                                 
027827,001131: 34,2721           67471                           DDV      ARCSIN                                
027828,001132: 34,2722           00051                                    S1                                    
027829,001133: 34,2723           51123                           PDDL*    BPL                                   #  PD +2  THETA
027830,001134: 34,2724           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
027831,001135: 34,2725           70737                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
027832,001136: 34,2726           57545                           DLOAD    DCOMP                                 
027833,001137: 34,2727           43244                           BPL      DAD                                   
027834,001138: 34,2730           70734                                    SUHALFA                               
027835,001139: 34,2731           30414                                    HALFA                                 
027836,001140: 34,2732           77650                           GOTO                                           
027837,001141: 34,2733           70736                                    CALCPHI                               
027838,001142: 34,2734           77625        SUHALFA            DSU                                            

Page 659

027840,001144: 34,2735           30414                                    HALFA                                 
027841,001145: 34,2736           77606        CALCPHI            PUSH                                           
027842,001146: 34,2737           57543        OKTHETA            DLOAD*   DCOMP                                 
027843,001147: 34,2740           00013                                    10D,1                                 
027844,001148: 34,2741           67471                           DDV      ARCSIN                                
027845,001149: 34,2742           00051                                    S1                                    
027846,001150: 34,2743           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI
027847,001151: 34,2744           00011                                    8D,1                                  
027848,001152: 34,2745           70757                                    OKPHI                                 
027849,001153: 34,2746           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
027850,001154: 34,2747           43244                           BPL      DAD                                   
027851,001155: 34,2750           70754                                    SUHALFAP                              
027852,001156: 34,2751           30414                                    HALFA                                 
027853,001157: 34,2752           77650                           GOTO                                           
027854,001158: 34,2753           70760                                    VECOFANG                              
027855,001159: 34,2754           52025        SUHALFAP           DSU      GOTO                                  
027856,001160: 34,2755           30414                                    HALFA                                 
027857,001161: 34,2756           70760                                    VECOFANG                              
027858,001162: 34,2757           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
027859,001163: 34,2760           43466        VECOFANG           VDEF     RVQ                                   
027860,001164: 

Page 660

027862,001166:                                                                                                  #  ROUTINES FOR TERMINATING THE AUTOMATIC MANEUVER AND RETURNING TO USER
027863,001167: 
027864,001168: 34,2761           77776        ENDMANU            EXIT                                           
027865,001169: 34,2762           37762                           CAF      TWO                                   
027866,001170: 34,2763           00004                           INHINT                                         
027867,001171: 34,2764           05663                           TC       WAITLIST                              #  PREPARE FOR A GOOD (NORMAL) RETURN VIA
027868,001172: 34,2765  E3,1535                                  EBANK=   MIS                                   
027869,001173: 34,2765           03710 70063                     2CADR    GOODMANU                              #  GOODEND
027870,001174: 
027871,001175: 34,2767           00003                           RELINT                                         
027872,001176: 34,2770           05567                           TC       ENDOFJOB                              
027873,001177: 
027874,001178: 34,2771           77776        TOOBAD             EXIT                                           #  INITIAL OR FINAL GIMBAL ANGLES IN
027875,001179: 34,2772           37762                           CAF      TWO                                   #  GIMBAL LOCK
027876,001180: 34,2773           00004                           INHINT                                         
027877,001181: 34,2774           05663                           TC       WAITLIST                              
027878,001182: 34,2775  E3,1535                                  EBANK=   MIS                                   
027879,001183: 34,2775           03001 70063                     2CADR    NOGO                                  #  PREPARE FOR A BAD RETURN VIA BADEND
027880,001184: 
027881,001185: 34,2777           00003                           RELINT                                         
027882,001186: 34,3000           05567                           TC       ENDOFJOB                              
027883,001187: 
027884,001188: 34,3001           06076        NOGO               TC       FLAG2DWN                              #  RESET BIT 11 OF FLAGWRD2 TO SIGNAL END
027885,001189: 34,3002           02000                           OCT      2000                                  #  OF KALCMANU
027886,001190: 34,3003           36311                           CAF      THREE                                 
027887,001191: 34,3004           05225                           TC       POSTJUMP                              #  RETURN UNDER WAITLIST VIA BADEND
027888,001192: 34,3005           26715                           CADR     BADEND                                #  AND WAKE UP USER

End of include-file ATTITUDE_MANEUVER_ROUTINE.agc.  Parent file is MAIN.agc