Source Code

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

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 56 OF AGC PROGRAM ZERLINA BY ZOROASTER
	9:12 OCT. 21,1970
Note that the date is the date of the printout, not the date of the program revision.

015315,000002:                                                                                                  ## Copyright:   Public domain.
015316,000003:                                                                                                  ## Filename:    ATTITUDE_MANEUVER_ROUTINE.agc
015317,000004:                                                                                                  ## Purpose:     A log section of Zerlina 56, the final revision of
015318,000005:                                                                                                  ##              Don Eyles's offline development program for the variable 
015319,000006:                                                                                                  ##              guidance period servicer. It also includes a new P66 with LPD 
015320,000007:                                                                                                  ##              (Landing Point Designator) capability, based on an idea of John 
015321,000008:                                                                                                  ##              Young's. Neither of these advanced features were actually flown,
015322,000009:                                                                                                  ##              but Zerlina was also the birthplace of other big improvements to
015323,000010:                                                                                                  ##              Luminary including the terrain model and new (Luminary 1E)
015324,000011:                                                                                                  ##              analog display programs. Zerlina was branched off of Luminary 145,
015325,000012:                                                                                                  ##              and revision 56 includes all changes up to and including Luminary
015326,000013:                                                                                                  ##              183. It is therefore quite close to the Apollo 14 program,
015327,000014:                                                                                                  ##              Luminary 178, where not modified with new features.
015328,000015:                                                                                                  ## Reference:   pp. 347-368
015329,000016:                                                                                                  ## Assembler:   yaYUL
015330,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015331,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015332,000019:                                                                                                  ## Mod history: 2017-07-28 MAS  Created from Luminary 210.
015333,000020:                                                                                                  ##              2017-08-22 RSB  Transcribed.
015334,000021: 

Page 347

015336,000023:                                                                                                  #  BLOCK 2 LGC ATTITUDE MANEUVER ROUTINE-KALCMANU
015337,000024: 
015338,000025: 
015339,000026:                                                                                                  #  MOD 2           DATE 5/1/67     BY DON KEENE
015340,000027: 
015341,000028:                                                                                                  #  PROGRAM DESCRIPTION
015342,000029: 
015343,000030:                                                                                                  #       KALCMANU IS A ROUTINE WHICH GENERATES COMMANDS FOR THE LM DAP TO CHANGE THE ATTITUDE OF THE SPACECRAFT
015344,000031:                                                                                                  #  DURING FREE FALL.  IT IS DESIGNED TO MANEUVER THE SPACECRAFT FROM ITS INITIAL ORIENTATION TO SOME DESIRED
015345,000032:                                                                                                  #  ORIENTATION SPECIFIED BY THE PROGRAM WHICH CALLS KALCMANU, AVOIDING GIMBAL LOCK IN THE PROCESS.  IN THE
015346,000033:                                                                                                  #  MOD 2 VERSION, THIS DESIRED ATTITUDE IS SPECIFIED BY A SET OF THREE COMMANDED CDU ANGLES STORED AS 2S COMPLEMENT
015347,000034:                                                                                                  #  SINGLE PRECISION ANGLES IN THE THREE CONSECUTIVE LOCATIONS, CPHI, CTHETA, CPSI, WHERE
015348,000035: 
015349,000036:                                                                                                  #       CPHI = COMMANDED OUTER GIMBAL ANGLE
015350,000037:                                                                                                  #       CTHETA = COMMANDED INNER GIMBAL ANGLE
015351,000038:                                                                                                  #       CPSI = COMMANDED MIDDLE GIMBAL ANGLE
015352,000039: 
015353,000040:                                                                                                  #      WHEN POINTING A SPACECRAFT AXIS (E.I. X, Y, Z, THE AOT, THRUST AXIS, ETC) THE SUBROUTINE VECPOINT MAY BE
015354,000041:                                                                                                  #  USED TO GENERATE THIS SET OF DESIRED CDU ANGLES (SEE DESCRIPTION IN R60)   -
015355,000042:                                                                                                  #   WITH THIS INFORMATION KALCMANU DETERMINES THE DIRECTION OF THE SINGLE EQUIVALENT ROTATION (COF ALSO U) AND THE
015356,000043:                                                                                                  #  MAGNITUDE OF THE ROTATION (AM) TO BRING THE S/C FROM ITS INITIAL ORIENTATION TO ITS FINAL ORIENTATION.
015357,000044:                                                                                                  #  THIS DIRECTION REMAINS FIXED BOTH IN INERTIAL COORDINATES AND IN COMMANDED S/C AXES THROUGHOUT THE
015358,000045:                                                                                                  #                   -
015359,000046:                                                                                                  #  MANEUVER.  ONCE COF AND AM HAVE BEEN DETERMINED, KALCMANU THEN EXAMINES THE MANEUVER TO SEE IF IT WILL BRING
015360,000047:                                                                                                  #                                        -
015361,000048:                                                                                                  #  THE S/C THROUGH GIMBAL LOCK.  IF SO, COF AND AM ARE READJUSTED SO THAT THE S/C WILL JUST SKIM THE GIMBAL
015362,000049:                                                                                                  #  LOCK ZONE AND ALIGN THE X-AXIS.  IN GENERAL A FINAL YAW  ABOUT X WILL BE NECESSARY TO COMPLETE THE MANEUVER.
015363,000050:                                                                                                  #  NEEDLESS TO SAY, NEITHER THE INITIAL NOR THE FINAL ORIENTATION CAN BE IN GIMBAL LOCK.
015364,000051: 
015365,000052:                                                                                                  #       FOR PROPER ATTITUDE CONTROL THE DIGITAL AUTOPILOT MUST BE GIVEN AN ATTITUDE REFERENCE WHICH IT CAN TRACK.
015366,000053:                                                                                                  #  KALCMANU DOES THIS BY GENERATING A REFERENCE OF DESIRED GIMBAL ANGLES (CDUXD, CDUYD, CDUZD) WHICH ARE UPDATED
015367,000054:                                                                                                  #  EVERY ONE SECOND DURING THE MANEUVER.  TO ACHIEVE A SMOOTHER SEQUENCE OF COMMANDS BETWEEN SUCCESSIVE UPDATES,
015368,000055:                                                                                                  #  THE PROGRAM ALSO GENERATES A SET OF INCREMENTAL CDU ANGLES (DELDCDU) TO BE ADDED TO CDU DESIRED BY THE DIGITAL
015369,000056:                                                                                                  #  AUTOPILOT.  KALCMANU ALSO CALCULATES THE COMPONENT MANEUVER RATES (OMEGAPD, OMEGAQD, OMEGARD), WHICH CAN
015370,000057:                                                                                                  #                                       -
015371,000058:                                                                                                  #  BE DETERMINED SIMPLY BY MULTIPLYING COF BY SOME SCALAR (ARATE) CORRESPONDING TO THE DESIRED ROTATIONAL RATE.
015372,000059: 
015373,000060:                                                                                                  #       AUTOMATIC MANEUVERS ARE TIMED WITH THE HELP OF WAITLIST SO THAT AFTER A SPECIFIED INTERVAL THE Y AND Z
015374,000061:                                                                                                  #  DESIRED RATES ARE SET TO ZERO AND THE DESIRED CDU ANGLES (CDUYD, CDUZD) ARE SET EQUAL TO THE FINAL DESIRED CDU
015375,000062:                                                                                                  #  ANGLES (CTHETA, CPSI).  IF ANY YAW  REMAINS DUE TO GIMBAL LOCK AVOIDANCE, THE FINAL YAW  MANEUVER IS
015376,000063:                                                                                                  #  CALCULATED AND THE DESIRED YAW  RATE SET TO SOME FIXED VALUE (ROLLRATE = + OR - 2 DEGREES PER SEC).
015377,000064:                                                                                                  #  IN THIS CASE ONLY AN INCREMENTAL CDUX ANGLE (DELFROLL) IS SUPPLIED TO THE DAP.  AT THE END OF THE YAW
015378,000065:                                                                                                  #  MANEUVER OR IN THE EVENT THAT THERE WAS NO FINAL YAW,  CDUXD IS SET EQUAL TO CPHI AND THE X-AXIS DESIRED
015379,000066:                                                                                                  #  RATE SET TO ZERO.  THUS, UPON COMPLETION OF THE MANEUVER THE S/C WILL FINISH UP IN A LIMIT CYCLE ABOUT THE
015380,000067:                                                                                                  #  DESIRED FINAL GIMBAL ANGLES.
015381,000068: 
015382,000069: 
015383,000070:                                                                                                  #  PROGRAM LOGIC FLOW
015384,000071: 
015385,000072:                                                                                                  #       KALCMANU IS CALLED AS A HIGH PRIORITY JOB WITH ENTRY POINTS AT KALCMAN3 AND VECPOINT.  IT FIRST PICKS
015386,000073:                                                                                                  #  UP THE CURRENT CDU ANGLES TO BE USED AS THE BASIS FOR ALL COMPUTATIONS INVOLVING THE INITIAL S/C ORIENTATION.
015387,000074: 

Page 348

