Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Peter McDermott. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: NEW PROGRAM SHEPATIN BY EYLES
	DEC 13, 1966

	THIS PROGRAM WAS ASSEMBLED AS A VERSION OF REVISION 37 
        OF PROGRAM SUNBURST BY LEM GROUP
Note that the date is the date of the printout, not the date of the program revision.

026449,000002:                                                                                                  ## Copyright:   Public domain.
026450,000003:                                                                                                  ## Filename:    ATTITUDE_MANEUVER_ROUTINE.agc
026451,000004:                                                                                                  ## Purpose:     A section of Sunburst revision 37, or Shepatin revision 0.
026452,000005:                                                                                                  ##              It is part of an early development version of the software
026453,000006:                                                                                                  ##              for Apollo Guidance Computer (AGC) on the unmanned Lunar
026454,000007:                                                                                                  ##              Module (LM) flight Apollo 5. Sunburst 37 was the program
026455,000008:                                                                                                  ##              upon which Don Eyles's offline development program Shepatin
026456,000009:                                                                                                  ##              was based; the listing herein transcribed was actually for
026457,000010:                                                                                                  ##              the equivalent revision 0 of Shepatin.
026458,000011:                                                                                                  ##              This file is intended to be a faithful transcription, except
026459,000012:                                                                                                  ##              that the code format has been changed to conform to the
026460,000013:                                                                                                  ##              requirements of the yaYUL assembler rather than the
026461,000014:                                                                                                  ##              original YUL assembler.
026462,000015:                                                                                                  ## Reference:   pp. 595-619
026463,000016:                                                                                                  ## Assembler:   yaYUL
026464,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
026465,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
026466,000019:                                                                                                  ## Mod history: 2017-05-24 MAS  Created from Sunburst 120.
026467,000020:                                                                                                  ##              2017-06-13 RSB  Transcribed.
026468,000021:                                                                                                  ##              2017-06-22 RSB  Proofed comment text with
026469,000022:                                                                                                  ##                              octopus/ProoferComments.
026470,000023: 

Page 595

026472,000025:                                                                                                  #  BLOCK 2 LGC ATTITUDE MANEUVER ROUTINE-KALCMANU
026473,000026: 
026474,000027: 
026475,000028: 
026476,000029:                                                                                                  #  MOD 1                          DATE  11/7/66       BY  DON KEENE
026477,000030:                                                                                                  #  PROGRAM DESCRIPTION
026478,000031: 
026479,000032:                                                                                                  #       KALCMANU IS A ROUTINE WHICH GENERATES COMMANDS FOR THE LM DAP TO CHANGE THE ATTITUDE OF THE SPACECRAFT
026480,000033:                                                                                                  #  DURING FREE FALL.  IT IS DESIGNED TO MANEUVER THE SPACECRAFT FROM ITS INITIAL ORIENTATION TO SOME DESIRED
026481,000034:                                                                                                  #  ORIENTATION SPECIFIED BY THE PROGRAM WHICH CALLS KALCMANU, AVOIDING GIMBAL LOCK IN THE PROCESS.  IN THE 
026482,000035:                                                                                                  #  MOD 1 VERSION, THIS DESIRED ATTITUDE CAN BE SPECIFIED IN ONE OF TWO WAYS
026483,000036: 
026484,000037:                                                                                                  #       A) BY A SET OF THREE COMMANDED CDU ANGLES
026485,000038: 
026486,000039:                                                                                                  #       B) BY A VECTOR IN STABLE MEMBER COORDINATES ALONG WHICH THE THRUST VECTOR (GIVEN IN SPACECRAFT
026487,000040:                                                                                                  #          COORDINATES IS TO BE ALIGNED.
026488,000041: 
026489,000042:                                                                                                  #       IF THE FIRST METHOD IS USED, THE THREE DESIRED CDU ANGLES MUST BE STORED AS 2:S COMPLEMENT SINGLE
026490,000043:                                                                                                  #  PRECISION ANGLES IN THE THREE CONSECUTIVE LOCATIONS, CPHI, CTHETA, CPSI, WHERE
026491,000044: 
026492,000045:                                                                                                  #       CPHI = COMMANDED OUTER GIMBAL ANGLE
026493,000046:                                                                                                  #       CTHETA = COMMANDED INNER GIMBAL ANGLE
026494,000047:                                                                                                  #       CPSI = COMMANDED MIDDLE GIMBAL ANGLE
026495,000048: 
026496,000049:                                                                                                  #  THE ENTRY POINT IN KALCMANU FOR THIS METHOD IS KALCMAN3 (SEE SECTION 4)
026497,000050: 
026498,000051:                                                                                                  #       THE SECOND METHOD MAY BE USED FOR POINTING THE THRUST AXIS OF THE SPACECRAFT.  IN THIS CASE THE AXIS TO
026499,000052:                                                                                                  #  BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
026500,000053:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS. THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
026501,000054:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
026502,000055: 
026503,000056:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF
026504,000057:                                                                                                  #  THIS VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.
026505,000058: 
026506,000059:                                                                                                  #                                                                             -
026507,000060:                                                                                                  #       KALCMANU DETERMINES THE DIRECTION OF THE SINGLE EQUIVALENT ROTATION (COF ALTERNATELY TERMED U) AND THE
026508,000061:                                                                                                  #  MAGNITUDE OF THE ROTATION (AM) TO BRING THE S/C FROM ITS INITIAL ORIENTATION TO ITS FINAL ORIENTATION.
026509,000062:                                                                                                  #  THIS DIRECTION REMAINS FIXED BOTH IN INERTIAL COORDINATES AND IN COMMANDED S/C AXES THROUGHOUT THE 
026510,000063:                                                                                                  #                   -
026511,000064:                                                                                                  #  MANEUVER.  ONCE COF AND AM HAVE BEEN DETERMINED, KALCMANU THEN EXAMINES THE MANEUVER TO SEE IF IT WILL BRING
026512,000065:                                                                                                  #                                        -
026513,000066:                                                                                                  #  THE S/C THROUGH GIMBAL LOCK.  IF SO, COF AND AM ARE READJUSTED SO THAT THE S/C WILL JUST SKIM THE GIMBAL
026514,000067:                                                                                                  #  LOCK ZONE AND ALIGN THE X-AXIS.  IN GENERAL A FINAL YAW  ABOUT X WILL BE NECESSARY TO COMPLETE THE MANEUVER.
026515,000068: 
026516,000069:                                                                                                  #  NEEDLESS TO SAY, NEITHER THE INITIAL NOR THE FINAL ORIENTATION CAN BE IN GIMBAL LOCK.
026517,000070: 
026518,000071:                                                                                                  #       FOR PROPER ATTITUDE CONTROL THE DIGITAL AUTOPILOT MUST BE GIVEN AN ATTITUDE REFERENCE WHICH IT CAN TRACK.
026519,000072:                                                                                                  #  KALCMANU DOES THIS BY GENERATING A REFERENCE OF DESIRED GIMBAL ANGLES (CDUXD, CDUYD, CDUZD) WHICH ARE UPDATED
026520,000073:                                                                                                  #  EVERY ONE SECOND DURING THE MANEUVER.  TO ACHIEVE A SMOOTHER SEQUENCE OF COMMANDS BETWEEN SUCCESSIVE UPDATES,
026521,000074:                                                                                                  #  THE PROGRAM ALSO GENERATES A SET OF INCREMENTAL CDU ANGLES (DELDCDU) TO BE ADDED TO CDU DESIRED BY THE DIGITAL
026522,000075:                                                                                                  #  AUTOPILOT.  KALCMANU ALSO CALCULATES THE COMPONENT MANEUVER RATES (OMEGAPD, OMEGAQD, OMEGARD), WHICH CAN
026523,000076:                                                                                                  #                                       -

Page 596

026525,000078:                                                                                                  #  BE DETERMINED SIMPLY BY MULTIPLYING COF BY SOME SCALAR (ARATE) CORRESPONDING TO THE DESIRED ROTATIONAL RATE.
026526,000079: 
026527,000080:                                                                                                  #       AUTOMATIC MANEUVERS ARE TIMED WITH THE HELP OF WAITLIST SO THAT AFTER A SPECIFIED INTERVAL THE Y AND Z
026528,000081:                                                                                                  #  DESIRED RATES ARE SET TO ZERO AND THE DESIRED CDU ANGLES (CDUYD, CDUZD) ARE SET EQUAL TO THE FINAL DESIRED CDU
026529,000082:                                                                                                  #  ANGLES (CTHETA, CPSI).  IF ANY YAW  REMAINS DUE TO GIMBAL LOCK AVOIDANCE, THE FINAL YAW  MANEUVER IS
026530,000083:                                                                                                  #  CALCULATED AND THE DESIRED YAW  RATE SET TO SOME FIXED VALUE (ROLLRATE = + OR - 2 DEGREES PER SEC).
026531,000084:                                                                                                  #  IN THIS CASE ONLY AN INCREMENTAL CDUX ANGLE (DELFROLL) IS SUPPLIED TO THE DAP.  AT THE END OF THE YAW
026532,000085:                                                                                                  #  MANEUVER OR IN THE EVENT THAT THERE WAS NO FINAL YAW,  CDUXD IS SET EQUAL TO CPHI AND THE X-AXIS DESIRED
026533,000086:                                                                                                  #  RATE SET TO ZERO.  THUS, UPON COMPLETION OF THE MANEUVER THE S/C WILL FINISH UP IN A LIMIT CYCLE ABOUT THE
026534,000087:                                                                                                  #  DESIRED FINAL GIMBAL ANGLES.
026535,000088: 
026536,000089: 
026537,000090: 
026538,000091:                                                                                                  #  PROGRAM LOGIC FLOW
026539,000092: 
026540,000093:                                                                                                  #       KALCMANU IS CALLED AS A HIGH PRIORITY JOB WITH ENTRY POINTS AT KALCMAN3 AND VECPOINT.  IT FIRST PICKS
026541,000094:                                                                                                  #  UP THE CURRENT CDU ANGLES TO BE USED AS THE BASIS FOR ALL COMPUTATIONS INVOLVING THE INITIAL S/C ORIENTATION.
026542,000095:                                                                                                  #  IT THEN DETERMINES THE DIRECTION COSINE MATRICES RELATING BOTH THE INITIAL AND FINAL S/C ORIENTATION TO STABLE
026543,000096:                                                                                                  #                *    *                                                                               *
026544,000097:                                                                                                  #  MEMBER AXES (MIS, MFS).  IT ALSO COMPUTES THE MATRIX RELATING FINAL S/C AXES TO INITIAL S/C AXES (MFI).  THE
026545,000098:                                                                                                  #  ANGLE OF ROTATION (AM) IS THEN EXTRACTED FROM THIS MATRIX, AND TESTS ARE MADE TO DETERMINE IF
026546,000099: 
026547,000100:                                                                                                  #       A)  AM LESS THAN .25 DEGREES (MINANG)
026548,000101:                                                                                                  #       B)  AM GREATER THAN 170 DEGREES (MAXANG)
026549,000102: 
026550,000103:                                                                                                  #       IF AM LESS THAN .25 DEGREES, NO COMPLICATED AUTOMATIC MANEUVERING IS NECESSARY.  THEREFORE WE CAN SIMPLY
026551,000104:                                                                                                  #  SET CDU DESIRED EQUAL TO THE FINAL CDU DESIRED ANGLES AND TERMINATE THE JOB.
026552,000105: 
026553,000106:                                                                                                  #       IF AM IS GREATER THAN .25 DEGREES BUT LESS THAN 170 DEGREES, THE AXES OF THE SINGLE EQUIVALENT ROTATION
026554,000107:                                                                                                  #    -                                                       *
026555,000108:                                                                                                  #  (COF) IS EXTRACTED FROM THE SKEW SYMMETRIC COMPONENTS OF MFI.                            *     *
026556,000109:                                                                                                  #       IF AM GREATER THAN 170 DEGREES AN ALTERNATE METHOD EMPLOYING THE SYMMETRIC PART OF MFI (MFISYM) IS USED
026557,000110:                                                                                                  #                -
026558,000111:                                                                                                  #  TO DETERMINE COF.
026559,000112: 
026560,000113:                                                                                                  #       THE PROGRAM THEN CHECKS TO SEE IF THE MANEUVER AS COMPUTED WILL BRING THE S/C THROUGH GIMBAL LOCK.  IF
026561,000114:                                                                                                  #  SO, A NEW MANEUVER IS CALCULATED WHICH WILL JUST SKIM THE GIMBAL LOCK ZONE AND ALIGN THE S/C X-AXIS.  THIS
026562,000115:                                                                                                  #  METHOD ASSURES THAT THE ADDITIONAL MANEUVERING TO AVOID GIMBAL LOCK WILL BE KEPT TO A MINIMUM.  SINCE A FINAL
026563,000116:                                                                                                  #  P AXIS YAW WILL BE NECESSARY, A SWITCH IS RESET (STATE SWITCH 31) TO ALLOW FOR THE COMPUTATION OF THIS FINAL
026564,000117:                                                                                                  #  YAW.
026565,000118: 
026566,000119:                                                                                                  #       AS STATED PREVIOUSLY KALCMANU GENERATES A SEQUENCE OF DESIRED GIMBAL ANGLES WHICH ARE UPDATED EVERY 
026567,000120:                                                                                                  #                                                                                               -
026568,000121:                                                                                                  #  SECOND.  THIS IS ACCOMPLISHED BY A SMALL ROTATION OF THE DESIRED S/C FRAME ABOUT THE VECTOR COF.  THE NEW
026569,000122:                                                                                                  #  DESIRED REFERENCE MATRIX IS THEN,
026570,000123: 
026571,000124:                                                                                                  #                   *              *         *
026572,000125:                                                                                                  #                  MIS       =    MIS       DEL
026573,000126: 
026574,000127:                                                                                                  #                     N+1            N