015389,000076:                                                                                                  #  IT THEN DETERMINES THE DIRECTION COSINE MATRICES RELATING BOTH THE INITIAL AND FINAL S/C ORIENTATION TO STABLE
015390,000077:                                                                                                  #                *    *                                                                               *
015391,000078:                                                                                                  #  MEMBER AXES (MIS, MFS).  IT ALSO COMPUTES THE MATRIX RELATING FINAL S/C AXES TO INITIAL S/C AXES (MFI).  THE
015392,000079:                                                                                                  #  ANGLE OF ROTATION (AM) IS THEN EXTRACTED FROM THIS MATRIX, AND TESTS ARE MADE TO DETERMINE IF
015393,000080: 
015394,000081:                                                                                                  #       A)  AM LESS THAN .25 DEGREES (MINANG)
015395,000082:                                                                                                  #       B)  AM GREATER THAN 170 DEGREES (MAXANG)
015396,000083: 
015397,000084:                                                                                                  #       IF AM LESS THAN .25 DEGREES, NO COMPLICATED AUTOMATIC MANEUVERING IS NECESSARY.  THEREFORE WE CAN SIMPLY
015398,000085:                                                                                                  #  SET CDU DESIRED EQUAL TO THE FINAL CDU DESIRED ANGLES AND TERMINATE THE JOB.
015399,000086: 
015400,000087:                                                                                                  #       IF AM IS GREATER THAN .25 DEGREES BUT LESS THAN 170 DEGREES, THE AXES OF THE SINGLE EQUIVALENT ROTATION
015401,000088:                                                                                                  #    -                                                       *
015402,000089:                                                                                                  #  (COF) IS EXTRACTED FROM THE SKEW SYMMETRIC COMPONENTS OF MFI.                            *     *
015403,000090:                                                                                                  #       IF AM GREATER THAN 170 DEGREES AN ALTERNATE METHOD EMPLOYING THE SYMMETRIC PART OF MFI (MFISYM) IS USED
015404,000091:                                                                                                  #                -
015405,000092:                                                                                                  #  TO DETERMINE COF.
015406,000093: 
015407,000094:                                                                                                  #       THE PROGRAM THEN CHECKS TO SEE IF THE MANEUVER AS COMPUTED WILL BRING THE S/C THROUGH GIMBAL LOCK.  IF
015408,000095:                                                                                                  #  SO, A NEW MANEUVER IS CALCULATED WHICH WILL JUST SKIM THE GIMBAL LOCK ZONE AND ALIGN THE S/C X-AXIS.  THIS
015409,000096:                                                                                                  #  METHOD ASSURES THAT THE ADDITIONAL MANEUVERING TO AVOID GIMBAL LOCK WILL BE KEPT TO A MINIMUM.  SINCE A FINAL
015410,000097:                                                                                                  #  P AXIS YAW WILL BE NECESSARY, A SWITCH IS RESET (STATE SWITCH 31) TO ALLOW FOR THE COMPUTATION OF THIS FINAL
015411,000098:                                                                                                  #  YAW.
015412,000099: 
015413,000100:                                                                                                  #       AS STATED PREVIOUSLY KALCMANU GENERATES A SEQUENCE OF DESIRED GIMBAL ANGLES WHICH ARE UPDATED EVERY
015414,000101:                                                                                                  #                                                                                               -
015415,000102:                                                                                                  #  SECOND.  THIS IS ACCOMPLISHED BY A SMALL ROTATION OF THE DESIRED S/C FRAME ABOUT THE VECTOR COF.  THE NEW
015416,000103:                                                                                                  #  DESIRED REFERENCE MATRIX IS THEN,
015417,000104: 
015418,000105:                                                                                                  #                   *              *         *
015419,000106:                                                                                                  #                  MIS       =    MIS       DEL
015420,000107:                                                                                                  #                     N+1             N
015421,000108:                                                                                                  #         *
015422,000109:                                                                                                  #  WHERE DEL IS THE MATRIX CORRESPONDING TO THIS SMALL ROTATION.  THE NEW CDU ANGLES CAN THEN BE EXTRACTED
015423,000110:                                                                                                  #        *
015424,000111:                                                                                                  #  FROM MIS.
015425,000112: 
015426,000113:                                                                                                  #       AT THE BEGINNING OF THE MANEUVER THE AUTOPILOT DESIRED RATES (OMEGAPD, OMEGAQD, OMEGARD) AND THE
015427,000114:                                                                                                  #  MANEUVER TIMINGS ARE ESTABLISHED.  ON THE FIRST PASS AND ON ALL SUBSEQUENT UPDATES THE CDU DESIRED
015428,000115:                                                                                                  #  ANGLES ARE LOADED WITH THE APPROPRIATE VALUES AND THE INCREMENTAL CDU ANGLES ARE COMPUTED.  THE AGC CLOCKS
015429,000116:                                                                                                  #  (TIME1 AND TIME2) ARE THAN CHECKED TO SEE IF THE MANEUVER WILL TERMINATE BEFORE THE NEXT UPDATE.  IF
015430,000117:                                                                                                  #  NOT, KALCMANU CALLS FOR ANOTHER UPDATE (RUN AS A JOB WITH PRIORITY TBD) IN ONE SECOND.  ANY DELAYS IN THIS
015431,000118:                                                                                                  #  CALLING SEQUENCE ARE AUTOMATICALLY COMPENSATED IN CALLING FOR THE NEXT UPDATE.
015432,000119: 
015433,000120:                                                                                                  #       IF IT IS FOUND THAT THE MANEUVER IS TO TERMINATE BEFORE THE NEXT UPDATE A ROUTINE IS CALLED (AS A WAIT-
015434,000121:                                                                                                  #  LIST TASK) TO STOP THE MANEUVER AT THE APPROPRIATE TIME AS EXPLAINED ABOVE.
015435,000122: 

Page 349

015437,000124:                                                                                                  #  CALLING SEQUENCE
015438,000125: 
015439,000126:                                                                                                  #       IN ORDER TO PERFORM A KALCMANU SUPERVISED MANEUVER, THE COMMANDED GIMBAL ANGLES MUST BE PRECOMPUTED AND
015440,000127:                                                                                                  #  STORED IN LOCATIONS CPHI, CTHETA, CPSI.  THE USER:S PROGRAM MUST THEN CLEAR STATE SWITCH NO 33 TO ALLOW THE
015441,000128:                                                                                                  #  ATTITUDE MANEUVER ROUTINE TO PERFORM ANY FINAL P-AXIS YAW INCURRED BY AVOIDING GIMBAL LOCK.  THE MANEUVER IS
015442,000129:                                                                                                  #  THEN INITIATED BY ESTABLISHING THE FOLLOWING EXECUTIVE JOB
015443,000130: 
015444,000131:                                                                                                  #                         *
015445,000132:                                                                                                  #       CAF     PRIO    XX
015446,000133:                                                                                                  #                       --
015447,000134:                                                                                                  #       INHINT
015448,000135:                                                                                                  #       TC         FINDVAC
015449,000136:                                                                                                  #       2CADR      KALCMAN3
015450,000137:                                                                                                  #       RELINT
015451,000138: 
015452,000139:                                                                                                  #  THE USER:S PROGRAM MAY EITHER CONTINUE OR WAIT FOR THE TERMINATION OF THE MANEUVER.  IF THE USER WISHES TO
015453,000140:                                                                                                  #  WAIT, HE MAY PUT HIS JOB TO SLEEP WITH THE FOLLOWING INSTRUCTIONS
015454,000141: 
015455,000142:                                                                                                  #       L          TC        BANKCALL
015456,000143:                                                                                                  #       L+1        CADR      ATTSTALL
015457,000144:                                                                                                  #       L+2        (BAD      RETURN)
015458,000145:                                                                                                  #       L+3        (GOOD     RETURN)
015459,000146: 
015460,000147:                                                                                                  #       UPON COMPLETION OF THE MANEUVER, THE PROGRAM WILL BE AWAKENED AT L+3 IF THE MANEUVER WAS COMPLETED
015461,000148:                                                                                                  #  SUCCESSFULLY, OR AT L+2 IF THE MANEUVER WAS ABORTED.  THIS ABORT WOULD OCCUR IF THE INITIAL OR FINAL ATTITUDE
015462,000149:                                                                                                  #  WAS IN GIMBAL LOCK.
015463,000150: 
015464,000151:                                                                                                  #  ***NOTA BENE***  IT IS ASSUMED THAT THE DESIRED MANEUVERING RATE (0.5, 2, 5, 10, DEG/SEC) HAS BEEN SELECTED BY
015465,000152:                                                                                                  #  KEYBOARD ENTRY PRIOR TO THE EXECUTION OF KALCMANU.
015466,000153:                                                                                                  #      IT IS ALSO ASSUMED THAT THE AUTOPILOT IS IN THE AUTO MODE.  IF THE MODE SWITCH IS CHANGED DURING THE
015467,000154:                                                                                                  #  MANEUVER, KALCMANU WILL TERMINATE VIA GOODEND WITHIN 1 SECOND SO THAT R60 MAY REQUEST A TRIM OF THE S/C ATTITUDE
015468,000155:                                                                                                  #  THIS IS THE ONLY MEANS FOR MANUALLY TERMINATING A KALCMANU SUPERVISED MANEUVER.
015469,000156:                                                                                                  #  SUBROUTINES
015470,000157: 
015471,000158:                                                                                                  #       KALCMANU USES A NUMBER OF INTERPRETIVE SUBROUTINES WHICH MAY BE OF GENERAL INTEREST.  SINCE THESE ROUTINES
015472,000159:                                                                                                  #  WERE PROGRAMMED EXCLUSIVELY FOR KALCMANU, THEY ARE NOT, AS YET, GENERALLY AVAILABLE FOR USE BY OTHER PROGRAMS.
015473,000160: 
015474,000161:                                                                                                  #       MXM3
015475,000162:                                                                                                  #       ----
015476,000163: 
015477,000164:                                                                                                  #       THIS SUBROUTINE MULTIPLIES TWO 3X3 MATRICES AND LEAVES THE RESULT IN THE FIRST 18 LOCATIONS OF THE PUSH
015478,000165:                                                                                                  #  DOWN LIST, I.E.,
015479,000166: 
015480,000167:                                                                                                  #                 (M    M    M )
015481,000168:                                                                                                  #                 (  0   1    2)
015482,000169:                                                                                                  #        *        (            )       *         *
015483,000170:                                                                                                  #        M    =   (M    M    M )  =    M1   X    M2
015484,000171:                                                                                                  #                 ( 3    4    5)
015485,000172:                                                                                                  #                 (            )
015486,000173:                                                                                                  #                 (M    M    M )
015487,000174: 

Page 350

015489,000176:                                                                                                  #                 ( 6    7    8)
015490,000177: 
015491,000178:                                                                                                  #                                                                                        *
015492,000179:                                                                                                  #       INDEX REGISTER X1 MUST BE LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M1, AND X2 MUST BE
015493,000180:                                                                                                  #                                                         *
015494,000181:                                                                                                  #  LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M2.   THE ROUTINE USES THE FIRST 20 LOCATIONS OF THE PUSH
015495,000182:                                                                                                  #  DOWN LIST.  THE FIRST ELEMENT OF THE MATRIX APPEARS IN PDO.  PUSH UP FOR M .
015496,000183:                                                                                                  #                                                                            8
015497,000184: 
015498,000185:                                                                                                  #       TRANSPOS
015499,000186:                                                                                                  #       --------
015500,000187: 
015501,000188:                                                                                                  #       THIS ROUTINE TRANSPOSES A 3X3 MATRIX AND LEAVES THE RESULT IN THE PUSH DOWN LIST, I.E.,
015502,000189: 
015503,000190:                                                                                                  #        *         * T
015504,000191:                                                                                                  #        M    =    M1
015505,000192: 
015506,000193:                                                                                                  #  INDEX REGISTER X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M1.  PUSH UP FOR THE FIRST AND SUB-
015507,000194:                                                                                                  #                        *
015508,000195:                                                                                                  #  SEQUENT COMPONENTS OF M.   THIS SUBROUTINE ALSO USES THE FIRST 20 LOCATIONS OF THE PUSH DOWN LIST.
015509,000196: 
015510,000197:                                                                                                  #       CDU TO DCM
015511,000198:                                                                                                  #       ----------
015512,000199: 
015513,000200:                                                                                                  #       THIS SUBROUTINE CONVERTS THREE CDU ANGLES IN T(MPAC) TO A DIRECTION COSINE MATRIX (SCALED BY 2) RELATING
015514,000201:                                                                                                  #  THE CORRESPONDING S/C ORIENTATIONS TO THE STABLE MEMBER FRAME.  THE FORMULAS FOR THIS CONVERSION ARE
015515,000202: 
015516,000203:                                                                                                  #        M    =    COSY  COSZ
015517,000204:                                                                                                  #         0
015518,000205: 
015519,000206:                                                                                                  #        M    =    -COSY  SINZ  COSX  +  SINY  SINX
015520,000207:                                                                                                  #         1
015521,000208: 
015522,000209:                                                                                                  #        M    =    COSY  SINZ  SINX  +  SINY  COSX
015523,000210:                                                                                                  #         2
015524,000211: 
015525,000212:                                                                                                  #        M    =    SINZ
015526,000213:                                                                                                  #         3
015527,000214: 
015528,000215:                                                                                                  #        M    =    COSZ  COSX
015529,000216:                                                                                                  #         4
015530,000217: 
015531,000218:                                                                                                  #        M    =    -COSZ  SINX
015532,000219:                                                                                                  #         5
015533,000220: 
015534,000221:                                                                                                  #        M    =    -SINY  COSZ
015535,000222:                                                                                                  #         6
015536,000223: 
015537,000224:                                                                                                  #        M    =    SINY  SINZ  COSX  +  COSY  SINX
015538,000225:                                                                                                  #         7
015539,000226: 

Page 351

015541,000228:                                                                                                  #        M    =    -SINY  SINZ  SINX  +  COSY  COSX
015542,000229:                                                                                                  #         8
015543,000230: 
015544,000231:                                                                                                  #  WHERE      X    =    OUTER GIMBAL ANGLE
015545,000232:                                                                                                  #             Y    =    INNER GIMBAL ANGLE
015546,000233:                                                                                                  #             Z    =    MIDDLE GIMBAL ANGLE
015547,000234: 
015548,000235:                                                                                                  #       THE INTERPRETATION OF THIS MATRIX IS AS FOLLOWS
015549,000236: 
015550,000237:                                                                                                  #       IF A , A , A  REPRESENT THE COMPONENTS OF A VECTOR IN S/C AXES THEN THE COMPONENTS OF THE SAME VECTOR IN
015551,000238:                                                                                                  #           X   Y   Z
015552,000239:                                                                                                  #  STABLE MEMBER AXES (B , B , B ) ARE
015553,000240:                                                                                                  #                       X   Y   Z
015554,000241: 
015555,000242:                                                                                                  #             (B )                (A )
015556,000243:                                                                                                  #             ( X)                ( X)
015557,000244:                                                                                                  #             (  )                (  )
015558,000245:                                                                                                  #             (  )           *    (  )
015559,000246:                                                                                                  #             (B )      =    M    (A )
015560,000247:                                                                                                  #             ( Y)                ( Y)
015561,000248:                                                                                                  #             (  )                (  )
015562,000249:                                                                                                  #             (B )                (A )
015563,000250:                                                                                                  #             ( Z)                ( Z)
015564,000251: 
015565,000252:                                                                                                  #      THE SUBROUTINE WILL STORE THIS MATRIX IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY AS SPECIFIED BY THE CALLING
015566,000253:                                                                                                  #                                                                                                              *
015567,000254:                                                                                                  #  PROGRAM.  TO DO THIS THE CALLING PROGRAM MUST FIRST LOAD X2 WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M.
015568,000255: 
015569,000256:                                                                                                  #       INTERNALLY, THE ROUTINE USES THE FIRST 16 LOCATIONS OF THE PUSH DOWN LIST, ALSO STEP REGISTER S1 AND INDEX
015570,000257:                                                                                                  #  REGISTER X2.
015571,000258: 
015572,000259: 
015573,000260:                                                                                                  #       DCM TO CDU
015574,000261:                                                                                                  #       ----------
015575,000262:                                                                                                  #                                                                            *
015576,000263:                                                                                                  #       THIS ROUTINE EXTRACTS THE CDU ANGLES FROM A DIRECTION COSINE MATRIX (M SCALED BY 2) RELATING S/C AXIS TO
015577,000264:                                                                                                  #                                                                                  *
015578,000265:                                                                                                  #  STABLE MEMBER AXES.  X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M.  THE SUBROUTINE LEAVES THE
015579,000266:                                                                                                  #  CORRESPONDING GIMBAL ANGLES IN V(MPAC) AS DOUBLE PRECISION 1:S COMPLEMENT ANGLES SCALED BY 2PI.  THE FORMULAS
015580,000267:                                                                                                  #  FOR THIS CONVERSION ARE
015581,000268: 
015582,000269:                                                                                                  #        Z    =    ARCSIN (M  )
015583,000270:                                                                                                  #                           3
015584,000271: 
015585,000272:                                                                                                  #        Y    =    ARCSIN (-M /COSZ)
015586,000273:                                                                                                  #                            6
015587,000274: 
015588,000275:                                                                                                  #  IF M  IS NEGATIVE, Y IS REPLACED BY PI SGN Y - Y
015589,000276:                                                                                                  #      0
015590,000277: 

Page 352

015592,000279:                                                                                                  #        X    =    ARCSIN (-M /COSZ)
015593,000280:                                                                                                  #                            5
015594,000281: 
015595,000282:                                                                                                  #  IF M  IS NEGATIVE X IS REPLACED BY PI SGN X - X
015596,000283:                                                                                                  #      4
015597,000284: 
015598,000285:                                                                                                  #       THIS ROUTINE DOES NOT SET THE PUSH DOWN POINTER, BUT USES THE NEXT 8 LOCATIONS OF THE PUSH DOWN LIST AND
015599,000286:                                                                                                  #  RETURNS THE POINTER TO ITS ORIGINAL SETTING.  THIS PROCEDURE ALLOWS THE CALLER TO STORE THE MATRIX AT THE TOP OF
015600,000287:                                                                                                  #  THE PUSH DOWN LIST.
015601,000288: 
015602,000289: 
015603,000290:                                                                                                  #       DELCOMP
015604,000291:                                                                                                  #       -------
015605,000292: 
015606,000293:                                                                                                  #                                                           *
015607,000294:                                                                                                  #       THIS ROUTINE COMPUTES THE DIRECTION COSINE MATRIX (DEL) RELATING ON
015608,000295:                                                                                                  #                                                                           -
015609,000296:                                                                                                  #  IS ROTATED WITH RESPECT TO THE FIRST BY AN ANGLE, A, ABOUT A UNIT VECTOR, U.  THE FORMULA FOR THIS MATRIX IS
015610,000297: 
015611,000298:                                                                                                  #        *         *           --T           *
015612,000299:                                                                                                  #        DEL  =    I  COSA  +  UU (1-COSA) + V SINA
015613,000300:                                                                                                  #                                             X
015614,000301: 
015615,000302:                                                                                                  #  WHERE      *         (1    0    0)
015616,000303:                                                                                                  #             I    =    (0    1    0)
015617,000304:                                                                                                  #                       (0    0    1)
015618,000305: 
015619,000306: 
015620,000307:                                                                                                  #                          2
015621,000308:                                                                                                  #                       (U         U U       U  U )
015622,000309:                                                                                                  #                       ( X         X Y       X  Z)
015623,000310:                                                                                                  #                       (                         )
015624,000311:                                                                                                  #             --T       (            2            )
015625,000312:                                                                                                  #             UU   =    (U U       U         U U  )
015626,000313:                                                                                                  #                       ( Y X       Y         Y Z )
015627,000314:                                                                                                  #                       (                         )
015628,000315:                                                                                                  #                       (                      2  )
015629,000316:                                                                                                  #                       (U U       U U       U   )
015630,000317:                                                                                                  #                       ( Z X       Z Y       Z   )
015631,000318: 
015632,000319: 
015633,000320:                                                                                                  #                       (0         -U        U  )
015634,000321:                                                                                                  #                       (            Z        Y )
015635,000322:                                                                                                  #             *         (                       )
015636,000323:                                                                                                  #             V    =    (U         0         -U )
015637,000324:                                                                                                  #              X        ( Z                    X)
015638,000325:                                                                                                  #                       (                       )
015639,000326:                                                                                                  #                       (-U        U         0  )
015640,000327:                                                                                                  #                       (  Y        X           )
015641,000328: 