Page 597

026576,000129:                                                                                                  #         *
026577,000130:                                                                                                  #  WHERE DEL IS THE MATRIX CORRESPONDING TO THIS SMALL ROTATION.  THE NEW CDU ANGLES CAN THEN BE EXTRACTED
026578,000131:                                                                                                  #        *
026579,000132:                                                                                                  #  FROM MIS.
026580,000133: 
026581,000134:                                                                                                  #       AT THE BEGINNING OF THE MANEUVER THE AUTOPILOT DESIRED RATES (OMEGAPD, OMEGAQD, OMEGARD) AND THE 
026582,000135:                                                                                                  #  MANEUVER TIMINGS ARE ESTABLISHED.  ON THE FIRST PASS AND ON ALL SUBSEQUENT UPDATES THE CDU DESIRED
026583,000136:                                                                                                  #  ANGLES ARE LOADED WITH THE APPROPRIATE VALUES AND THE INCREMENTAL CDU ANGLES ARE COMPUTED.  THE AGC CLOCKS
026584,000137: 
026585,000138:                                                                                                  #  (TIME1 AND TIME2) ARE THAN CHECKED TO SEE IF THE MANEUVER WILL TERMINATE BEFORE THE NEXT UPDATE.  IF
026586,000139:                                                                                                  #  NOT, KALCMANU CALLS FOR ANOTHER UPDATE (RUN AS A JOB WITH PRIORITY TBD) IN ONE SECOND.  ANY DELAYS IN THIS
026587,000140:                                                                                                  #  CALLING SEQUENCE ARE AUTOMATICALLY COMPENSATED IN CALLING FOR THE NEXT UPDATE.
026588,000141: 
026589,000142:                                                                                                  #       IF IT IS FOUND THAT THE MANEUVER IS TO TERMINATE BEFORE THE NEXT UPDATE A ROUTINE IS CALLED (AS A WAIT-
026590,000143:                                                                                                  #  LIST TASK) TO STOP THE MANEUVER AT THE APPROPRIATE TIME AS EXPLAINED ABOVE.
026591,000144: 
026592,000145: 
026593,000146: 
026594,000147:                                                                                                  #  CALLING SEQUENCE
026595,000148: 
026596,000149:                                                                                                  #       THE ENTRY POINT IN KALCMANU FOR POINTING THE THRUST AXIS OF THE SPACECRAFT IS VECPOINT
026597,000150: 
026598,000151:                                                                                                  #       CAF        PRIO XX
026599,000152:                                                                                                  #                       --
026600,000153:                                                                                                  #       INHINT
026601,000154:                                                                                                  #       TC         FINDVAC
026602,000155:                                                                                                  #       2CADR      VECPOINT
026603,000156:                                                                                                  #       RELINT
026604,000157: 
026605,000158:                                                                                                  #       THE CALLING PROGRAM MUST ALSO SPECIFY THE DESIRED MANEUVERING RATES, PRESENTLY IN THE FORM OF A SINGLE
026606,000159:                                                                                                  #  PRECISION NUMBER (RATEINDEX), WHICH IS LOADED WITH ONE OF FOUR VALUES 0, 2, 4, OR 6, CORRESPONDING TO ANGULAR
026607,000160:                                                                                                  #  RATES OF .5, 2, 5, 10 DEGREES/SEC.  THERE IS ALSO A STATE SWITCH (33) WHICH MAY BE SET TO IGNORE ANY FINAL YAW
026608,000161: 
026609,000162:                                                                                                  #  INCURRED BY AVOIDING GIMBAL LOCK.
026610,000163: 
026611,000164:                                                                                                  #       WITH THIS INFORMATION KALCMANU WILL THEN GENERATE A SEQUENCE OF THREE CDU DESIRED ANGLES (CDUXD, CDUYD,
026612,000165:                                                                                                  #  CDUZD), AND THREE INCREMENTAL ANGLES (DELDCDU, DELDCDU1, DELDCDU2) AS WELL AS THE COMPONENT MANEUVER RATES
026613,000166:                                                                                                  #  (IN S/C AXES) TO BE USED BY THE LEM DAP IN PERFORMING THE AUTOMATIC MANEUVER.
026614,000167: 
026615,000168:                                                                                                  #       THERE ARE TWO WAYS IN WHICH KALCMANU MAY BE INITIATED CORRESPONDING TO THE TWO METHODS OF SPECIFYING THE
026616,000169:                                                                                                  #  DESIRED ATTITUDE OF THE SPACECRAFT.  IF METHOD 1 IS USED, THE COMMANDED GIMBAL ANGLES MUST BE PRECOMPUTED AND
026617,000170:                                                                                                  #  STORED IN LOCATIONS CPHI, CTHETA, CPSI.  THE USER:S PROGRAM MUST THEN CLEAR STATE SWITCH NO 33 TO ALLOW THE 
026618,000171:                                                                                                  #  ATTITUDE MANEUVER ROUTINE TO PERFORM ANY FINAL P-AXIS YAW INCURRED BY AVOIDING GIMBAL LOCK.  THE MANEUVER IS
026619,000172: 
026620,000173:                                                                                                  #  THEN INITIATED BY ESTABLISHING THE FOLLOWING EXECUTIVE JOB
026621,000174: 
026622,000175:                                                                                                  #                         *
026623,000176:                                                                                                  #       CAF     PRIO    XX
026624,000177:                                                                                                  #                       --
026625,000178:                                                                                                  #       INHINT
026626,000179:                                                                                                  #       TC         FINDVAC
026627,000180:                                                                                                  #       2CADR      KALCMAN3
026628,000181:                                                                                                  #       RELINT
026629,000182: 

Page 598

026631,000184:                                                                                                  #  THE USER:S PROGRAM MAY EITHER CONTINUE OR WAIT FOR THE TERMINATION OF THE MANEUVER.  IF THE USER WISHES TO
026632,000185:                                                                                                  #  WAIT, HE MAY PUT HIS JOB TO SLEEP WITH THE FOLLOWING INSTRUCTIONS
026633,000186: 
026634,000187:                                                                                                  #       L          TC        BANKCALL
026635,000188:                                                                                                  #       L+1        CADR      ATTSTALL
026636,000189:                                                                                                  #       L+2        (BAD      RETURN)
026637,000190:                                                                                                  #       L+3        (GOOD     RETURN)
026638,000191: 
026639,000192:                                                                                                  #       UPON COMPLETION OF THE MANEUVER, THE PROGRAM WILL BE AWAKENED AT L+3 IF THE MANEUVER WAS COMPLETED
026640,000193:                                                                                                  #  SUCCESSFULLY, OR AT L+2 IF THE MANEUVER WAS ABORTED.  THIS ABORT WOULD OCCUR IF THE INITIAL OR FINAL ATTITUDE
026641,000194:                                                                                                  #  WAS IN GIMBAL LOCK.
026642,000195:                                                                                                  #                                                                   -
026643,000196:                                                                                                  #       IF THE SECOND METHOD IS USED, THE DESIRED THRUST DIRECTION, V , MUST BE COMPUTED AND STORED IN THE SIX
026644,000197:                                                                                                  #                                                                    F
026645,000198:                                                                                                  #  ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS POINTVSM.  THE THRUST AXIS MUST BE LOADED INTO THE SIX ERASABLE
026646,000199:                                                                                                  #  LOCATIONS BEGINNING WITH SC AXIS.  THE CALLER MUST THEN CLEAR (OR SET) STATE SWITCH NO 33 AND SPECIFY THE
026647,000200:                                                                                                  #  DESIRED MANEUVERING RATE AS BEFORE.  THE MANEUVER IS THEN INITIATED BY THE EXECUTIVE CALL.
026648,000201: 
026649,000202: 
026650,000203: 
026651,000204:                                                                                                  #  SUBROUTINES
026652,000205: 
026653,000206:                                                                                                  #       KALCMANU USES A NUMBER OF INTERPRETIVE SUBROUTINES WHICH MAY BE OF GENERAL INTEREST.  SINCE THESE ROUTINES
026654,000207:                                                                                                  #  WERE PROGRAMMED EXCLUSIVELY FOR KALCMANU, THEY ARE NOT, AS YET, GENERALLY AVAILABLE FOR USE BY OTHER PROGRAMS.
026655,000208: 
026656,000209:                                                                                                  #       MXM3
026657,000210:                                                                                                  #       ----
026658,000211: 
026659,000212:                                                                                                  #       THIS SUBROUTINE MULTIPLIES TWO 3X3 MATRICES AND LEAVES THE RESULT IN THE FIRST 18 LOCATIONS OF THE PUSH
026660,000213:                                                                                                  #  DOWN LIST, I.E.,
026661,000214: 
026662,000215:                                                                                                  #                 (M    M    M )
026663,000216:                                                                                                  #                 ( 0    1    2)
026664,000217:                                                                                                  #        *        (            )       *         *
026665,000218:                                                                                                  #        M    =   (M    M    M )  =    M1   X    M2
026666,000219:                                                                                                  #                 ( 3    4    5)
026667,000220: 
026668,000221:                                                                                                  #                 (            )
026669,000222:                                                                                                  #                 (M    M    M )
026670,000223:                                                                                                  #                 ( 6    7    8)
026671,000224: 
026672,000225:                                                                                                  #                                                                                        *
026673,000226:                                                                                                  #       INDEX REGISTER X1 MUST BE LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M1, AND X2 MUST BE
026674,000227:                                                                                                  #                                                         *
026675,000228:                                                                                                  #  LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M2.   THE ROUTINE USES THE FIRST 20 LOCATIONS OF THE PUSH
026676,000229:                                                                                                  #  DOWN LIST.  THE FIRST ELEMENT OF THE MATRIX APPEARS IN PDO.  PUSH UP FOR M .
026677,000230:                                                                                                  #                                                                            8
026678,000231: 
026679,000232:                                                                                                  #       TRANSPOS
026680,000233:                                                                                                  #       --------

Page 599

026682,000235:                                                                                                  #       THIS ROUTINE TRANSPOSES A 3X3 MATRIX AND LEAVES THE RESULT IN THE PUSH DOWN LIST, I.E.,
026683,000236:                                                                                                  #  
026684,000237:                                                                                                  #        *         * T
026685,000238:                                                                                                  #        M    =    M1
026686,000239: 
026687,000240:                                                                                                  #  INDEX REGISTER X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M1.  PUSH UP FOR THE FIRST AND SUB-
026688,000241:                                                                                                  #                        *
026689,000242:                                                                                                  #  SEQUENT COMPONENTS OF M.   THIS SUBROUTINE ALSO USES THE FIRST 20 LOCATIONS OF THE PUSH DOWN LIST.
026690,000243: 
026691,000244:                                                                                                  #       CDU TO DCM
026692,000245:                                                                                                  #       ----------
026693,000246: 
026694,000247:                                                                                                  #       THIS SUBROUTINE CONVERTS THREE CDU ANGLES IN T(MPAC) TO A DIRECTION COSINE MATRIX (SCALED BY 2) RELATING
026695,000248:                                                                                                  #  THE CORRESPONDING S/C ORIENTATIONS TO THE STABLE MEMBER FRAME.  THE FORMULAS FOR THIS CONVERSION ARE
026696,000249: 
026697,000250:                                                                                                  #        M    =    COSY  COSZ
026698,000251:                                                                                                  #         0
026699,000252: 
026700,000253:                                                                                                  #        M    =    -COSY  SINZ  COSX  +  SINY  SINX
026701,000254:                                                                                                  #         1
026702,000255: 
026703,000256:                                                                                                  #        M    =    COSY  SINZ  SINX  +  SINY  COSX
026704,000257:                                                                                                  #         2
026705,000258: 
026706,000259:                                                                                                  #        M    =    SINZ
026707,000260:                                                                                                  #         3
026708,000261: 
026709,000262:                                                                                                  #        M    =    COSZ  COSX
026710,000263:                                                                                                  #         4
026711,000264: 
026712,000265:                                                                                                  #        M    =    -COSZ  SINX
026713,000266:                                                                                                  #         5
026714,000267: 
026715,000268:                                                                                                  #        M    =    -SINY  COSZ
026716,000269:                                                                                                  #         6
026717,000270: 
026718,000271:                                                                                                  #        M    =    SINY  SINZ  COSX  +  COSY  SINX
026719,000272:                                                                                                  #         7
026720,000273: 
026721,000274:                                                                                                  #        M    =    -SINY  SINZ  SINX  +  COSY  COSX
026722,000275:                                                                                                  #         8
026723,000276: 
026724,000277:                                                                                                  #  WHERE      X    =    OUTER GIMBAL ANGLE
026725,000278:                                                                                                  #             Y    =    INNER GIMBAL ANGLE
026726,000279:                                                                                                  #             Z    =    MIDDLE GIMBAL ANGLE
026727,000280: 
026728,000281:                                                                                                  #       THE INTERPRETATION OF THIS MATRIX IS AS FOLLOWS
026729,000282: 
026730,000283:                                                                                                  #       IF A , A , A  REPRESENT THE COMPONENTS OF A VECTOR IN S/C AXES THEN THE COMPONENTS OF THE SAME VECTOR IN
026731,000284:                                                                                                  #           X   Y   Z

Page 600

026733,000286:                                                                                                  #  STABLE MEMBER AXES (B , B , B ) ARE
026734,000287:                                                                                                  #                       X   Y   Z
026735,000288: 
026736,000289:                                                                                                  #             (B )                (A )
026737,000290:                                                                                                  #             ( X)                ( X)
026738,000291:                                                                                                  #             (  )                (  )
026739,000292:                                                                                                  #             (  )           *    (  )
026740,000293:                                                                                                  #             (B )      =    M    (A )
026741,000294:                                                                                                  #             ( Y)                ( Y)
026742,000295:                                                                                                  #             (  )                (  )
026743,000296:                                                                                                  #             (B )                (A )
026744,000297:                                                                                                  #             ( Z)                ( Z)
026745,000298: 
026746,000299:                                                                                                  #      THE SUBROUTINE WILL STORE THIS MATRIX IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY AS SPECIFIED BY THE CALLING
026747,000300:                                                                                                  #                                                                                                              *
026748,000301:                                                                                                  #  PROGRAM.  TO DO THIS THE CALLING PROGRAM MUST FIRST LOAD X2 WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M.
026749,000302: 
026750,000303:                                                                                                  #       INTERNALLY, THE ROUTINE USES THE FIRST 16 LOCATIONS OF THE PUSH DOWN LIST, ALSO STEP REGISTER S1 AND INDEX
026751,000304:                                                                                                  #  REGISTER X2.
026752,000305: 
026753,000306: 
026754,000307: 
026755,000308:                                                                                                  #       DCM TO CDU
026756,000309:                                                                                                  #       ----------
026757,000310:                                                                                                  #                                                                            *
026758,000311: 
026759,000312:                                                                                                  #       THIS ROUTINE EXTRACTS THE CDU ANGLES FROM A DIRECTION COSINE MATRIX (M SCALED BY 2) RELATING S/C AXIS TO
026760,000313:                                                                                                  #                                                                                  *
026761,000314:                                                                                                  #  STABLE MEMBER AXES.  X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M.  THE SUBROUTINE LEAVES THE
026762,000315:                                                                                                  #  CORRESPONDING GIMBAL ANGLES IN V(MPAC) AS DOUBLE PRECISION 1:S COMPLEMENT ANGLES SCALED BY 2PI.  THE FORMULAS
026763,000316:                                                                                                  #  FOR THIS CONVERSION ARE
026764,000317: 
026765,000318:                                                                                                  #        Z    =    ARCSIN (M  )
026766,000319:                                                                                                  #                            3
026767,000320: 
026768,000321:                                                                                                  #        Y    =    ARCSIN (-M /COSZ)
026769,000322:                                                                                                  #                            6
026770,000323: 
026771,000324:                                                                                                  #  IF M  IS NEGATIVE, Y IS REPLACED BY PI SGN Y - Y
026772,000325:                                                                                                  #      0
026773,000326: 
026774,000327:                                                                                                  #        X    =    ARCSIN (-M /COSZ)
026775,000328:                                                                                                  #                            5
026776,000329: 
026777,000330:                                                                                                  #  IF M  IS NEGATIVE X IS REPLACED BY PI SGN X - X
026778,000331:                                                                                                  #      4
026779,000332: 
026780,000333:                                                                                                  #       THIS ROUTINE DOES NOT SET THE PUSH DOWN POINTER, BUT USES THE NEXT 8 LOCATIONS OF THE PUSH DOWN LIST AND
026781,000334:                                                                                                  #  RETURNS THE POINTER TO ITS ORIGINAL SETTING.  THIS PROCEDURE ALLOWS THE CALLER TO STORE THE MATRIX AT THE TOP OF
026782,000335: 
026783,000336:                                                                                                  #  THE PUSH DOWN LIST.
026784,000337: 

Page 601

026786,000339:                                                                                                  #       DELCOMP
026787,000340:                                                                                                  #       -------
026788,000341: 
026789,000342:                                                                                                  #                                                           *
026790,000343:                                                                                                  #       THIS ROUTINE COMPUTES THE DIRECTION COSINE MATRIX (DEL) RELATING ON
026791,000344:                                                                                                  #                                                                           -
026792,000345:                                                                                                  #  IS ROTATED WITH RESPECT TO THE FIRST BY AN ANGLE, A, ABOUT A UNIT VECTOR, U.  THE FORMULA FOR THIS MATRIX IS
026793,000346: 
026794,000347:                                                                                                  #        *         *           --T           *
026795,000348:                                                                                                  #        DEL  =    I  COSA  +  UU (1-COSA) + V SINA
026796,000349:                                                                                                  #                                             X
026797,000350: 
026798,000351:                                                                                                  #  WHERE      *         (1   0    0)
026799,000352:                                                                                                  #             I    =    (0   1    0)
026800,000353:                                                                                                  #                       (0   0    1)
026801,000354: 
026802,000355: 
026803,000356:                                                                                                  #                          2                              
026804,000357:                                                                                                  #                       (U        U U       U U )
026805,000358:                                                                                                  #                       ( X        X Y       X Z)
026806,000359:                                                                                                  #                       (                       )
026807,000360:                                                                                                  #             --T       (           2           )
026808,000361:                                                                                                  #             UU   =    (U U      U         U U )
026809,000362:                                                                                                  #                       ( Y X      Y         Y Z)
026810,000363:                                                                                                  #                       (                       )
026811,000364:                                                                                                  #                       (                     2 )
026812,000365:                                                                                                  #                       (U U      U U       U  )
026813,000366:                                                                                                  #                       ( Z X      Z Y       Z  )
026814,000367: 
026815,000368: 
026816,000369:                                                                                                  #                       (0        -U        U  )
026817,000370: 
026818,000371:                                                                                                  #                       (           Z        Y )
026819,000372:                                                                                                  #             *         (                      )
026820,000373:                                                                                                  #             V    =    (U        0         -U )
026821,000374:                                                                                                  #              X        ( Z                   X)
026822,000375:                                                                                                  #                       (                      )
026823,000376:                                                                                                  #                       (-U       U         0  )
026824,000377:                                                                                                  #                       (  Y       X           )
026825,000378: 
026826,000379:                                                                                                  #             -
026827,000380:                                                                                                  #             U    =    UNIT ROTATION VECTOR RESOLVED INTO S/C AXES
026828,000381:                                                                                                  #             A    =    ROTATION ANGLE
026829,000382: 
026830,000383:                                                                                                  #                              *
026831,000384:                                                                                                  #       THE INTERPRETATION OF DEL IS AS FOLLOWS
026832,000385: 
026833,000386:                                                                                                  #       IF A , A , A  REPRESENT THE COMPONENT OF A VECTOR IN THE ROTATED FRAME, THEN THE COMPONENTS OF THE SAME
026834,000387:                                                                                                  #           X   Y   Z
026835,000388:                                                                                                  #  VECTOR IN THE ORIGINAL S/C AXES (B , B , B ) ARE
026836,000389:                                                                                                  #                                    X   Y   Z