Page 353

015643,000330:                                                                                                  #             -
015644,000331:                                                                                                  #             U    =    UNIT ROTATION VECTOR RESOLVED INTO S/C AXES
015645,000332:                                                                                                  #             A    =    ROTATION ANGLE
015646,000333: 
015647,000334:                                                                                                  #                              *
015648,000335:                                                                                                  #       THE INTERPRETATION OF DEL IS AS FOLLOWS
015649,000336: 
015650,000337:                                                                                                  #       IF A , A , A  REPRESENT THE COMPONENT OF A VECTOR INTHE ROTATED FRAME, THEN THE COMPONENTS OF THE SAME
015651,000338:                                                                                                  #           X   Y   Z
015652,000339:                                                                                                  #  VECTOR IN THE ORIGINAL S/C AXES (B , B , B ) ARE
015653,000340:                                                                                                  #                                    X   Y   Z
015654,000341: 
015655,000342:                                                                                                  #              (B )                    (A )
015656,000343:                                                                                                  #              ( X)                    ( X)
015657,000344:                                                                                                  #              (  )           *        (  )
015658,000345:                                                                                                  #              (B )     =    DEL       (A )
015659,000346:                                                                                                  #              ( Y)                    ( Y)
015660,000347:                                                                                                  #              (  )                    (  )
015661,000348:                                                                                                  #              (B )                    (A )
015662,000349:                                                                                                  #              ( Z)                    ( Z)
015663,000350: 
015664,000351:                                                                                                  #       THE ROUTINE WILL STORE THIS MATRIX (SCALED UNITY) IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY BEGINNING WITH
015665,000352:                                                                                                  #                                                                                              -
015666,000353:                                                                                                  #  THE LOCATION CALLED DEL.  IN ORDER TO USE THE ROUTINE, THE CALLING PROGRAM MUST FIRST STORE U (A HALF UNIT
015667,000354:                                                                                                  #  DOUBLE PRECISION VECTOR) IN THE SET OF ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS CALLED COF.  THE ANGLE, A,
015668,000355:                                                                                                  #  MUST THEN BE LOADED INTO D(MPAC).
015669,000356: 
015670,000357:                                                                                                  #       INTERNALLY, THE PROGRAM ALSO USES THE FIRST 10 LOCATIONS OF THE PUSH DOWN LIST.
015671,000358: 
015672,000359: 
015673,000360:                                                                                                  #       READCDUK
015674,000361:                                                                                                  #       --------
015675,000362: 
015676,000363:                                                                                                  #       THIS BASIC LANGUAGE SUBROUTINE LOADS T(MPAC) WITH THE THREE CDU ANGLES.
015677,000364: 
015678,000365: 
015679,000366:                                                                                                  #      SIGNMPAC
015680,000367:                                                                                                  #       --------
015681,000368: 
015682,000369:                                                                                                  #       THIS IS A BASIC LANGUAGE SUBROUTINE WHICH LIMITS THE MAGNITUDE OF D(MPAC) TO + OR - DPOSMAX ON OVERFLOW.
015683,000370: 
015684,000371: 
015685,000372:                                                                                                  #       PROGRAM STORAGE ALLOCATION
015686,000373: 
015687,000374:                                                                                                  #             1)   FIXED MEMORY                       1059 WORDS
015688,000375:                                                                                                  #             2)   ERASABLE MEMORY                      98
015689,000376:                                                                                                  #             3)   STATE SWITCHES                        3
015690,000377: 

Page 354

015692,000379:                                                                                                  #             4)   FLAGS                                 1
015693,000380: 
015694,000381:                                                                                                  #       JOB PRIORITIES
015695,000382: 
015696,000383:                                                                                                  #             1)   KALCMANU                            TBD
015697,000384:                                                                                                  #             2)   ONE SECOND UPDATE                   TBD
015698,000385: 
015699,000386: 
015700,000387:                                                                                                  #       SUMMARY OF STATE SWITCHES AND FLAGWORDS USED BY KALCMANU.
015701,000388: 
015702,000389: 
015703,000390:                                                                                                  #  STATE                FLAGWRD 2      SETTING             MEANING
015704,000391:                                                                                                  #  SWITCH NO.            BIT NO.
015705,000392: 
015706,000393:                                                                                                  #    *
015707,000394:                                                                                                  #  31                      14            0       MANEUVER WENT THROUGH GIMBAL LOCK
015708,000395:                                                                                                  #                                        1       MANEUVER DID NOT GO THROUGH GIMBAL LOCK
015709,000396: 
015710,000397:                                                                                                  #    *
015711,000398:                                                                                                  #  32                      13            0       CONTINUE UPDATE PROCESS
015712,000399:                                                                                                  #                                        1       START UPDATE PROCESS
015713,000400: 
015714,000401:                                                                                                  #  33                      12            0       PERFORM FINAL P-AXIS YAW IF REQUIRED
015715,000402:                                                                                                  #                                        1       IGNORE ANY FINAL P-AXIS YAW
015716,000403: 
015717,000404:                                                                                                  #  34                      11            0       SIGNAL END OF KALCMANU
015718,000405:                                                                                                  #                                        1       KALCMANU IN PROCESS       USER MUST SET SWITCH BEFORE INITIATING
015719,000406: 
015720,000407: 
015721,000408:                                                                                                  #          * INTERNAL TO KALCMANU
015722,000409: 
015723,000410: 
015724,000411:                                                                                                  #       SUGGESTIONS FOR PROGRAM INTEGRATION
015725,000412: 
015726,000413:                                                                                                  #       THE FOLLOWING VARIABLES SHOULD BE ASSIGNED TO UNSWITCH ERASABLE
015727,000414: 
015728,000415:                                                                                                  #                       CPHI
015729,000416:                                                                                                  #                       CTHETA
015730,000417:                                                                                                  #                       CPSI
015731,000418:                                                                                                  #                       POINTVSM  +5
015732,000419:                                                                                                  #                       SCAXIS    +5
015733,000420:                                                                                                  #                       DELDCDU
015734,000421:                                                                                                  #                       DELDCDU1
015735,000422:                                                                                                  #                       DELDCDU2
015736,000423:                                                                                                  #                       RATEINDX
015737,000424: 
015738,000425:                                                                                                  #       THE FOLLOWING SUBROUTINES MAY BE PUT IN A DIFFERENT BANK
015739,000426: 
015740,000427:                                                                                                  #                       MXM3

Page 355

015742,000429:                                                                                                  #                       TRANSPOS
015743,000430:                                                                                                  #                       SIGNMPAC
015744,000431:                                                                                                  #                       READCDUK
015745,000432:                                                                                                  #                       CDUTODCM
015746,000433: 

Page 356