Page 602

026838,000391:                                                                                                  #             (B )                     (A )
026839,000392:                                                                                                  #             ( X)                     ( X)
026840,000393:                                                                                                  #             (  )            *        (  )
026841,000394:                                                                                                  #             (B )      =    DEL       (A )
026842,000395:                                                                                                  #             ( Y)                     ( Y)
026843,000396:                                                                                                  #             (  )                     (  )
026844,000397:                                                                                                  #             (B )                     (A )
026845,000398:                                                                                                  #             ( Z)                     ( Z)
026846,000399: 
026847,000400:                                                                                                  #       THE ROUTINE WILL STORE THIS MATRIX (SCALED UNITY) IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY BEGINNING WITH
026848,000401:                                                                                                  #                                                                                              -
026849,000402:                                                                                                  #  THE LOCATION CALLED DEL.  IN ORDER TO USE THE ROUTINE, THE CALLING PROGRAM MUST FIRST STORE U (A HALF UNIT
026850,000403:                                                                                                  #  DOUBLE PRECISION VECTOR) IN THE SET OF ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS CALLED COF.  THE ANGLE, A,
026851,000404:                                                                                                  #  MUST THEN BE LOADED INTO D(MPAC).
026852,000405:                                                                                                  #  
026853,000406:                                                                                                  #       INTERNALLY, THE PROGRAM ALSO USES THE FIRST 10 LOCATIONS OF THE PUSH DOWN LIST.
026854,000407: 
026855,000408: 
026856,000409: 
026857,000410:                                                                                                  #       READCDUK
026858,000411:                                                                                                  #       --------
026859,000412: 
026860,000413:                                                                                                  #       THIS BASIC LANGUAGE SUBROUTINE LOADS T(MPAC) WITH THE THREE CDU ANGLES.
026861,000414: 
026862,000415: 
026863,000416: 
026864,000417:                                                                                                  #      SIGNMPAC
026865,000418:                                                                                                  #       --------
026866,000419: 
026867,000420:                                                                                                  #       THIS IS A BASIC LANGUAGE SUBROUTINE WHICH LIMITS THE MAGNITUDE OF D(MPAC) TO + OR - DPOSMAX ON OVERFLOW.
026868,000421: 
026869,000422: 
026870,000423: 
026871,000424:                                                                                                  #       PROGRAM STORAGE ALLOCATION
026872,000425: 
026873,000426:                                                                                                  #             1)   FIXED MEMORY                       1059 WORDS
026874,000427:                                                                                                  #             2)   ERASABLE MEMORY                      98
026875,000428: 
026876,000429:                                                                                                  #             3)   STATE SWITCHES                        3
026877,000430:                                                                                                  #             4)   FLAGS                                 1
026878,000431: 
026879,000432: 
026880,000433: 
026881,000434:                                                                                                  #       JOB PRIORITIES
026882,000435: 
026883,000436:                                                                                                  #             1)   KALCMANU                            TBD
026884,000437:                                                                                                  #             2)   ONE SECOND UPDATE                   TBD
026885,000438: 
026886,000439: 
026887,000440: 
026888,000441: 
026889,000442:                                                                                                  #       SUMMARY OF STATE SWITCHES AND FLAGWORDS USED BY KALCMANU.

Page 603

026891,000444:                                                                                                  #  STATE                FLAGWRD 2      SETTING             MEANING
026892,000445:                                                                                                  #  SWITCH NO.            BIT NO.
026893,000446: 
026894,000447:                                                                                                  #    *
026895,000448:                                                                                                  #  31                      14            0       MANEUVER WENT THROUGH GIMBAL LOCK
026896,000449:                                                                                                  #                                        1       MANEUVER DID NOT GO THROUGH GIMBAL LOCK
026897,000450: 
026898,000451:                                                                                                  #    *
026899,000452:                                                                                                  #  32                      13            0       CONTINUE UPDATE PROCESS
026900,000453:                                                                                                  #                                        1       START UPDATE PROCESS
026901,000454: 
026902,000455:                                                                                                  #  33                      12            0       PERFORM FINAL P-AXIS YAW IF REQUIRED
026903,000456:                                                                                                  #                                        1       IGNORE ANY FINAL P-AXIS YAW
026904,000457: 
026905,000458:                                                                                                  #  34                      11            0       SIGNAL END OF KALCMANU
026906,000459:                                                                                                  #                                        1       KALCMANU IN PROCESS       USER MUST SET SWITCH BEFORE INITIATING
026907,000460: 
026908,000461: 
026909,000462:                                                                                                  #          *  INTERNAL TO KALCMANU
026910,000463: 
026911,000464: 
026912,000465: 
026913,000466:                                                                                                  #       SUGGESTIONS FOR PROGRAM INTEGRATION
026914,000467: 
026915,000468:                                                                                                  #       THE FOLLOWING VARIABLES SHOULD BE ASSIGNED TO UNSWITCH ERASABLE
026916,000469: 
026917,000470:                                                                                                  #                       CPHI
026918,000471:                                                                                                  #                       CTHETA
026919,000472:                                                                                                  #                       CPSI
026920,000473:                                                                                                  #                       POINTVSM  +5
026921,000474:                                                                                                  #                       SCAXIS    +5
026922,000475:                                                                                                  #                       DELDCDU
026923,000476:                                                                                                  #                       DELDCDU1
026924,000477:                                                                                                  #                       DELDCDU2
026925,000478:                                                                                                  #                       RATEINDX
026926,000479: 
026927,000480:                                                                                                  #       THE FOLLOWING SUBROUTINES MAY BE PUT IN A DIFFERENT BANK
026928,000481: 
026929,000482:                                                                                                  #                       MXM3
026930,000483:                                                                                                  #                       TRANSPOS
026931,000484:                                                                                                  #                       SIGNMPAC
026932,000485:                                                                                                  #                       READCDUK
026933,000486:                                                                                                  #                       CDUTODCM
026934,000487: 

Page 604

026936,000489: 34,2000                                           BANK     34                                    
026937,000490: 34,2000  E3,1535                                  EBANK=   MIS                                   
026938,000491: 
026939,000492: 34,2000           12001                           NOOP                                           
026940,000493: 34,2001           06103        VECPOINT           TC       INTPRET                               
026941,000494: 34,2002           77634                           RTB                                            
026942,000495: 34,2003           70457                                    READCDUK                              #  READ THE PRESENT CDU ANGLES
026943,000496: 34,2004           01533                           STORE    BCDU                                  
026944,000497: 34,2005           45164                           AXC,2    CALL                                  #  COMPUTE THE TRANSFORMATION FROM INITIAL
026945,000498: 34,2006           01535                                    MIS                                   #  S/C AXES TO STABLE MEMBER AXES (MIS)
026946,000499: 34,2007           70464                                    CDUTODCM                              
026947,000500: 34,2010           61375                           VLOAD    VXM                                   #                                 -
026948,000501: 34,2011           01656                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VS INTO
026949,000502: 34,2012           01536                                    MIS                                   #  INITIAL S/C AXES
026950,000503: 34,2013           41456                           UNIT     PUSH                                  
026951,000504: 34,2014           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
026952,000505: 34,2015           01664                                    SCAXIS                                #  WHERE VI = SCAXIS
026953,000506: 34,2016           57400                           BOV      VCOMP                                 
026954,000507: 34,2017           70042                                    PICKAXIS                              
026955,000508: 34,2020           25624                           STOVL    COF                                   
026956,000509: 34,2021           01664                                    SCAXIS                                
026957,000510: 34,2022           72441                           DOT      SL1                                   
026958,000511: 34,2023           77726                           ARCCOS                                         
026959,000512: 34,2024           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
026960,000513: 34,2025           70603                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES = MFI
026961,000514: 34,2026           75160                           AXC,1    AXC,2                                 #  COMPUTE THE TRANSFORMATION FROM FINAL
026962,000515: 
026963,000516: 34,2027           01535                                    MIS                                   #  S/C AXES TO STABLE MEMBER AXES
026964,000517: 34,2030           01557                                    KEL                                   
026965,000518: 34,2031           77624                           CALL                                           
026966,000519: 34,2032           73442                                    MXM3                                  #  MFS IN PD LIST
026967,000520: 34,2033           45160                           AXC,1    CALL                                  
026968,000521: 34,2034           00000                                    0                                     #  EXTRACT THE CDU ANGLES FROM THIS MATRIX
026969,000522: 34,2035           70727                                    DCMTOCDU                              
026970,000523: 34,2036           77634                           RTB                                            
026971,000524: 34,2037           33573                                    V1STO2S                               #  AND USE THEM AS THE COMMANDED CDU ANGLES
026972,000525: 34,2040           35632                           STCALL   CPHI                                  
026973,000526: 34,2041           70070                                    KALCMAN3   +1                         #  PROCEED AS IF WE HAD BEEN GIVEN COMMAND
026974,000527:                                                                                                  #  CDU ANGLES
026975,000528: 34,2042           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0. PUSH UP FOR VF
026976,000529: 34,2043           01664                                    SCAXIS                                #  FIND VF . VI
026977,000530: 34,2044           72240                           BMN      TLOAD                                 #  IF ANTIPARALLEL
026978,000531: 34,2045           70051                                    ROT180                                
026979,000532: 34,2046           01533                                    BCDU                                  
026980,000533: 34,2047           35632                           STCALL   CPHI                                  #  IF VF = VI
026981,000534: 34,2050           70070                                    KALCMAN3   +1                         
026982,000535: 
026983,000536: 34,2051           47375        ROT180             VLOAD    VXV                                   #  180 DEG ROTATION IS REQUIRED
026984,000537: 34,2052           01544                                    MIS        +6                         #  Y STABLE MEMBER AXIS IN INITIAL S/C AXES
026985,000538: 34,2053           30414                                    HALFA                                 
026986,000539: 
026987,000540: 34,2054           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
026988,000541: 34,2055           01664                                    SCAXIS                                #  FIND UNIT (VI X UNIT(Y(SM) X X(I)))

Page 605

026990,000543: 34,2056           40056                           UNIT     BOV                                   #  PICK A VECTOR PERPENDICULAR TO VI IN THE
026991,000544: 34,2057           70064                                    PICKX                                 #  PLANE CONTAINING Y(SM) AND X(I) SO THAT
026992,000545: 34,2060           15624        XROT               STODL    COF                                   #  MANEUVER DOES NOT GO THRU GIMBAL LOCK
026993,000546: 34,2061           30414                                    HALFA                                 
026994,000547: 34,2062           77650                           GOTO                                           
026995,000548: 34,2063           70024                                    COMPMATX                              
026996,000549: 34,2064           52175        PICKX              VLOAD    GOTO                                  #  PICK THE X AXIS IN THIS CASE
026997,000550: 34,2065           30414                                    HALFA                                 
026998,000551: 
026999,000552: 34,2066           70060                                    XROT                                  
027000,000553: 
027001,000554:                                                                                                  #  FIRST ENTRY POINT- KALCMAN3
027002,000555: 
027003,000556:                                                                                                  #  THE THREE DESIRED CDU ANGLES MUST BE STORED AS SINGLE PRECISION TWOS COMPLEMENT ANGLES IN THE THREE SUCCESSIVE
027004,000557:                                                                                                  #  LOCATIONS, CPHI, CTHETA, CPSI.
027005,000558: 
027006,000559: 34,2067           06103        KALCMAN3           TC       INTPRET                               #  PICK UP THE CURRENT CDU ANGLES AND
027007,000560: 34,2070           77634                           RTB                                            #    COMPUTE THE MATRIX FROM INITIAL S/C
027008,000561: 34,2071           70457                                    READCDUK                              #    AXES TO FINAL S/C AXES
027009,000562: 34,2072           01533                           STORE    BCDU                                  #  STORE INITIAL S/C ANGLES
027010,000563: 34,2073           51535                           SLOAD    ABS                                   
027011,000564: 34,2074           01535                                    BCDU       +2                         #  CHECK MAGNITUDE OF MIDDLE GIMBAL ANGLE
027012,000565: 34,2075           51025                           DSU      BPL                                   
027013,000566: 34,2076           30444                                    LOCKANGL                              #  IF GREATER THAN 60 DEG, ABORT MANEUVER
027014,000567: 34,2077           71007                                    TOOBAD                                
027015,000568: 34,2100           72364                           AXC,2    TLOAD                                 
027016,000569: 34,2101           01535                                    MIS                                   
027017,000570: 34,2102           01533                                    BCDU                                  
027018,000571: 34,2103           77624                           CALL                                           #  COMPUTE THE TRANSFORMATION FROM INITIAL
027019,000572: 34,2104           70464                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES
027020,000573: 34,2105           51535                           SLOAD    ABS                                   #  CHECK THE MAGNITUDE OF THE DESIRED
027021,000574: 34,2106           01634                                    CPSI                                  #  MIDDLE GIMBAL ANGLE
027022,000575: 
027023,000576: 34,2107           51025                           DSU      BPL                                   
027024,000577: 34,2110           30444                                    LOCKANGL                              #  IF GREATER THAN 60 DEG, ABORT MANEUVER
027025,000578: 34,2111           71007                                    TOOBAD                                
027026,000579: 34,2112           72364                           AXC,2    TLOAD                                 
027027,000580: 34,2113           01557                                    MFS                                   #  PREPARE TO CALCULATE ARRAY MFS
027028,000581: 34,2114           01632                                    CPHI                                  
027029,000582: 34,2115           77624                           CALL                                           
027030,000583: 34,2116           70464                                    CDUTODCM                              
027031,000584: 34,2117           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED        $2
027032,000585: 34,2120           01535                                    MIS                                   
027033,000586: 34,2121           73472                                    TRANSPOS                              
027034,000587: 34,2122           77775                           VLOAD                                          
027035,000588: 34,2123           77626                           STADR                                          
027036,000589: 34,2124           52161                           STOVL    TMIS       +12D                       
027037,000590: 34,2125           77626                           STADR                                          
027038,000591: 34,2126           52167                           STOVL    TMIS       +6                         
027039,000592: 34,2127           77626                           STADR                                          
027040,000593: 34,2130           76175                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
027041,000594: 34,2131           75160                           AXC,1    AXC,2                                 

Page 606

027043,000596: 34,2132           01601                                    TMIS                                  
027044,000597: 34,2133           01557                                    MFS                                   
027045,000598: 34,2134           77624                           CALL                                           
027046,000599: 34,2135           73442                                    MXM3                                  
027047,000600: 34,2136           45575                           VLOAD    STADR                                 
027048,000601: 34,2137           52203                           STOVL    MFI        +12D                       
027049,000602: 34,2140           77626                           STADR                                          
027050,000603: 34,2141           52211                           STOVL    MFI        +6                         
027051,000604: 34,2142           77626                           STADR                                          
027052,000605: 34,2143           76217                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
027053,000606: 34,2144           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST
027054,000607: 34,2145           00023                                    18D                                   
027055,000608: 34,2146           73501                                    TRNSPSPD                              
027056,000609: 34,2147           45575                           VLOAD    STADR                                 
027057,000610: 
027058,000611: 34,2150           52161                           STOVL    TMFI       +12D                       
027059,000612: 34,2151           77626                           STADR                                          
027060,000613: 34,2152           52167                           STOVL    TMFI       +6                         
027061,000614: 34,2153           77626                           STADR                                          
027062,000615: 34,2154           76175                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI)  SCALED BY 4
027063,000616: 
027064,000617:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
027065,000618: 
027066,000619: 34,2155           45345                           DLOAD    DSU                                   
027067,000620: 34,2156           01604                                    TMFI       +2                         
027068,000621: 34,2157           01562                                    MFI        +2                         
027069,000622: 34,2160           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
027070,000623: 34,2161           01564                                    MFI        +4                         
027071,000624: 34,2162           01606                                    TMFI       +4                         
027072,000625: 34,2163           45325                           PDDL     DSU                                   
027073,000626: 34,2164           01614                                    TMFI       +10D                       
027074,000627: 34,2165           01572                                    MFI        +10D                       
027075,000628: 34,2166           77666                           VDEF                                           
027076,000629: 34,2167           01635                           STORE    COFSKEW                               #  EQUALS MFISKEW
027077,000630: 
027078,000631:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
027079,000632: 
027080,000633: 34,2170           43345                           DLOAD    DAD                                   
027081,000634: 
027082,000635: 34,2171           01560                                    MFI                                   
027083,000636: 34,2172           01600                                    MFI        +16D                       
027084,000637: 34,2173           43225                           DSU      DAD                                   
027085,000638: 34,2174           30426                                    QUARTA                                
027086,000639: 34,2175           01570                                    MFI        +8D                        
027087,000640: 34,2176           01645                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
027088,000641: 34,2177           77726                           ARCCOS                                         
027089,000642: 34,2200           01643                           STORE    AM                                    #  AM=ARCCOS(CAM)  (AM SCALED BY 2)
027090,000643: 34,2201           51025                           DSU      BPL                                   
027091,000644: 34,2202           30410                                    MINANG                                
027092,000645: 34,2203           70214                                    CHECKMAX                              
027093,000646: 34,2204           77751                           TLOAD                                          #  MANEUVER LESS THAN .25 DEGREES
027094,000647: 34,2205           01632                                    CPHI                                  #  GO DIRECTLY INTO ATTITUDE HOLD

Page 607

027096,000649: 34,2206           00767                           STORE    CDUXD                                 #  ABOUT COMMANDED ANGLES
027097,000650: 34,2207           77751                           TLOAD                                          
027098,000651: 34,2210           30416                                    NIL                                   
027099,000652: 34,2211           00775                           STORE    OMEGAPD                               #  ZERO DESIRED RATES
027100,000653: 34,2212           34772                           STCALL   DELDCDU                               #  PREPARE TO END MANEUVER ON GOOD RETURN
027101,000654: 34,2213           70777                                    ENDMANU                               
027102,000655: 34,2214           45345        CHECKMAX           DLOAD    DSU                                   
027103,000656: 34,2215           01643                                    AM                                    
027104,000657: 34,2216           30412                                    MAXANG                                
027105,000658: 34,2217           77244                           BPL      VLOAD                                 
027106,000659: 34,2220           70226                                    ALTCALC                               #  UNIT
027107,000660: 34,2221           01635                                    COFSKEW                               #  COFSKEW
027108,000661: 34,2222           77656                           UNIT                                           
027109,000662: 34,2223           01624                           STORE    COF                                   #  COF IS THE MANEUVER AXIS
027110,000663: 34,2224           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
027111,000664: 34,2225           71024                                    LOCSKIRT                              
027112,000665: 34,2226           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
027113,000666: 34,2227           01560                                    MFI                                   
027114,000667: 34,2230           01602                                    TMFI                                  
027115,000668: 34,2231           77762                           VSR1                                           
027116,000669: 34,2232           25602                           STOVL    MFISYM                                
027117,000670: 34,2233           01566                                    MFI        +6                         
027118,000671: 34,2234           74455                           VAD      VSR1                                  
027119,000672: 34,2235           01610                                    TMFI       +6                         
027120,000673: 34,2236           25610                           STOVL    MFISYM     +6                         
027121,000674: 34,2237           01574                                    MFI        +12D                       
027122,000675: 34,2240           74455                           VAD      VSR1                                  
027123,000676: 34,2241           01616                                    TMFI       +12D                       
027124,000677: 34,2242           01616                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
027125,000678: 
027126,000679:                                                                                                  #  CALCULATE COF
027127,000680: 
027128,000681: 34,2243           70545                           DLOAD    SR1                                   
027129,000682: 34,2244           01645                                    CAM                                   
027130,000683: 34,2245           45325                           PDDL     DSU                                   #  PDO CAM                               $4
027131,000684: 34,2246           30414                                    HALFA                                 
027132,000685: 34,2247           01645                                    CAM                                   
027133,000686: 34,2250           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                           $2
027134,000687: 34,2251           70445                                    SIGNMPAC                              
027135,000688: 34,2252           01622                                    MFISYM     +16D                       
027136,000689: 34,2253           56225                           DSU      DDV                                   
027137,000690: 
027138,000691: 34,2254           00001                                    0                                     
027139,000692: 34,2255           00003                                    2                                     
027140,000693: 34,2256           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
027141,000694: 34,2257           01612                                    MFISYM     +8D                        #                                $ ROOT 2
027142,000695: 34,2260           56225                           DSU      DDV                                   
027143,000696: 34,2261           00001                                    0                                     
027144,000697: 34,2262           00003                                    2                                     
027145,000698: 34,2263           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM)  $ROOT2

Page 608