015748,000435: 15,2050                                           BANK     15                                    
015749,000436: 22,2000                                           SETLOC   KALCMON1                              
015750,000437: 22,2000                                           BANK                                           
015751,000438: 
015752,000439: 22,2004  E6,1675                                  EBANK=   BCDU                                  
015753,000440: 
015754,000441:                                                                                                  #  THE THREE DESIRED CDU ANGLES MUST BE STORED AS SINGLE PRECISION TWOS COMPLEMENT ANGLES IN THE THREE SUCCESSIVE
015755,000442:                                                                                                  #  LOCATIONS, CPHI, CTHETA, CPSI.
015756,000443: 
015757,000444: 22,2004                                           COUNT*   $$/KALC                               
015758,000445: 22,2004           06051        KALCMAN3           TC       INTPRET                               #  PICK UP THE CURRENT CDU ANGLES AND
015759,000446: 22,2005           77634                           RTB                                            #    COMPUTE THE MATRIX FROM INITIAL S/C
015760,000447: 22,2006           44403                                    READCDUK                              #    AXES TO FINAL S/C AXES
015761,000448: 22,2007           03276                           STORE    BCDU                                  #  STORE INITIAL S/C ANGLES
015762,000449: 22,2010           51535                           SLOAD    ABS                                   #  CHECK THE MAGNITUDE OF THE DESIRED
015763,000450: 22,2011           00324                                    CPSI                                  #  MIDDLE GIMBAL ANGLE
015764,000451: 22,2012           51025                           DSU      BPL                                   
015765,000452: 22,2013           04403                                    LOCKANGL                              #  IF GREATER THAN 70 DEG ABORT MANEUVER
015766,000453: 22,2014           44724                                    TOOBADF                               
015767,000454: 22,2015           72364                           AXC,2    TLOAD                                 
015768,000455: 22,2016           03245                                    MIS                                   
015769,000456: 22,2017           03276                                    BCDU                                  
015770,000457: 22,2020           77624                           CALL                                           #  COMPUTE THE TRANSFORMATION FROM INITIAL
015771,000458: 22,2021           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES
015772,000459: 22,2022           72364                           AXC,2    TLOAD                                 
015773,000460: 22,2023           02221                                    MFS                                   #  PREPARE TO CALCULATE ARRAY MFS
015774,000461: 22,2024           00322                                    CPHI                                  
015775,000462: 22,2025           77624                           CALL                                           
015776,000463: 22,2026           44410                                    CDUTODCM                              
015777,000464: 22,2027           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED         $2
015778,000465: 22,2030           03245                                    MIS                                   
015779,000466: 22,2031           44326                                    TRANSPOS                              
015780,000467: 22,2032           45575                           VLOAD    STADR                                 
015781,000468: 22,2033           50460                           STOVL    TMIS       +12D                       
015782,000469: 22,2034           77626                           STADR                                          
015783,000470: 22,2035           50466                           STOVL    TMIS       +6                         
015784,000471: 22,2036           77626                           STADR                                          
015785,000472: 22,2037           74474                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
015786,000473: 22,2040           75160                           AXC,1    AXC,2                                 
015787,000474: 22,2041           03302                                    TMIS                                  
015788,000475: 22,2042           02221                                    MFS                                   
015789,000476: 22,2043           77624                           CALL                                           
015790,000477: 22,2044           44312                                    MXM3                                  
015791,000478: 22,2045           45575                           VLOAD    STADR                                 
015792,000479: 22,2046           51541                           STOVL    MFI        +12D                       
015793,000480: 22,2047           77626                           STADR                                          
015794,000481: 22,2050           51547                           STOVL    MFI        +6                         
015795,000482: 22,2051           77626                           STADR                                          
015796,000483: 22,2052           75555                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
015797,000484: 22,2053           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST
015798,000485: 

Page 357

015800,000487: 22,2054           00023                                    18D                                   
015801,000488: 22,2055           44335                                    TRNSPSPD                              
015802,000489: 22,2056           45575                           VLOAD    STADR                                 
015803,000490: 22,2057           50460                           STOVL    TMFI       +12D                       
015804,000491: 22,2060           77626                           STADR                                          
015805,000492: 22,2061           50466                           STOVL    TMFI       +6                         
015806,000493: 22,2062           77626                           STADR                                          
015807,000494: 22,2063           74474                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI) SCALED BY 4
015808,000495: 
015809,000496:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
015810,000497: 
015811,000498: 22,2064           45345                           DLOAD    DSU                                   
015812,000499: 22,2065           03305                                    TMFI       +2                         
015813,000500: 22,2066           02224                                    MFI        +2                         
015814,000501: 22,2067           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
015815,000502: 22,2070           02226                                    MFI        +4                         
015816,000503: 22,2071           03307                                    TMFI       +4                         
015817,000504: 22,2072           45325                           PDDL     DSU                                   
015818,000505: 22,2073           03315                                    TMFI       +10D                       
015819,000506: 22,2074           02234                                    MFI        +10D                       
015820,000507: 22,2075           77666                           VDEF                                           
015821,000508: 22,2076           03325                           STORE    COFSKEW                               #  EQUALS MFISKEW
015822,000509: 
015823,000510:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
015824,000511: 
015825,000512: 22,2077           43345                           DLOAD    DAD                                   
015826,000513: 22,2100           02222                                    MFI                                   
015827,000514: 22,2101           02242                                    MFI        +16D                       
015828,000515: 22,2102           43225                           DSU      DAD                                   
015829,000516: 22,2103           06510                                    DP1/4TH                               
015830,000517: 22,2104           02232                                    MFI        +8D                        
015831,000518: 22,2105           03333                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
015832,000519: 22,2106           77726                           ARCCOS                                         
015833,000520: 22,2107           03335                           STORE    AM                                    #  AM=ARCCOS(CAM)  (AM SCALED BY 2)
015834,000521: 22,2110           51025                           DSU      BPL                                   
015835,000522: 22,2111           04363                                    MINANG                                
015836,000523: 22,2112           44117                                    CHECKMAX                              
015837,000524: 22,2113           77751                           TLOAD                                          #  MANEUVER LESS THAN .25 DEGREES
015838,000525: 22,2114           00322                                    CPHI                                  #  GO DIRECTLY INTO ATTITUDE HOLD
015839,000526: 22,2115           37235                           STCALL   CDUXD                                 #  ABOUT COMMANDED ANGLES
015840,000527: 22,2116           44742                                    TOOBADI                               #  STOP RATE AND EXIT
015841,000528: 
015842,000529: 22,2117           45345        CHECKMAX           DLOAD    DSU                                   
015843,000530: 22,2120           03335                                    AM                                    
015844,000531: 22,2121           04365                                    MAXANG                                
015845,000532: 22,2122           77244                           BPL      VLOAD                                 
015846,000533: 22,2123           44131                                    ALTCALC                               #  UNIT
015847,000534: 22,2124           03325                                    COFSKEW                               #  COFSKEW
015848,000535: 22,2125           77656                           UNIT                                           
015849,000536: 22,2126           03270                           STORE    COF                                   #  COF IS THE MANEUVER AXIS
015850,000537: 

Page 358

015852,000539: 22,2127           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
015853,000540: 22,2130           44744                                    LOCSKIRT                              
015854,000541: 22,2131           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
015855,000542: 22,2132           02222                                    MFI                                   
015856,000543: 22,2133           03303                                    TMFI                                  
015857,000544: 22,2134           77762                           VSR1                                           
015858,000545: 22,2135           27303                           STOVL    MFISYM                                
015859,000546: 22,2136           02230                                    MFI        +6                         
015860,000547: 22,2137           74455                           VAD      VSR1                                  
015861,000548: 22,2140           03311                                    TMFI       +6                         
015862,000549: 22,2141           27311                           STOVL    MFISYM     +6                         
015863,000550: 22,2142           02236                                    MFI        +12D                       
015864,000551: 22,2143           74455                           VAD      VSR1                                  
015865,000552: 22,2144           03317                                    TMFI       +12D                       
015866,000553: 22,2145           03317                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
015867,000554: 
015868,000555: 
015869,000556:                                                                                                  #  CALCULATE COF
015870,000557: 
015871,000558: 
015872,000559: 22,2146           70545                           DLOAD    SR1                                   
015873,000560: 22,2147           03333                                    CAM                                   
015874,000561: 22,2150           45325                           PDDL     DSU                                   #  PDO CAM                                $4
015875,000562: 22,2151           06516                                    DPHALF                                
015876,000563: 22,2152           03333                                    CAM                                   
015877,000564: 22,2153           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                            $2
015878,000565: 22,2154           21674                                    SIGNMPAC                              
015879,000566: 22,2155           03323                                    MFISYM     +16D                       
015880,000567: 22,2156           56225                           DSU      DDV                                   
015881,000568: 22,2157           00001                                    0                                     
015882,000569: 22,2160           00003                                    2                                     
015883,000570: 22,2161           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
015884,000571: 22,2162           03313                                    MFISYM     +8D                        #                                 $ ROOT 2
015885,000572: 22,2163           56225                           DSU      DDV                                   
015886,000573: 22,2164           00001                                    0                                     
015887,000574: 22,2165           00003                                    2                                     
015888,000575: 22,2166           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM)   $ROOT2
015889,000576: 22,2167           03303                                    MFISYM                                
015890,000577: 22,2170           56225                           DSU      DDV                                   
015891,000578: 22,2171           00001                                    0                                     
015892,000579: 22,2172           00003                                    2                                     
015893,000580: 22,2173           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM)   $ROOT 2
015894,000581: 22,2174           77656                           UNIT                                           
015895,000582: 22,2175           03270                           STORE    COF                                   
015896,000583: 
015897,000584:                                                                                                  #  DETERMINE LARGEST COF AND ADJUST ACCORDINGLY
015898,000585: 
015899,000586: 22,2176           45345        COFMAXGO           DLOAD    DSU                                   
015900,000587: 22,2177           03270                                    COF                                   
015901,000588: 22,2200           03272                                    COF        +2                         
015902,000589: 22,2201           71240                           BMN      DLOAD                                 #  COFY G COFX
015903,000590: 

Page 359