027147,000700: 34,2264           01602                                    MFISYM                                
027148,000701: 34,2265           56225                           DSU      DDV                                   
027149,000702: 
027150,000703: 34,2266           00001                                    0                                     
027151,000704: 34,2267           00003                                    2                                     
027152,000705: 34,2270           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM)  $ROOT 2
027153,000706: 34,2271           77656                           UNIT                                           
027154,000707: 34,2272           01624                           STORE    COF                                   
027155,000708: 
027156,000709:                                                                                                  #  DETERMINE  LARGEST COF AND ADJUST ACCORDINGLY
027157,000710: 
027158,000711: 34,2273           45345        COFMAXGO           DLOAD    DSU                                   
027159,000712: 34,2274           01624                                    COF                                   
027160,000713: 34,2275           01626                                    COF        +2                         
027161,000714: 34,2276           71240                           BMN      DLOAD                                 #  COFY G COFX
027162,000715: 34,2277           70306                                    COMP12                                
027163,000716: 34,2300           01624                                    COF                                   
027164,000717: 34,2301           50025                           DSU      BMN                                   
027165,000718: 34,2302           01630                                    COF        +4                         
027166,000719: 34,2303           70363                                    METHOD3                               #  COFZ G COFX OR COFY
027167,000720: 34,2304           77650                           GOTO                                           
027168,000721: 34,2305           70337                                    METHOD1                               #  COFX G COFY OR COFZ
027169,000722: 34,2306           45345        COMP12             DLOAD    DSU                                   
027170,000723: 34,2307           01626                                    COF        +2                         
027171,000724: 34,2310           01630                                    COF        +4                         
027172,000725: 34,2311           77640                           BMN                                            
027173,000726: 34,2312           70363                                    METHOD3                               #  COFZ G COFY OR COFX
027174,000727: 
027175,000728: 34,2313           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
027176,000729: 34,2314           01637                                    COFSKEW    +2                         #  UY
027177,000730: 34,2315           70321                                    U2POS                                 
027178,000731: 34,2316           57575                           VLOAD    VCOMP                                 
027179,000732: 34,2317           01624                                    COF                                   
027180,000733: 34,2320           01624                           STORE    COF                                   
027181,000734: 34,2321           51145        U2POS              DLOAD    BPL                                   
027182,000735: 34,2322           01604                                    MFISYM     +2                         #  UX UY
027183,000736: 34,2323           70327                                    OKU21                                 
027184,000737: 34,2324           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
027185,000738: 34,2325           01624                                    COF                                   
027186,000739: 34,2326           01624                           STORE    COF                                   
027187,000740: 34,2327           51145        OKU21              DLOAD    BPL                                   
027188,000741: 34,2330           01614                                    MFISYM     +10D                       #  UY UZ
027189,000742: 34,2331           71024                                    LOCSKIRT                              
027190,000743: 34,2332           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
027191,000744: 34,2333           01630                                    COF        +4                         
027192,000745: 34,2334           01630                           STORE    COF        +4                         
027193,000746: 34,2335           77650                           GOTO                                           
027194,000747: 34,2336           71024                                    LOCSKIRT                              
027195,000748: 34,2337           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
027196,000749: 
027197,000750: 34,2340           01635                                    COFSKEW                               #  UX
027198,000751: 34,2341           70345                                    U1POS                                 

Page 609

027200,000753: 34,2342           57575                           VLOAD    VCOMP                                 
027201,000754: 34,2343           01624                                    COF                                   
027202,000755: 34,2344           01624                           STORE    COF                                   
027203,000756: 34,2345           51145        U1POS              DLOAD    BPL                                   
027204,000757: 34,2346           01604                                    MFISYM     +2                         #  UX UY
027205,000758: 34,2347           70353                                    OKU12                                 
027206,000759: 34,2350           57545                           DLOAD    DCOMP                                 
027207,000760: 34,2351           01626                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
027208,000761: 
027209,000762: 34,2352           01626                           STORE    COF        +2                         
027210,000763: 34,2353           51145        OKU12              DLOAD    BPL                                   
027211,000764: 34,2354           01606                                    MFISYM     +4                         #  UX UZ
027212,000765: 34,2355           71024                                    LOCSKIRT                              
027213,000766: 34,2356           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
027214,000767: 34,2357           01630                                    COF        +4                         
027215,000768: 34,2360           01630                           STORE    COF        +4                         
027216,000769: 34,2361           77650                           GOTO                                           
027217,000770: 34,2362           71024                                    LOCSKIRT                              
027218,000771: 34,2363           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX
027219,000772: 34,2364           01641                                    COFSKEW    +4                         #  UZ
027220,000773: 34,2365           70371                                    U3POS                                 
027221,000774: 34,2366           57575                           VLOAD    VCOMP                                 
027222,000775: 34,2367           01624                                    COF                                   
027223,000776: 34,2370           01624                           STORE    COF                                   
027224,000777: 34,2371           51145        U3POS              DLOAD    BPL                                   
027225,000778: 34,2372           01606                                    MFISYM     +4                         #  UX UZ
027226,000779: 34,2373           70377                                    OKU31                                 
027227,000780: 34,2374           57545                           DLOAD    DCOMP                                 
027228,000781: 34,2375           01624                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
027229,000782: 34,2376           01624                           STORE    COF                                   
027230,000783: 34,2377           51145        OKU31              DLOAD    BPL                                   
027231,000784: 34,2400           01614                                    MFISYM     +10D                       #  UY UZ
027232,000785: 
027233,000786: 34,2401           71024                                    LOCSKIRT                              
027234,000787: 34,2402           57545                           DLOAD    DCOMP                                 
027235,000788: 34,2403           01626                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
027236,000789: 34,2404           01626                           STORE    COF        +2                         
027237,000790: 34,2405           77650                           GOTO                                           
027238,000791: 34,2406           71024                                    LOCSKIRT                              
027239,000792: 

Page 610

027241,000794:                                                                                                  #  MATRIX OPERATIONS
027242,000795: 
027243,000796: 35,3442                                           BANK     35                                    
027244,000797: 35,3442  E3,1535                                  EBANK=   MIS                                   
027245,000798: 
027246,000799: 35,3442           77601        MXM3               SETPD                                          #  MXM3 MULTIPLIES 2 3X3 MATRICES
027247,000800: 35,3443           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
027248,000801: 35,3444           64743                           DLOAD*   PDDL*                                 #  ADDRESS OF 1ST MATRIX IN XR1
027249,000802: 35,3445           77762                                    12D,2                                 #  ADDRESS OF 2ND MATRIX IN XR2
027250,000803: 35,3446           77770                                    6,2                                   
027251,000804: 35,3447           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 1)
027252,000805: 35,3450           77776                                    0,2                                   
027253,000806: 35,3451           64717                           MXV*     PDDL*                                 #  M1XM2(COL 1) IN PD
027254,000807: 35,3452           00001                                    0,1                                   
027255,000808: 
027256,000809: 35,3453           77760                                    14D,2                                 
027257,000810: 35,3454           64723                           PDDL*    PDDL*                                 
027258,000811: 35,3455           77766                                    8D,2                                  
027259,000812: 35,3456           77774                                    2,2                                   
027260,000813: 35,3457           63666                           VDEF     MXV*                                  #  DEFINE VECTOR M2(COL 2)
027261,000814: 35,3460           00001                                    0,1                                   
027262,000815: 35,3461           64723                           PDDL*    PDDL*                                 #  M1XM2(COL 2) IN PD
027263,000816: 35,3462           77756                                    16D,2                                 
027264,000817: 35,3463           77764                                    10D,2                                 
027265,000818: 35,3464           55523                           PDDL*    VDEF                                  #  DEFINE VECTOR M2(COL 3)
027266,000819: 35,3465           77772                                    4,2                                   
027267,000820: 35,3466           41517                           MXV*     PUSH                                  #  M1XM2(COL 3) IN PD
027268,000821: 35,3467           00001                                    0,1                                   
027269,000822: 35,3470           77650                           GOTO                                           
027270,000823: 35,3471           73501                                    TRNSPSPD                              #  REVERSE ROWS AND COLS IN PD AND 
027271,000824:                                                                                                  #                                  RETURN WITH M1XM2 IN PD LIST
027272,000825: 
027273,000826: 35,3472           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
027274,000827: 35,3473           00001                                    0                                     #   AND LEAVES RESULT IN PD LIST
027275,000828: 35,3474           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
027276,000829: 35,3475           62713                           PDVL*    PDVL*                                 
027277,000830: 35,3476           00007                                    6,1                                   
027278,000831: 35,3477           00015                                    12D,1                                 
027279,000832: 
027280,000833: 35,3500           77606                           PUSH                                           #  MATRIX IN PD
027281,000834: 35,3501           65345        TRNSPSPD           DLOAD    PDDL                                  #  ENTER WITH MATRIX IN PD LIST
027282,000835: 35,3502           00003                                    2                                     
027283,000836: 35,3503           00007                                    6                                     
027284,000837: 35,3504           14003                           STODL    2                                     
027285,000838: 35,3505           77626                           STADR                                          
027286,000839: 35,3506           63770                           STODL    6                                     
027287,000840: 35,3507           00005                                    4                                     
027288,000841: 35,3510           77725                           PDDL                                           
027289,000842: 35,3511           00015                                    12D                                   
027290,000843: 35,3512           14005                           STODL    4                                     
027291,000844: 35,3513           77626                           STADR                                          
027292,000845: 35,3514           63762                           STODL    12D                                   

Page 611

027294,000847: 35,3515           00013                                    10D                                   
027295,000848: 35,3516           77725                           PDDL                                           
027296,000849: 35,3517           00017                                    14D                                   
027297,000850: 35,3520           14013                           STODL    10D                                   
027298,000851: 35,3521           77626                           STADR                                          
027299,000852: 35,3522           77760                           STORE    14D                                   
027300,000853: 
027301,000854: 35,3523           77616                           RVQ                                            #  RETURN WITH TRANSPOSED MATRIX IN PD LIST
027302,000855: 

Page 612

027304,000857: 34,2407                                           BANK     34                                    
027305,000858: 34,2407  E3,1535                                  EBANK=   MIS                                   
027306,000859: 
027307,000860: 34,2407           00013 13563  MINANG             2DEC     0.00069375                            
027308,000861: 
027309,000862: 34,2411           17070 34343  MAXANG             2DEC     0.472222222                            
027310,000863: 
027311,000864: 34,2413           20000 00000  HALFA              2DEC     0.5                                   
027312,000865: 
027313,000866: 34,2415           00000 00000  NIL                2DEC     0.0                                   
027314,000867: 
027315,000868: 34,2417           00000 00000                     2DEC     0.0                                   
027316,000869: 
027317,000870: 34,2421           00000 00000                     2DEC     0.0                                   
027318,000871: 
027319,000872: 34,2423           20000 00000                     2DEC     0.5                                   
027320,000873: 
027321,000874: 34,2425           10000 00000  QUARTA             2DEC     .25                                   
027322,000875: 
027323,000876:                                                                                                  #           GIMBAL LOCK CONSTANTS
027324,000877: 
027325,000878:                                                                                                  #  D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
027326,000879:                                                                                                  #           NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
027327,000880: 
027328,000881: 34,2427           15666 20443  SD                 2DEC     .433015                               #  = SIN(D)                      $2
027329,000882: 
027330,000883: 34,2431           33555 01106  K3S1               2DEC     .86603                                #  = SIN(D)                      $1
027331,000884: 
027332,000885: 34,2433           67777 77777  K4                 2DEC     -.25                                  #  = -COS(D)                     $2
027333,000886: 
027334,000887: 34,2435           04000 00000  K4SQ               2DEC     .125                                  #  = COS(D)COS(D)                $2
027335,000888: 
027336,000889: 34,2437           00216 36323  SNGLCD             2DEC     .008725                               #  = SIN(NGL)COS(D)              $2
027337,000890: 
027338,000891: 34,2441           17773 00057  CNGL               2DEC     .499695                               #  COS(NGL)                      $2
027339,000892: 
027340,000893: 34,2443           12525 12525  LOCKANGL           2DEC     .3333333333                            #  $60DEGG
027341,000894: 
027342,000895:                                                                                                  #  ROUTINE FOR LIMITING THE SIZE OF MPAC ON OVERFLOW TO DP POSMAX OR DP NEGMAX
027343,000896: 
027344,000897: 34,2445           00006        SIGNMPAC           EXTEND                                         
027345,000898: 34,2446           37735                           DCA      DPOSMAX                               
027346,000899: 34,2447           52145                           DXCH     MPAC                                  
027347,000900: 34,2450           10000                           CCS      A                                     
027348,000901: 34,2451           37761                           CAF      ZERO                                  
027349,000902: 34,2452           16535                           TCF      SLOAD2     +2                         
027350,000903: 34,2453           12454                           TCF      +1                                    
027351,000904: 34,2454           00006                           EXTEND                                         
027352,000905: 34,2455           47735                           DCS      DPOSMAX                               
027353,000906: 
027354,000907: 34,2456           16533                           TCF      SLOAD2                                
027355,000908: 

Page 613

027357,000910: 
027358,000911:                                                                                                  #  INTERPRETIVE SUBROUTINE TO READ THE CDU ANGLES
027359,000912: 
027360,000913: 34,2457           30034        READCDUK           CA       CDUZ                                  #  LOAD T(MPAC) WITH CDU ANGLES
027361,000914: 34,2460           54146                           TS       MPAC       +2                         
027362,000915: 34,2461           00006                           EXTEND                                         
027363,000916: 34,2462           30033                           DCA      CDUX                                  #  AND CHANGE MODE TO TRIPLE PRECISION
027364,000917: 34,2463           16545                           TCF      TLOAD      +6                         
027365,000918: 
027366,000919: 
027367,000920: 34,2464           66370        CDUTODCM           AXT,1    SSP                                   
027368,000921: 34,2465           00003                           OCT      3                                     
027369,000922: 34,2466           00051                                    S1                                    
027370,000923: 34,2467           00001                           OCT      1                                     #  SET XR1, S1, AND PD FOR LOOP
027371,000924: 34,2470           00010                           STORE    7                                     
027372,000925: 34,2471           77601                           SETPD                                          
027373,000926: 34,2472           00001                                    0                                     
027374,000927: 34,2473           47133        LOOPSIN            SLOAD*   RTB                                   
027375,000928: 34,2474           00013                                    10D,1                                 
027376,000929: 34,2475           33524                                    CDULOGIC                              
027377,000930: 34,2476           00013                           STORE    10D                                   #  LOAD PD WITH 0 SIN(PHI)
027378,000931: 34,2477           65356                           SIN      PDDL                                  #               2 COS(PHI)
027379,000932: 34,2500           00013                                    10D                                   #               4 SIN(THETA)
027380,000933: 34,2501           41546                           COS      PUSH                                  #               6 COS(THETA)
027381,000934: 34,2502           71300                           TIX,1    DLOAD                                 #               8 SIN(PSI)
027382,000935: 34,2503           70473                                    LOOPSIN                               #              10 COS(PSI)
027383,000936: 34,2504           00007                                    6                                     
027384,000937: 34,2505           72405                           DMP      SL1                                   
027385,000938: 34,2506           00013                                    10D                                   
027386,000939: 34,2507           10001                           STORE    0,2                                   #  C0=COS(THETA)COS(PSI)
027387,000940: 34,2510           41345                           DLOAD    DMP                                   
027388,000941: 34,2511           00005                                    4                                     
027389,000942: 
027390,000943: 34,2512           00001                                    0                                     
027391,000944: 34,2513           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI))
027392,000945: 34,2514           00007                                    6                                     
027393,000946: 34,2515           00011                                    8D                                    
027394,000947: 34,2516           72405                           DMP      SL1                                   
027395,000948: 34,2517           00003                                    2                                     
027396,000949: 34,2520           72421                           BDSU     SL1                                   
027397,000950: 34,2521           00015                                    12D                                   
027398,000951: 34,2522           10003                           STORE    2,2                                   #  C1=-COS(THETA)SIN(PSI)COS(PHI)
027399,000952: 34,2523           41345                           DLOAD    DMP                                   
027400,000953: 34,2524           00003                                    2                                     
027401,000954: 34,2525           00005                                    4                                     
027402,000955: 34,2526           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
027403,000956: 34,2527           00007                                    6                                     
027404,000957: 34,2530           00011                                    8D                                    
027405,000958: 34,2531           72405                           DMP      SL1                                   
027406,000959: 34,2532           00001                                    0                                     
027407,000960: 34,2533           72415                           DAD      SL1                                   

Page 614

027409,000962: 34,2534           00017                                    14D                                   
027410,000963: 34,2535           10005                           STORE    4,2                                   #  C2=COS(THETA)SIN(PSI)SIN(PHI)
027411,000964: 34,2536           77745                           DLOAD                                          
027412,000965: 34,2537           00011                                    8D                                    
027413,000966: 34,2540           10007                           STORE    6,2                                   #  C3=SIN(PSI)
027414,000967: 34,2541           77745                           DLOAD                                          
027415,000968: 34,2542           00013                                    10D                                   
027416,000969: 34,2543           72405                           DMP      SL1                                   
027417,000970: 34,2544           00003                                    2                                     
027418,000971: 34,2545           10011                           STORE    8D,2                                  #  C4=COS(PSI)COS(PHI)
027419,000972: 34,2546           41345                           DLOAD    DMP                                   
027420,000973: 34,2547           00013                                    10D                                   
027421,000974: 34,2550           00001                                    0                                     
027422,000975: 34,2551           72476                           DCOMP    SL1                                   
027423,000976: 
027424,000977: 34,2552           10013                           STORE    10D,2                                 #  C5=-COS(PSI)SIN(PHI)
027425,000978: 34,2553           41345                           DLOAD    DMP                                   
027426,000979: 34,2554           00005                                    4                                     
027427,000980: 34,2555           00013                                    10D                                   
027428,000981: 34,2556           72476                           DCOMP    SL1                                   
027429,000982: 34,2557           10015                           STORE    12D,2                                 #  C6=-SIN(THETA)COS(PSI)
027430,000983: 34,2560           77745                           DLOAD                                          
027431,000984: 34,2561           72405                           DMP      SL1                                   #   (PUSH UP 7)
027432,000985: 34,2562           00011                                    8D                                    
027433,000986: 34,2563           41325                           PDDL     DMP                                   #   (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE 4
027434,000987: 34,2564           00007                                    6                                     
027435,000988: 34,2565           00001                                    0                                     
027436,000989: 34,2566           72415                           DAD      SL1                                   #   (PUSH UP 7)
027437,000990: 34,2567           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
027438,000991: 34,2570           67760                           STORE    14D,2                                 #   +COS(THETA)SIN(PHI)
027439,000992: 34,2571           77745                           DLOAD                                          
027440,000993: 34,2572           72405                           DMP      SL1                                   #   (PUSH UP 6)
027441,000994: 34,2573           00011                                    8D                                    
027442,000995: 34,2574           41325                           PDDL     DMP                                   #   (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE 4
027443,000996: 34,2575           00007                                    6                                     
027444,000997: 34,2576           00003                                    2                                     
027445,000998: 34,2577           72425                           DSU      SL1                                   #   (PUSH UP 6)
027446,000999: 34,2600           77626                           STADR                                          
027447,001000: 
027448,001001: 34,2601           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
027449,001002: 34,2602           77616                           RVQ                                            #   +COS(THETA)COS(PHI)
027450,001003: 
027451,001004:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
027452,001005: 
027453,001006:                                                                                                  #           *      *               --T           *
027454,001007:                                                                                                  #           DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)         SCALED 1
027455,001008: 
027456,001009:                                                                                                  #                 -
027457,001010:                                                                                                  #           WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
027458,001011:                                                                                                  #           A IS THE ANGLE OF ROTATION (DP SCALED 2)
027459,001012:                                                                                                  #                                              -
027460,001013:                                                                                                  #           UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
027461,001014: 

Page 615

027463,001016: 34,2603           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
027464,001017: 34,2604           00001                                    0                                     
027465,001018: 34,2605           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
027466,001019: 34,2606           41546                           COS      PUSH                                  #  PD2 = COS(A)
027467,001020: 34,2607           41021                           BDSU     BOVB                                  
027468,001021: 34,2610           30414                                    HALFA                                 
027469,001022: 34,2611           70445                                    SIGNMPAC                              
027470,001023: 34,2612           77725                           PDDL                                           #  PD4 = 1-COS(A)
027471,001024: 
027472,001025:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
027473,001026: 
027474,001027: 34,2613           01624                                    COF                                   
027475,001028: 34,2614           41316                           DSQ      DMP                                   
027476,001029: 34,2615           00005                                    4                                     
027477,001030: 34,2616           43312                           SL2      DAD                                   #  UX UX(1-COS(A))                        $2
027478,001031: 34,2617           00003                                    2                                     
027479,001032: 34,2620           41152                           SL1      BOVB                                  
027480,001033: 34,2621           70445                                    SIGNMPAC                              
027481,001034: 34,2622           15560                           STODL    KEL                                   #  UX UX(1-COS(A)) +COS(A)                $1
027482,001035: 
027483,001036: 34,2623           01626                                    COF        +2                         
027484,001037: 34,2624           41316                           DSQ      DMP                                   
027485,001038: 34,2625           00005                                    4                                     
027486,001039: 34,2626           43312                           SL2      DAD                                   #  UY UY(1-COS(A))                        $2                             
027487,001040: 34,2627           00003                                    2                                     
027488,001041: 34,2630           41152                           SL1      BOVB                                  
027489,001042: 34,2631           70445                                    SIGNMPAC                              
027490,001043: 34,2632           15570                           STODL    KEL        +8D                        #  UY UY(1-COS(A)) +COS(A)                $1
027491,001044: 34,2633           01630                                    COF        +4                         
027492,001045: 34,2634           41316                           DSQ      DMP                                   
027493,001046: 34,2635           00005                                    4                                     
027494,001047: 34,2636           43312                           SL2      DAD                                   #  UZ UZ(1-COS(A))                        $2                              
027495,001048: 34,2637           00003                                    2                                     
027496,001049: 34,2640           41152                           SL1      BOVB                                  
027497,001050: 34,2641           70445                                    SIGNMPAC                              
027498,001051: 34,2642           01600                           STORE    KEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)                $1
027499,001052: 
027500,001053:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
027501,001054: 
027502,001055: 34,2643           41345                           DLOAD    DMP                                   
027503,001056: 34,2644           01624                                    COF                                   
027504,001057: 34,2645           01626                                    COF        +2                         
027505,001058: 34,2646           72405                           DMP      SL1                                   
027506,001059: 
027507,001060: 34,2647           00005                                    4                                     
027508,001061: 34,2650           41325                           PDDL     DMP                                   #  D6  UX UY (1-COS A)                $ 4
027509,001062: 34,2651           01630                                    COF        +4                         
027510,001063: 34,2652           00001                                    0                                     
027511,001064: 34,2653           43206                           PUSH     DAD                                   #  D8  UZ SIN A                       $ 4
027512,001065: 34,2654           00007                                    6                                     
027513,001066: 34,2655           41112                           SL2      BOVB                                  
027514,001067: 34,2656           70445                                    SIGNMPAC                              