015905,000592: 22,2202           44211                                    COMP12                                
015906,000593: 22,2203           03270                                    COF                                   
015907,000594: 22,2204           50025                           DSU      BMN                                   
015908,000595: 22,2205           03274                                    COF        +4                         
015909,000596: 22,2206           44266                                    METHOD3                               #  COFZ G COFX OR COFY
015910,000597: 22,2207           77650                           GOTO                                           
015911,000598: 22,2210           44242                                    METHOD1                               #  COFX G COFY OR COFZ
015912,000599: 22,2211           45345        COMP12             DLOAD    DSU                                   
015913,000600: 22,2212           03272                                    COF        +2                         
015914,000601: 22,2213           03274                                    COF        +4                         
015915,000602: 22,2214           77640                           BMN                                            
015916,000603: 22,2215           44266                                    METHOD3                               #  COFZ G COFY OR COFX
015917,000604: 
015918,000605: 22,2216           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
015919,000606: 22,2217           03327                                    COFSKEW    +2                         #  UY
015920,000607: 22,2220           44224                                    U2POS                                 
015921,000608: 22,2221           57575                           VLOAD    VCOMP                                 
015922,000609: 22,2222           03270                                    COF                                   
015923,000610: 22,2223           03270                           STORE    COF                                   
015924,000611: 22,2224           51145        U2POS              DLOAD    BPL                                   
015925,000612: 22,2225           03305                                    MFISYM     +2                         #  UX UY
015926,000613: 22,2226           44232                                    OKU21                                 
015927,000614: 22,2227           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
015928,000615: 22,2230           03270                                    COF                                   
015929,000616: 22,2231           03270                           STORE    COF                                   
015930,000617: 22,2232           51145        OKU21              DLOAD    BPL                                   
015931,000618: 22,2233           03315                                    MFISYM     +10D                       #  UY UZ
015932,000619: 22,2234           44744                                    LOCSKIRT                              
015933,000620: 22,2235           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
015934,000621: 22,2236           03274                                    COF        +4                         
015935,000622: 22,2237           03274                           STORE    COF        +4                         
015936,000623: 22,2240           77650                           GOTO                                           
015937,000624: 22,2241           44744                                    LOCSKIRT                              
015938,000625: 22,2242           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
015939,000626: 22,2243           03325                                    COFSKEW                               #  UX
015940,000627: 22,2244           44250                                    U1POS                                 
015941,000628: 22,2245           57575                           VLOAD    VCOMP                                 
015942,000629: 22,2246           03270                                    COF                                   
015943,000630: 22,2247           03270                           STORE    COF                                   
015944,000631: 22,2250           51145        U1POS              DLOAD    BPL                                   
015945,000632: 22,2251           03305                                    MFISYM     +2                         #  UX UY
015946,000633: 22,2252           44256                                    OKU12                                 
015947,000634: 22,2253           57545                           DLOAD    DCOMP                                 
015948,000635: 22,2254           03272                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
015949,000636: 22,2255           03272                           STORE    COF        +2                         
015950,000637: 22,2256           51145        OKU12              DLOAD    BPL                                   
015951,000638: 22,2257           03307                                    MFISYM     +4                         #  UX UZ
015952,000639: 22,2260           44744                                    LOCSKIRT                              
015953,000640: 22,2261           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
015954,000641: 22,2262           03274                                    COF        +4                         
015955,000642: 

Page 360

015957,000644: 22,2263           03274                           STORE    COF        +4                         
015958,000645: 22,2264           77650                           GOTO                                           
015959,000646: 22,2265           44744                                    LOCSKIRT                              
015960,000647: 22,2266           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX
015961,000648: 22,2267           03331                                    COFSKEW    +4                         #  UZ
015962,000649: 22,2270           44274                                    U3POS                                 
015963,000650: 22,2271           57575                           VLOAD    VCOMP                                 
015964,000651: 22,2272           03270                                    COF                                   
015965,000652: 22,2273           03270                           STORE    COF                                   
015966,000653: 22,2274           51145        U3POS              DLOAD    BPL                                   
015967,000654: 22,2275           03307                                    MFISYM     +4                         #  UX UZ
015968,000655: 22,2276           44302                                    OKU31                                 
015969,000656: 22,2277           57545                           DLOAD    DCOMP                                 
015970,000657: 22,2300           03270                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
015971,000658: 22,2301           03270                           STORE    COF                                   
015972,000659: 22,2302           51145        OKU31              DLOAD    BPL                                   
015973,000660: 22,2303           03315                                    MFISYM     +10D                       #  UY UZ
015974,000661: 22,2304           44744                                    LOCSKIRT                              
015975,000662: 22,2305           57545                           DLOAD    DCOMP                                 
015976,000663: 22,2306           03272                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
015977,000664: 22,2307           03272                           STORE    COF        +2                         
015978,000665: 22,2310           77650                           GOTO                                           
015979,000666: 22,2311           44744                                    LOCSKIRT                              

Page 361

015981,000668:                                                                                                  #  MATRIX OPERATIONS
015982,000669: 
015983,000670: 13,2207                                           BANK     13                                    
015984,000671: 22,2000                                           SETLOC   KALCMON2                              
015985,000672: 22,2000                                           BANK                                           
015986,000673: 
015987,000674: 22,2312  E6,1675                                  EBANK=   BCDU                                  
015988,000675: 
015989,000676: 22,2312           76601        MXM3               SETPD    VLOAD*                                #  MXM3 MULTIPLIES 2 3X3 MATRICES
015990,000677: 22,2313           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
015991,000678: 22,2314           00001                                    0,1                                   #  AND MPAC
015992,000679: 22,2315           62703                           VXM*     PDVL*                                 
015993,000680: 22,2316           77776                                    0,2                                   
015994,000681: 22,2317           00007                                    6,1                                   
015995,000682: 22,2320           62703                           VXM*     PDVL*                                 
015996,000683: 22,2321           77776                                    0,2                                   
015997,000684: 22,2322           00015                                    12D,1                                 
015998,000685: 22,2323           41503                           VXM*     PUSH                                  
015999,000686: 22,2324           77776                                    0,2                                   
016000,000687: 22,2325           77616                           RVQ                                            
016001,000688: 
016002,000689: 
016003,000690:                                                                                                  #  RETURN WITH M1XM2 IN PD LIST
016004,000691: 
016005,000692: 22,2326           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
016006,000693: 22,2327           00001                                    0                                     #   AND LEAVES RESULT IN PD LIST
016007,000694: 22,2330           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
016008,000695: 22,2331           62713                           PDVL*    PDVL*                                 
016009,000696: 22,2332           00007                                    6,1                                   
016010,000697: 22,2333           00015                                    12D,1                                 
016011,000698: 22,2334           77606                           PUSH                                           #  MATRIX IN PD
016012,000699: 22,2335           77776        TRNSPSPD           EXIT                                           #  ENTER WITH MATRIX AT 0 IN PD LIST
016013,000700: 22,2336           50120                           INDEX    FIXLOC                                
016014,000701: 22,2337           52013                           DXCH     12                                    
016015,000702: 22,2340           50120                           INDEX    FIXLOC                                
016016,000703: 22,2341           52017                           DXCH     16                                    
016017,000704: 22,2342           50120                           INDEX    FIXLOC                                
016018,000705: 22,2343           52013                           DXCH     12                                    
016019,000706: 22,2344           50120                           INDEX    FIXLOC                                
016020,000707: 22,2345           52015                           DXCH     14                                    
016021,000708: 22,2346           50120                           INDEX    FIXLOC                                
016022,000709: 22,2347           52005                           DXCH     4                                     
016023,000710: 22,2350           50120                           INDEX    FIXLOC                                
016024,000711: 22,2351           52015                           DXCH     14                                    
016025,000712: 22,2352           50120                           INDEX    FIXLOC                                
016026,000713: 22,2353           52003                           DXCH     2                                     
016027,000714: 22,2354           50120                           INDEX    FIXLOC                                
016028,000715: 22,2355           52007                           DXCH     6                                     
016029,000716: 22,2356           50120                           INDEX    FIXLOC                                
016030,000717: 22,2357           52003                           DXCH     2                                     
016031,000718: 

Page 362

016033,000720: 22,2360           06051                           TC       INTPRET                               
016034,000721: 22,2361           77616                           RVQ                                            
016035,000722: 
016036,000723: 15,2050                                           BANK     15                                    
016037,000724: 22,2000                                           SETLOC   KALCMON1                              
016038,000725: 22,2000                                           BANK                                           
016039,000726: 
016040,000727: 22,2362  E6,1675                                  EBANK=   BCDU                                  
016041,000728: 
016042,000729: 22,2362           00013 13563  MINANG             2DEC     0.00069375                            
016043,000730: 22,2364           17070 34343  MAXANG             2DEC     0.472222222                            
016044,000731:                                                                                                  #  GIMBAL LOCK CONSTANTS
016045,000732: 
016046,000733:                                                                                                  #  D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
016047,000734:                                                                                                  #           NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
016048,000735: 
016049,000736: 22,2366           15666 20443  SD                 2DEC     .433015                               #  = SIN(D)                        $2
016050,000737: 22,2370           33555 01106  K3S1               2DEC     .86603                                #  = SIN(D)                        $1
016051,000738: 22,2372           67777 77777  K4                 2DEC     -.25                                  #  = -COS(D)                       $2
016052,000739: 22,2374           04000 00000  K4SQ               2DEC     .125                                  #  = COS(D)COS(D)                  $2
016053,000740: 22,2376           00216 36323  SNGLCD             2DEC     .008725                               #  = SIN(NGL)COS(D)                $2
016054,000741: 22,2400           17773 00057  CNGL               2DEC     .499695                               #  COS(NGL)                        $2
016055,000742: 22,2402           14344        LOCKANGL           DEC      .388889                               #  = 70 DEGREES
016056,000743:                                                                                                  #  INTERPRETIVE SUBROUTINE TO READ THE CDU ANGLES
016057,000744: 
016058,000745: 22,2403           30034        READCDUK           CA       CDUZ                                  #  LOAD T(MPAC) WITH CDU ANGLES
016059,000746: 22,2404           54156                           TS       MPAC       +2                         
016060,000747: 22,2405           00006                           EXTEND                                         
016061,000748: 22,2406           30033                           DCA      CDUX                                  #  AND CHANGE MODE TO TRIPLE PRECISION
016062,000749: 22,2407           16510                           TCF      TLOAD      +6                         
016063,000750: 
016064,000751: 
016065,000752: 22,2410           66370        CDUTODCM           AXT,1    SSP                                   
016066,000753: 22,2411           00003                           OCT      3                                     
016067,000754: 22,2412           00051                                    S1                                    
016068,000755: 22,2413           00001                           OCT      1                                     #  SET XR1, S1, AND PD FOR LOOP
016069,000756: 22,2414           00010                           STORE    7                                     
016070,000757: 22,2415           77601                           SETPD                                          
016071,000758: 22,2416           00001                                    0                                     
016072,000759: 22,2417           47133        LOOPSIN            SLOAD*   RTB                                   
016073,000760: 22,2420           00013                                    10D,1                                 
016074,000761: 22,2421           21560                                    CDULOGIC                              
016075,000762: 

Page 363

016077,000764: 22,2422           00013                           STORE    10D                                   #  LOAD PD WITH  0 SIN(PHI)
016078,000765: 22,2423           65356                           SIN      PDDL                                  #                2 COS(PHI)
016079,000766: 22,2424           00013                                    10D                                   #                4 SIN(THETA)
016080,000767: 22,2425           41546                           COS      PUSH                                  #                6 COS(THETA)
016081,000768: 22,2426           71300                           TIX,1    DLOAD                                 #                8 SIN(PSI)
016082,000769: 22,2427           44417                                    LOOPSIN                               #               10 COS(PSI)
016083,000770: 22,2430           00007                                    6                                     
016084,000771: 22,2431           72405                           DMP      SL1                                   
016085,000772: 22,2432           00013                                    10D                                   
016086,000773: 22,2433           10001                           STORE    0,2                                   #  C0=COS(THETA)COS(PSI)
016087,000774: 22,2434           41345                           DLOAD    DMP                                   
016088,000775: 22,2435           00005                                    4                                     
016089,000776: 22,2436           00001                                    0                                     
016090,000777: 22,2437           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI))
016091,000778: 22,2440           00007                                    6                                     
016092,000779: 22,2441           00011                                    8D                                    
016093,000780: 22,2442           72405                           DMP      SL1                                   
016094,000781: 22,2443           00003                                    2                                     
016095,000782: 22,2444           72421                           BDSU     SL1                                   
016096,000783: 22,2445           00015                                    12D                                   
016097,000784: 22,2446           10003                           STORE    2,2                                   #  C1=-COS(THETA)SIN(PSI)COS(PHI)
016098,000785: 22,2447           41345                           DLOAD    DMP                                   
016099,000786: 22,2450           00003                                    2                                     
016100,000787: 22,2451           00005                                    4                                     
016101,000788: 22,2452           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
016102,000789: 22,2453           00007                                    6                                     
016103,000790: 22,2454           00011                                    8D                                    
016104,000791: 22,2455           72405                           DMP      SL1                                   
016105,000792: 22,2456           00001                                    0                                     
016106,000793: 22,2457           72415                           DAD      SL1                                   
016107,000794: 22,2460           00017                                    14D                                   
016108,000795: 22,2461           10005                           STORE    4,2                                   #  C2=COS(THETA)SIN(PSI)SIN(PHI)
016109,000796: 22,2462           77745                           DLOAD                                          
016110,000797: 22,2463           00011                                    8D                                    
016111,000798: 22,2464           10007                           STORE    6,2                                   #  C3=SIN(PSI)
016112,000799: 22,2465           77745                           DLOAD                                          
016113,000800: 22,2466           00013                                    10D                                   
016114,000801: 22,2467           72405                           DMP      SL1                                   
016115,000802: 22,2470           00003                                    2                                     
016116,000803: 22,2471           10011                           STORE    8D,2                                  #  C4=COS(PSI)COS(PHI)
016117,000804: 22,2472           41345                           DLOAD    DMP                                   
016118,000805: 22,2473           00013                                    10D                                   
016119,000806: 22,2474           00001                                    0                                     
016120,000807: 22,2475           72476                           DCOMP    SL1                                   
016121,000808: 22,2476           10013                           STORE    10D,2                                 #  C5=-COS(PSI)SIN(PHI)
016122,000809: 22,2477           41345                           DLOAD    DMP                                   
016123,000810: 22,2500           00005                                    4                                     
016124,000811: 22,2501           00013                                    10D                                   
016125,000812: 22,2502           72476                           DCOMP    SL1                                   
016126,000813: 22,2503           10015                           STORE    12D,2                                 #  C6=-SIN(THETA)COS(PSI)
016127,000814: 

Page 364

016129,000816: 22,2504           77745                           DLOAD                                          
016130,000817: 22,2505           72405                           DMP      SL1                                   #   (PUSH UP 7)
016131,000818: 22,2506           00011                                    8D                                    
016132,000819: 22,2507           41325                           PDDL     DMP                                   #   (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE4
016133,000820: 22,2510           00007                                    6                                     
016134,000821: 22,2511           00001                                    0                                     
016135,000822: 22,2512           72415                           DAD      SL1                                   #   (PUSH UP 7)
016136,000823: 22,2513           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
016137,000824: 22,2514           67760                           STORE    14D,2                                 #   +COS(THETA)SIN(PHI)
016138,000825: 22,2515           77745                           DLOAD                                          
016139,000826: 22,2516           72405                           DMP      SL1                                   #   (PUSH UP 6)
016140,000827: 22,2517           00011                                    8D                                    
016141,000828: 22,2520           41325                           PDDL     DMP                                   #   (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE4
016142,000829: 22,2521           00007                                    6                                     
016143,000830: 22,2522           00003                                    2                                     
016144,000831: 22,2523           72425                           DSU      SL1                                   #   (PUSH UP 6)
016145,000832: 22,2524           77626                           STADR                                          
016146,000833: 22,2525           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
016147,000834: 22,2526           77616                           RVQ                                            #   +COS(THETA)COS(PHI)
016148,000835: 
016149,000836:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
016150,000837: 
016151,000838:                                                                                                  #           *      *               --T           *
016152,000839:                                                                                                  #           DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)         SCALED 1
016153,000840: 
016154,000841:                                                                                                  #                 -
016155,000842:                                                                                                  #           WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
016156,000843:                                                                                                  #           A IS THE ANGLE OF ROTATION (DP SCALED 2)
016157,000844:                                                                                                  #                                              -
016158,000845:                                                                                                  #           UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
016159,000846: 
016160,000847: 22,2527           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
016161,000848: 22,2530           00001                                    0                                     
016162,000849: 22,2531           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
016163,000850: 22,2532           41546                           COS      PUSH                                  #  PD2 = COS(A)
016164,000851: 22,2533           65302                           SR2      PDDL                                  #  PD2 = COS(A)                            $8
016165,000852: 22,2534           41021                           BDSU     BOVB                                  
016166,000853: 22,2535           06516                                    DPHALF                                
016167,000854: 22,2536           21674                                    SIGNMPAC                              
016168,000855: 22,2537           77725                           PDDL                                           #  PD4 = 1-COS(A)
016169,000856: 
016170,000857:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
016171,000858: 
016172,000859: 22,2540           03270                                    COF                                   
016173,000860: 22,2541           41316                           DSQ      DMP                                   
016174,000861: 22,2542           00005                                    4                                     
016175,000862: 22,2543           52415                           DAD      SL3                                   
016176,000863: 22,2544           00003                                    2                                     
016177,000864: 22,2545           77604                           BOVB                                           
016178,000865: 22,2546           21674                                    SIGNMPAC                              
016179,000866: 

Page 365