Page 616

027516,001069: 34,2657           15566                           STODL    KEL        +6                         
027517,001070: 34,2660           62421                           BDSU     SL2                                   
027518,001071: 
027519,001072: 34,2661           77604                           BOVB                                           
027520,001073: 34,2662           70445                                    SIGNMPAC                              
027521,001074: 34,2663           15562                           STODL    KEL        +2                         
027522,001075: 34,2664           01624                                    COF                                   
027523,001076: 34,2665           41205                           DMP      DMP                                   
027524,001077: 34,2666           01630                                    COF        +4                         
027525,001078: 34,2667           00005                                    4                                     
027526,001079: 34,2670           65352                           SL1      PDDL                                  #  D6  UX UZ (1-COS A )                $ 4
027527,001080: 34,2671           01626                                    COF        +2                         
027528,001081: 34,2672           41405                           DMP      PUSH                                  #  D8  UY SIN(A)
027529,001082: 34,2673           00001                                    0                                     
027530,001083: 34,2674           62415                           DAD      SL2                                   
027531,001084: 34,2675           00007                                    6                                     
027532,001085: 34,2676           77604                           BOVB                                           
027533,001086: 34,2677           70445                                    SIGNMPAC                              
027534,001087: 34,2700           15564                           STODL    KEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)
027535,001088: 34,2701           62421                           BDSU     SL2                                   
027536,001089: 34,2702           77604                           BOVB                                           
027537,001090: 34,2703           70445                                    SIGNMPAC                              
027538,001091: 34,2704           15574                           STODL    KEL        +12D                       #  UX UZ (1-COS(A))-UY SIN(A)
027539,001092: 34,2705           01626                                    COF        +2                         
027540,001093: 34,2706           41205                           DMP      DMP                                   
027541,001094: 34,2707           01630                                    COF        +4                         
027542,001095: 
027543,001096: 34,2710           00005                                    4                                     
027544,001097: 34,2711           65352                           SL1      PDDL                                  #  D6  UY UZ (1-COS(A))                $ 4
027545,001098: 34,2712           01624                                    COF                                   
027546,001099: 34,2713           41405                           DMP      PUSH                                  #  D8  UX SIN(A)
027547,001100: 34,2714           00001                                    0                                     
027548,001101: 34,2715           62415                           DAD      SL2                                   
027549,001102: 34,2716           00007                                    6                                     
027550,001103: 34,2717           77604                           BOVB                                           
027551,001104: 34,2720           70445                                    SIGNMPAC                              
027552,001105: 34,2721           15576                           STODL    KEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
027553,001106: 34,2722           62421                           BDSU     SL2                                   
027554,001107: 34,2723           77604                           BOVB                                           
027555,001108: 34,2724           70445                                    SIGNMPAC                              
027556,001109: 34,2725           01572                           STORE    KEL        +10D                       #  UY UZ (1-COS(A)) -UX SIN(A)
027557,001110: 34,2726           77616                           RVQ                                            
027558,001111: 
027559,001112:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
027560,001113:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
027561,001114:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
027562,001115:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
027563,001116: 
027564,001117:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS***
027565,001118: 

Page 617

027567,001120:                                                                                                  #           C =COS(THETA)COS(PSI)
027568,001121:                                                                                                  #            0
027569,001122:                                                                                                  #           C =-COS(THETA)SIN(PSI)COS(PHI)+SI (THETA)SIN(PHI)
027570,001123:                                                                                                  #            1
027571,001124:                                                                                                  #           C =COS(THETA)SIN(PSI)SIN(PHI) + S N(THETA)COS(PHI)
027572,001125:                                                                                                  #            2
027573,001126:                                                                                                  #           C =SIN(PSI)
027574,001127:                                                                                                  #            3
027575,001128: 
027576,001129:                                                                                                  #           C =COS(PSI)COS(PHI)
027577,001130:                                                                                                  #            4
027578,001131:                                                                                                  #           C =-COS(PSI)SIN(PHI)
027579,001132:                                                                                                  #            5
027580,001133:                                                                                                  #           C =-SIN(THETA)COS(PSI)
027581,001134:                                                                                                  #            6
027582,001135:                                                                                                  #           C =SIN(THETA)SIN(PSI)COS(PHI)+COS THETA)SIN(PHI)
027583,001136:                                                                                                  #            7
027584,001137:                                                                                                  #           C =-SIN(THETA)SIN(PSI)SIN(PHI)+CO (THETA)COS(PHI)
027585,001138:                                                                                                  #            8
027586,001139: 
027587,001140:                                                                                                  #           WHERE PHI = OGA
027588,001141:                                                                                                  #                 THETA = IGA
027589,001142:                                                                                                  #                 PSI = MGA
027590,001143: 
027591,001144: 34,2727           67543        DCMTOCDU           DLOAD*   ARCSIN                                
027592,001145: 34,2730           00007                                    6,1                                   
027593,001146: 34,2731           71406                           PUSH     COS                                   #  PD +0   PSI
027594,001147: 34,2732           41152                           SL1      BOVB                                  
027595,001148: 34,2733           70445                                    SIGNMPAC                              
027596,001149: 34,2734           00051                           STORE    S1                                    
027597,001150: 34,2735           57543                           DLOAD*   DCOMP                                 
027598,001151: 34,2736           00015                                    12D,1                                 
027599,001152: 
027600,001153: 34,2737           67471                           DDV      ARCSIN                                
027601,001154: 34,2740           00051                                    S1                                    
027602,001155: 34,2741           51123                           PDDL*    BPL                                   #  PD +2  THETA
027603,001156: 34,2742           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
027604,001157: 34,2743           70755                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
027605,001158: 34,2744           57545                           DLOAD    DCOMP                                 
027606,001159: 34,2745           43244                           BPL      DAD                                   
027607,001160: 34,2746           70752                                    SUHALFA                               
027608,001161: 34,2747           30414                                    HALFA                                 
027609,001162: 34,2750           77650                           GOTO                                           
027610,001163: 34,2751           70754                                    CALCPHI                               
027611,001164: 34,2752           77625        SUHALFA            DSU                                            
027612,001165: 34,2753           30414                                    HALFA                                 
027613,001166: 34,2754           77606        CALCPHI            PUSH                                           
027614,001167: 34,2755           57543        OKTHETA            DLOAD*   DCOMP                                 
027615,001168: 34,2756           00013                                    10D,1                                 
027616,001169: 34,2757           67471                           DDV      ARCSIN                                
027617,001170: 34,2760           00051                                    S1                                    
027618,001171: 34,2761           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI

Page 618

027620,001173: 34,2762           00011                                    8D,1                                  
027621,001174: 34,2763           70775                                    OKPHI                                 
027622,001175: 34,2764           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
027623,001176: 34,2765           43244                           BPL      DAD                                   
027624,001177: 34,2766           70772                                    SUHALFAP                              
027625,001178: 34,2767           30414                                    HALFA                                 
027626,001179: 34,2770           77650                           GOTO                                           
027627,001180: 34,2771           70776                                    VECOFANG                              
027628,001181: 34,2772           52025        SUHALFAP           DSU      GOTO                                  
027629,001182: 34,2773           30414                                    HALFA                                 
027630,001183: 34,2774           70776                                    VECOFANG                              
027631,001184: 34,2775           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
027632,001185: 34,2776           43466        VECOFANG           VDEF     RVQ                                   
027633,001186: 

Page 619

027635,001188:                                                                                                  #  ROUTINES FOR TERMINATING THE AUTOMATIC MANEUVER AND RETURNING TO USER
027636,001189: 
027637,001190: 34,2777           77776        ENDMANU            EXIT                                           
027638,001191: 34,3000           37754                           CAF      TWO                                   
027639,001192: 34,3001           00004                           INHINT                                         
027640,001193: 34,3002           05701                           TC       WAITLIST                              #  PREPARE FOR A GOOD (NORMAL) RETURN VIA
027641,001194: 34,3003  E3,1535                                  EBANK=   MIS                                   
027642,001195: 34,3003           03715 70063                     2CADR    GOODMANU                              #  GOODEND
027643,001196: 
027644,001197: 34,3005           00003                           RELINT                                         
027645,001198: 34,3006           05605                           TC       ENDOFJOB                              
027646,001199: 
027647,001200: 34,3007           77776        TOOBAD             EXIT                                           #  INITIAL OR FINAL GIMBAL ANGLES IN
027648,001201: 34,3010           37754                           CAF      TWO                                   #  GIMBAL LOCK
027649,001202: 34,3011           00004                           INHINT                                         
027650,001203: 34,3012           05701                           TC       WAITLIST                              
027651,001204: 34,3013  E3,1535                                  EBANK=   MIS                                   
027652,001205: 34,3013           03017 70063                     2CADR    NOGO                                  #  PREPARE FOR A BAD RETURN VIA BADEND
027653,001206: 
027654,001207: 34,3015           00003                           RELINT                                         
027655,001208: 34,3016           05605                           TC       ENDOFJOB                              
027656,001209: 
027657,001210: 34,3017           06045        NOGO               TC       FLAG2DWN                              #  RESET BIT 11 OF FLAGWRD2 TO SIGNAL END
027658,001211: 34,3020           02000                           OCT      2000                                  #  OF KALCMANU
027659,001212: 34,3021           36301                           CAF      THREE                                 
027660,001213: 34,3022           05243                           TC       POSTJUMP                              #  RETURN UNDER WAITLIST VIA BADEND
027661,001214: 34,3023           26726                           CADR     BADEND                                #  AND WAKE UP USER

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