016181,000868: 22,2547           16222                           STODL    KEL                                   #  UX UX(1-COS(A)) +COS(A)                $1
016182,000869: 22,2550           03272                                    COF        +2                         
016183,000870: 22,2551           41316                           DSQ      DMP                                   
016184,000871: 22,2552           00005                                    4                                     
016185,000872: 22,2553           52415                           DAD      SL3                                   
016186,000873: 22,2554           00003                                    2                                     
016187,000874: 22,2555           77604                           BOVB                                           
016188,000875: 22,2556           21674                                    SIGNMPAC                              
016189,000876: 22,2557           16232                           STODL    KEL        +8D                        #  UY UY(1-COS(A)) +COS(A)                $1
016190,000877: 22,2560           03274                                    COF        +4                         
016191,000878: 22,2561           41316                           DSQ      DMP                                   
016192,000879: 22,2562           00005                                    4                                     
016193,000880: 22,2563           52415                           DAD      SL3                                   
016194,000881: 22,2564           00003                                    2                                     
016195,000882: 22,2565           77604                           BOVB                                           
016196,000883: 22,2566           21674                                    SIGNMPAC                              
016197,000884: 22,2567           02242                           STORE    KEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)                $1
016198,000885: 
016199,000886:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
016200,000887: 
016201,000888: 22,2570           41345                           DLOAD    DMP                                   
016202,000889: 22,2571           03270                                    COF                                   
016203,000890: 22,2572           03272                                    COF        +2                         
016204,000891: 22,2573           72405                           DMP      SL1                                   
016205,000892: 22,2574           00005                                    4                                     
016206,000893: 22,2575           41325                           PDDL     DMP                                   #  D6  UX UY (1-COS A)                 $ 4
016207,000894: 22,2576           03274                                    COF        +4                         
016208,000895: 22,2577           00001                                    0                                     
016209,000896: 22,2600           43206                           PUSH     DAD                                   #  D8  UZ SIN A                        $ 4
016210,000897: 22,2601           00007                                    6                                     
016211,000898: 22,2602           41112                           SL2      BOVB                                  
016212,000899: 22,2603           21674                                    SIGNMPAC                              
016213,000900: 22,2604           16230                           STODL    KEL        +6                         
016214,000901: 22,2605           62421                           BDSU     SL2                                   
016215,000902: 22,2606           77604                           BOVB                                           
016216,000903: 22,2607           21674                                    SIGNMPAC                              
016217,000904: 22,2610           16224                           STODL    KEL        +2                         
016218,000905: 22,2611           03270                                    COF                                   
016219,000906: 22,2612           41205                           DMP      DMP                                   
016220,000907: 22,2613           03274                                    COF        +4                         
016221,000908: 22,2614           00005                                    4                                     
016222,000909: 22,2615           65352                           SL1      PDDL                                  #  D6  UX UZ (1-COS A)                 $ 4
016223,000910: 22,2616           03272                                    COF        +2                         
016224,000911: 22,2617           41405                           DMP      PUSH                                  #  D8  UY SIN(A)
016225,000912: 22,2620           00001                                    0                                     
016226,000913: 22,2621           62415                           DAD      SL2                                   
016227,000914: 22,2622           00007                                    6                                     
016228,000915: 22,2623           77604                           BOVB                                           
016229,000916: 22,2624           21674                                    SIGNMPAC                              
016230,000917: 22,2625           16226                           STODL    KEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)
016231,000918: 

Page 366

016233,000920: 22,2626           62421                           BDSU     SL2                                   
016234,000921: 22,2627           77604                           BOVB                                           
016235,000922: 22,2630           21674                                    SIGNMPAC                              
016236,000923: 22,2631           16236                           STODL    KEL        +12D                       #  UX UZ (1-COS(A))-UY SIN(A)
016237,000924: 22,2632           03272                                    COF        +2                         
016238,000925: 22,2633           41205                           DMP      DMP                                   
016239,000926: 22,2634           03274                                    COF        +4                         
016240,000927: 22,2635           00005                                    4                                     
016241,000928: 22,2636           65352                           SL1      PDDL                                  #  D6  UY UZ (1-COS(A))                $ 4
016242,000929: 22,2637           03270                                    COF                                   
016243,000930: 22,2640           41405                           DMP      PUSH                                  #  D8  UX SIN(A)
016244,000931: 22,2641           00001                                    0                                     
016245,000932: 22,2642           62415                           DAD      SL2                                   
016246,000933: 22,2643           00007                                    6                                     
016247,000934: 22,2644           77604                           BOVB                                           
016248,000935: 22,2645           21674                                    SIGNMPAC                              
016249,000936: 22,2646           16240                           STODL    KEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
016250,000937: 22,2647           62421                           BDSU     SL2                                   
016251,000938: 22,2650           77604                           BOVB                                           
016252,000939: 22,2651           21674                                    SIGNMPAC                              
016253,000940: 22,2652           02234                           STORE    KEL        +10D                       #  UY UZ (1-COS(A)) -UX SIN(A)
016254,000941: 22,2653           77616                           RVQ                                            
016255,000942: 
016256,000943: 
016257,000944:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
016258,000945:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
016259,000946:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
016260,000947:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
016261,000948: 
016262,000949:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS***
016263,000950: 
016264,000951:                                                                                                  #           C =COS(THETA)COS(PSI)
016265,000952:                                                                                                  #            0
016266,000953:                                                                                                  #           C =-COS(THETA)SIN(PSI)COS(PHI)+SI (THETA)SIN(PHI)
016267,000954:                                                                                                  #            1
016268,000955:                                                                                                  #           C =COS(THETA)SIN(PSI)SIN(PHI) + S N(THETA)COS(PHI)
016269,000956:                                                                                                  #            2
016270,000957:                                                                                                  #           C =SIN(PSI)
016271,000958:                                                                                                  #            3
016272,000959:                                                                                                  #           C =COS(PSI)COS(PHI)
016273,000960:                                                                                                  #            4
016274,000961:                                                                                                  #           C =-COS(PSI)SIN(PHI)
016275,000962:                                                                                                  #            5
016276,000963:                                                                                                  #           C =-SIN(THETA)COS(PSI)
016277,000964:                                                                                                  #            6
016278,000965:                                                                                                  #           C =SIN(THETA)SIN(PSI)COS(PHI)+COS THETA)SIN(PHI)
016279,000966:                                                                                                  #            7
016280,000967:                                                                                                  #           C =-SIN(THETA)SIN(PSI)SIN(PHI)+CO (THETA)COS(PHI)
016281,000968:                                                                                                  #            8
016282,000969: 

Page 367

016284,000971: 
016285,000972:                                                                                                  #           WHERE PHI = OGA
016286,000973:                                                                                                  #                 THETA = IGA
016287,000974:                                                                                                  #                 PSI = MGA
016288,000975: 
016289,000976: 22,2654           67543        DCMTOCDU           DLOAD*   ARCSIN                                
016290,000977: 22,2655           00007                                    6,1                                   
016291,000978: 22,2656           71406                           PUSH     COS                                   #  PD +0   PSI
016292,000979: 22,2657           41152                           SL1      BOVB                                  
016293,000980: 22,2660           21674                                    SIGNMPAC                              
016294,000981: 22,2661           00051                           STORE    S1                                    
016295,000982: 22,2662           57543                           DLOAD*   DCOMP                                 
016296,000983: 22,2663           00015                                    12D,1                                 
016297,000984: 22,2664           67471                           DDV      ARCSIN                                
016298,000985: 22,2665           00051                                    S1                                    
016299,000986: 22,2666           51123                           PDDL*    BPL                                   #  PD +2  THETA
016300,000987: 22,2667           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
016301,000988: 22,2670           44702                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
016302,000989: 22,2671           57545                           DLOAD    DCOMP                                 
016303,000990: 22,2672           43244                           BPL      DAD                                   
016304,000991: 22,2673           44677                                    SUHALFA                               
016305,000992: 22,2674           06516                                    DPHALF                                
016306,000993: 22,2675           77650                           GOTO                                           
016307,000994: 22,2676           44701                                    CALCPHI                               
016308,000995: 22,2677           77625        SUHALFA            DSU                                            
016309,000996: 22,2700           06516                                    DPHALF                                
016310,000997: 22,2701           77606        CALCPHI            PUSH                                           
016311,000998: 22,2702           57543        OKTHETA            DLOAD*   DCOMP                                 
016312,000999: 22,2703           00013                                    10D,1                                 
016313,001000: 22,2704           67471                           DDV      ARCSIN                                
016314,001001: 22,2705           00051                                    S1                                    
016315,001002: 22,2706           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI
016316,001003: 22,2707           00011                                    8D,1                                  
016317,001004: 22,2710           44722                                    OKPHI                                 
016318,001005: 22,2711           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
016319,001006: 22,2712           43244                           BPL      DAD                                   
016320,001007: 22,2713           44717                                    SUHALFAP                              
016321,001008: 22,2714           06516                                    DPHALF                                
016322,001009: 22,2715           77650                           GOTO                                           
016323,001010: 22,2716           44723                                    VECOFANG                              
016324,001011: 22,2717           52025        SUHALFAP           DSU      GOTO                                  
016325,001012: 22,2720           06516                                    DPHALF                                
016326,001013: 22,2721           44723                                    VECOFANG                              
016327,001014: 22,2722           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
016328,001015: 22,2723           43466        VECOFANG           VDEF     RVQ                                   
016329,001016: 

Page 368

016331,001018:                                                                                                  #  ROUTINES FOR TERMINATING THE AUTOMATIC MANEUVER AND RETURNING TO USER
016332,001019: 
016333,001020: 22,2724           77776        TOOBADF            EXIT                                           
016334,001021: 22,2725           05600                           TC       ALARM                                 
016335,001022: 22,2726           00401                           OCT      00401                                 
016336,001023: 
016337,001024: 22,2727           12732                           TCF      NOGO                                  #  DO NOT ZERO ATTITUDE ERRORS
016338,001025: 
016339,001026: 22,2730           04616                           TC       BANKCALL                              
016340,001027: 22,2731           40154                           CADR     ZATTEROR                              #  ZERO ATTITUDE ERRORS
016341,001028: 
016342,001029: 22,2732           04616        NOGO               TC       BANKCALL                              
016343,001030: 22,2733           40166                           CADR     STOPRATE                              #  STOP RATES
016344,001031: 
016345,001032: 22,2734           34752                           CAF      TWO                                   
016346,001033: 22,2735           00004                           INHINT                                         #  ALL RETURNS ARE NOW MADE VIA GOODEND
016347,001034: 22,2736           05214                           TC       WAITLIST                              
016348,001035: 22,2737  E6,1675                                  EBANK=   BCDU                                  
016349,001036: 22,2737           03234 44066                     2CADR    GOODMANU                              
016350,001037: 
016351,001038: 22,2741           15155                           TCF      ENDOFJOB                              
016352,001039: 
016353,001040: 22,2742           77776        TOOBADI            EXIT                                           
016354,001041: 22,2743           12732                           TCF      NOGO                                  

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