Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

014504,000002:                                                                                                  ## Copyright:   Public domain.
014505,000003:                                                                                                  ## Filename:    ATTITUDE_MANEUVER_ROUTINE.agc
014506,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
014507,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
014508,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
014509,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
014510,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
014511,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
014512,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
014513,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
014514,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
014515,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
014516,000014:                                                                                                  ##              the original YUL assembler.
014517,000015:                                                                                                  ##
014518,000016:                                                                                                  ## Assembler:   yaYUL
014519,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014520,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
014521,000019:                                                                                                  ## Pages:       342-363
014522,000020:                                                                                                  ## Mod history: 2009-05-16 RSB  Adapted from the corresponding 
014523,000021:                                                                                                  ##                              Luminary131 file, using page 
014524,000022:                                                                                                  ##                              images from Luminary 1A.
014525,000023:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
014526,000024:                                                                                                  ##                              and corrected the errors found.
014527,000025:                                                                                                  ##              2017-01-19 MAS  Corrected some USER'S to USER:S
014528,000026:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
014529,000027:                                                                                                  ##              2017-03-15 RSB  Comment-text fixes identified in 5-way
014530,000028:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
014531,000029:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
014532,000030: 
014533,000031:                                                                                                  ## This source code has been transcribed or otherwise adapted from
014534,000032:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
014535,000033:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
014536,000034:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
014537,000035:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
014538,000036:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
014539,000037:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
014540,000038:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
014541,000039:                                                                                                  ## actually created.
014542,000040:                                                                                                  ##
014543,000041:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
014544,000042:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
014545,000043:                                                                                                  ## the listing from which it was transcribed. It has been verified to
014546,000044:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
014547,000045:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
014548,000046:                                                                                                  ##
014549,000047:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
014550,000048:                                                                                                  ##
014551,000049:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
014552,000050: 

Page 342

014554,000052:                                                                                                  #  BLOCK 2 LGC ATTITUDE MANEUVER ROUTINE - KALCMANU
014555,000053: 
014556,000054:                                                                                                  #  MOD 2         DATE 5/1/67     BY DON KEENE
014557,000055: 
014558,000056:                                                                                                  #  PROGRAM DESCRIPTION
014559,000057: 
014560,000058:                                                                                                  #       KALCMANU IS A ROUTINE WHICH GENERATES COMMANDS FOR THE LM DAP TO CHANGE THE ATTITUDE OF THE SPACECRAFT
014561,000059:                                                                                                  #  DURING FREE FALL.  IT IS DESIGNED TO MANEUVER THE SPACECRAFT FROM ITS INITIAL ORIENTATION TO SOME DESIRED
014562,000060:                                                                                                  #  ORIENTATION SPECIFIED BY THE PROGRAM WHICH CALLS KALCMANU, AVOIDING GIMBAL LOCK IN THE PROCESS.  IN THE 
014563,000061:                                                                                                  #  MOD 2 VERSION, THIS DESIRED ATTITUDE IS SPECIFIED BY A SET OF THREE COMMANDED CDU ANGLES STORED AS 2S COMPLEMENT
014564,000062:                                                                                                  #  SINGLE PRECISION ANGLES IN THE THREE CONSECUTIVE LOCATIONS, CPHI, CTHETA, CPSI, WHERE
014565,000063: 
014566,000064:                                                                                                  #        CPHI = COMMANDED OUTER GIMBAL ANGLE
014567,000065:                                                                                                  #        CTHETA = COMMANDED INNER GIMBAL ANGLE
014568,000066:                                                                                                  #        CPSI = COMMANDED MIDDLE GIMBAL ANGLE
014569,000067: 
014570,000068:                                                                                                  #      WHEN POINTING A SPACECRAFT AXIS (E.I. X, Y, Z, THE AOT, THRUST AXIS, ETC) THE SUBROUTINE VECPOINT MAY BE
014571,000069:                                                                                                  #  USED TO GENERATE THIS SET OF DESIRED CDU ANGLES (SEE DESCRIPTION IN R60)   -
014572,000070:                                                                                                  #   WITH THIS INFORMATION KALCMANU DETERMINES THE DIRECTION OF THE SINGLE EQUIVALENT ROTATION (COF ALSO U) AND THE
014573,000071:                                                                                                  #  MAGNITUDE OF THE ROTATION (AM) TO BRING THE S/C FROM ITS INITIAL ORIENTATION TO ITS FINAL ORIENTATION.
014574,000072:                                                                                                  #  THIS DIRECTION REMAINS FIXED BOTH IN INERTIAL COORDINATES AND IN COMMANDED S/C AXES THROUGHOUT THE 
014575,000073:                                                                                                  #                   -
014576,000074:                                                                                                  #  MANEUVER.  ONCE COF AND AM HAVE BEEN DETERMINED, KALCMANU THEN EXAMINES THE MANEUVER TO SEE IF IT WILL BRING
014577,000075:                                                                                                  #                                       -
014578,000076:                                                                                                  #  THE S/C THROUGH GIMBAL LOCK.  IF SO, COF AND AM ARE READJUSTED SO THAT THE S/C WILL JUST SKIM THE GIMBAL
014579,000077:                                                                                                  #  LOCK ZONE AND ALIGN THE X-AXIS.  IN GENERAL A FINAL YAW ABOUT X WILL BE NECESSARY TO COMPLETE THE MANEUVER.
014580,000078:                                                                                                  #  NEEDLESS TO SAY, NEITHER THE INITIAL NOR THE FINAL ORIENTATION CAN BE IN GIMBAL LOCK.
014581,000079: 
014582,000080:                                                                                                  #       FOR PROPER ATTITUDE CONTROL THE DIGITAL AUTOPILOT MUST BE GIVEN AN ATTITUDE REFERENCE WHICH IT CAN TRACK.
014583,000081:                                                                                                  #  KALCMANU DOES THIS BY GENERATING A REFERENCE OF DESIRED GIMBAL ANGLES (CDUXD, CDUYD, CDUZD) WHICH ARE UPDATED
014584,000082:                                                                                                  #  EVERY ONE SECOND DURING THE MANEUVER.  TO ACHIEVE A SMOOTHER SEQUENCE OF COMMANDS BETWEEN SUCCESSIVE UPDATES,
014585,000083:                                                                                                  #  THE PROGRAM ALSO GENERATES A SET OF INCREMENTAL CDU ANGLES (DELDCDU) TO BE ADDED TO CDU DESIRED BY THE DIGITAL
014586,000084:                                                                                                  #  AUTOPILOT.  KALCMANU ALSO CALCULATES THE COMPONENT MANEUVER RATES (OMEGAPD, OMEGAQD, OMEGARD), WHICH CAN
014587,000085:                                                                                                  #                                      -
014588,000086:                                                                                                  #  BE DETERMINED SIMPLY BY MULTIPLYING COF BY SOME SCALAR (ARATE) CORRESPONDING TO THE DESIRED ROTATIONAL RATE.
014589,000087: 
014590,000088:                                                                                                  #       AUTOMATIC MANEUVERS ARE TIMED WITH THE HELP OF WAITLIST SO THAT AFTER A SPECIFIED INTERVAL THE Y AND Z
014591,000089:                                                                                                  #  DESIRED RATES ARE SET TO ZERO AND THE DESIRED CDU ANGLES (CDUYD, CDUZD) ARE SET EQUAL TO THE FINAL DESIRED CDU
014592,000090:                                                                                                  #  ANGLES (CTHETA, CPSI).  IF ANY YAW REMAINS DUE TO GIMBAL LOCK AVOIDANCE, THE FINAL YAW MANEUVER IS
014593,000091:                                                                                                  #  CALCULATED AND THE DESIRED YAW RATE SET TO SOME FIXED VALUE (ROLLRATE = + OR - 2 DEGREES PER SEC).
014594,000092:                                                                                                  #  IN THIS CASE ONLY AN INCREMENTAL CDUX ANGLE (DELFROLL) IS SUPPLIED TO THE DAP.  AT THE END OF THE YAW
014595,000093:                                                                                                  #  MANEUVER OR IN THE EVENT THAT THERE WAS NO FINAL YAW, CDUXD IS SET EQUAL TO CPHI AND THE X-AXIS DESIRED
014596,000094:                                                                                                  #  RATE SET TO ZERO.  THUS, UPON COMPLETION OF THE MANEUVER THE S/C WILL FINISH UP IN A LIMIT CYCLE ABOUT THE
014597,000095:                                                                                                  #  DESIRED FINAL GIMBAL ANGLES.
014598,000096: 
014599,000097:                                                                                                  #  PROGRAM LOGIC FLOW
014600,000098: 
014601,000099:                                                                                                  #       KALCMANU IS CALLED AS A HIGH PRIORITY JOB WITH ENTRY POINTS AT KALCMAN3 AND VECPOINT.  IT FIRST PICKS
014602,000100:                                                                                                  #  UP THE CURRENT CDU ANGLES TO BE USED AS THE BASIS FOR ALL COMPUTATIONS INVOLVING THE INITIAL S/C ORIENTATION.

Page 343

014604,000102:                                                                                                  #  IT THEN DETERMINES THE DIRECTION COSINE MATRICES RELATING BOTH THE INITIAL AND FINAL S/C ORIENTATION TO STABLE
014605,000103:                                                                                                  #                *   *                                                                               *
014606,000104:                                                                                                  #  MEMBER AXES (MIS,MFS).  IT ALSO COMPUTES THE MATRIX RELATING FINAL S/C AXES TO INITIAL S/C AXES (MFI).  THE
014607,000105:                                                                                                  #  ANGLE OF ROTATION (AM) IS THEN EXTRACTED FROM THIS MATRIX, AND TESTS ARE MADE TO DETERMINE IF
014608,000106: 
014609,000107:                                                                                                  #        A)      AM LESS THAN .25 DEGREES (MINANG)
014610,000108:                                                                                                  #        B)      AM GREATER THAN 170 DEGREES (MAXANG)
014611,000109: 
014612,000110:                                                                                                  #  IF AM LESS THAN .25 DEGREES, NO COMPLICATED AUTOMATIC MANEUVERING IS NECESSARY.  THEREFORE WE CAN SIMPLY
014613,000111:                                                                                                  #  SET CDU DESIRED EQUAL TO THE FINAL CDU DESIRED ANGLES AND TERMINATE THE JOB.
014614,000112: 
014615,000113:                                                                                                  #  IF AM IS GREATER THAN .25 DEGREES BUT LESS THAN 170 DEGREES, THE AXES OF THE SINGLE EQUIVALENT ROTATION
014616,000114:                                                                                                  #    -                                                       *
014617,000115:                                                                                                  #  (COF) IS EXTRACTED FROM THE SKEW SYMMETRIC COMPONENTS OF MFI.                       *     *
014618,000116:                                                                                                  #  IF AM GREATER THAN 170 DEGREES AN ALTERNATE METHOD EMPLOYING THE SYMMETRIC PART OF MFI (MFISYM) IS USED
014619,000117:                                                                                                  #                -
014620,000118:                                                                                                  #  TO DETERMINE COF.
014621,000119: 
014622,000120:                                                                                                  #  THE PROGRAM THEN CHECKS TO SEE IF THE MANEUVER AS COMPUTED WILL BRING THE S/C THROUGH GIMBAL LOCK.  IF
014623,000121:                                                                                                  #  SO, A NEW MANEUVER IS CALCULATED WHICH WILL JUST SKIM THE GIMBAL LOCK ZONE AND ALIGN THE S/C X-AXIS.  THIS
014624,000122:                                                                                                  #  METHOD ASSURES THAT THE ADDITIONAL MANEUVERING TO AVOID GIMBAL LOCK WILL BE KEPT TO A MINIMUM.  SINCE A FINAL
014625,000123:                                                                                                  #  P AXIS YAW WILL BE NECESSARY, A SWITCH IS RESET (STATE SWITCH 31) TO ALLOW FOR THE COMPUTATION OF THIS FINAL
014626,000124:                                                                                                  #  YAW.
014627,000125: 
014628,000126:                                                                                                  #  AS STATED PREVIOUSLY KALCMANU GENERATES A SEQUENCE OF DESIRED GIMBAL ANGLES WHICH ARE UPDATED EVERY 
014629,000127:                                                                                                  #                                                                                               -
014630,000128:                                                                                                  #  SECOND.  THIS IS ACCOMPLISHED BY A SMALL ROTATION OF THE DESIRED S/C FRAME ABOUT THE VECTOR COF.  THE NEW
014631,000129:                                                                                                  #  DESIRED REFERENCE MATRIX IS THEN,
014632,000130:                                                                                                  #         *               *       *
014633,000131:                                                                                                  #        MIS     =       MIS     DEL
014634,000132:                                                                                                  #           N+1             N
014635,000133:                                                                                                  #         *
014636,000134:                                                                                                  #  WHERE DEL IS THE MATRIX CORRESPONDING TO THIS SMALL ROTATION.  THE NEW CDU ANGLES CAN THEN BE EXTRACTED
014637,000135:                                                                                                  #        *
014638,000136:                                                                                                  #  FROM MIS.
014639,000137: 
014640,000138:                                                                                                  #  AT THE BEGINNING OF THE MANEUVER THE AUTOPILOT DESIRED RATES (OMEGAPD, OMEGAQD, OMEGARD) AND THE 
014641,000139:                                                                                                  #  MANEUVER TIMINGS ARE ESTABLISHED.  ON THE FIRST PASS AND ON ALL SUBSEQUENT UPDATES THE CDU DESIRED
014642,000140:                                                                                                  #  ANGLES ARE LOADED WITH THE APPROPRIATE VALUES AND THE INCREMENTAL CDU ANGLES ARE COMPUTED.  THE AGC CLOCKS
014643,000141:                                                                                                  #  (TIME1 AND TIME2) ARE THAN CHECKED TO SEE IF THE MANEUVER WILL TERMINATE BEFORE THE NEXT UPDATE.  IF
014644,000142:                                                                                                  #  NOT, KALCMANU CALLS FOR ANOTHER UPDATE (RUN AS A JOB WITH PRIORITY TBD) IN ONE SECOND.  ANY DELAYS IN THIS
014645,000143:                                                                                                  #  CALLING SEQUENCE ARE AUTOMATICALLY COMPENSATED IN CALLING FOR THE NEXT UPDATE.
014646,000144: 
014647,000145:                                                                                                  #  IF IT IS FOUND THAT THE MANEUVER IS TO TERMINATE BEFORE THE NEXT UPDATE A ROUTINE IS CALLED (AS A WAIT-
014648,000146:                                                                                                  #  LIST TASK) TO STOP THE MANEUVER AT THE APPROPRIATE TIME AS EXPLAINED ABOVE.
014649,000147: 

Page 344

014651,000149:                                                                                                  #  CALLING SEQUENCE
014652,000150: 
014653,000151:                                                                                                  #  IN ORDER TO PERFORM A KALCMANU SUPERVISED MANEUVER, THE COMMANDED GIMBAL ANGLES MUST BE PRECOMPUTED AND
014654,000152:                                                                                                  #  STORED IN LOCATIONS CPHI, CTHETA, CPSI.  THE USER:S PROGRAM MUST THEN CLEAR STATE SWITCH NO 33 TO ALLOW THE 
014655,000153:                                                                                                  #  ATTITUDE MANEUVER ROUTINE TO PERFORM ANY FINAL P-AXIS YAW INCURRED BY AVOIDING GIMBAL LOCK.  THE MANEUVER IS
014656,000154:                                                                                                  #  THEN INITIATED BY ESTABLISHING THE FOLLOWING EXECUTIVE JOB
014657,000155:                                                                                                  #                       *
014658,000156:                                                                                                  #        CAF     PRIO XX
014659,000157:                                                                                                  #                     --
014660,000158:                                                                                                  #        INHINT
014661,000159:                                                                                                  #        TC      FINDVAC
014662,000160:                                                                                                  #        2CADR   KALCMAN3
014663,000161:                                                                                                  #        RELINT
014664,000162: 
014665,000163:                                                                                                  #  THE USER:S PROGRAM MAY EITHER CONTINUE OR WAIT FOR THE TERMINATION OF THE MANEUVER.  IF THE USER WISHES TO
014666,000164:                                                                                                  #  WAIT, HE MAY PUT HIS JOB TO SLEEP WITH THE FOLLOWING INSTRUCTIONS
014667,000165: 
014668,000166:                                                                                                  #        L       TC      BANKCALL
014669,000167:                                                                                                  #        L+1     CADR    ATTSTALL
014670,000168:                                                                                                  #        L+2     (BAD RETURN)
014671,000169:                                                                                                  #        L+3     (GOOD RETURN)
014672,000170: 
014673,000171:                                                                                                  #  UPON COMPLETION OF THE MANEUVER, THE PROGRAM WILL BE AWAKENED AT L+3 IF THE MANEUVER WAS COMPLETED
014674,000172:                                                                                                  #  SUCCESSFULLY, OR AT L+2 IF THE MANEUVER WAS ABORTED.  THIS ABORT WOULD OCCUR IF THE INITIAL OR FINAL ATTITUDE
014675,000173:                                                                                                  #  WAS IN GIMBAL LOCK.
014676,000174: 
014677,000175:                                                                                                  #  *** NOTA BENE ***  IT IS ASSUMED THAT THE DESIRED MANEUVERING RATE (0.5, 2, 5, 10, DEG/SEC) HAS BEEN SELECTED BY
014678,000176:                                                                                                  #  KEYBOARD ENTRY PRIOR TO THE EXECUTION OF KALCMANU.
014679,000177:                                                                                                  #  IT IS ALSO ASSUMED THAT THE AUTOPILOT IS IN THE AUTO MODE.  IF THE MODE SWITCH IS CHANGED DURING THE
014680,000178:                                                                                                  #  MANEUVER, KALCMANU WILL TERMINATE VIA GOODEND WITHIN 1 SECOND SO THAT R60 MAY REQUEST A TRIM OF THE S/C ATTITUDE
014681,000179:                                                                                                  #  THIS IS THE ONLY MEANS FOR MANUALLY TERMINATING A KALCMANU SUPERVISED MANEUVER.
014682,000180:                                                                                                  #  SUBROUTINES
014683,000181: 
014684,000182:                                                                                                  #  KALCMANU USES A NUMBER OF INTERPRETIVE SUBROUTINES WHICH MAY BE OF GENERAL INTEREST.  SINCE THESE ROUTINES
014685,000183:                                                                                                  #  WERE PROGRAMMED EXCLUSIVELY FOR KALCMANU, THEY ARE NOT, AS YET, GENERALLY AVAILABLE FOR USE BY OTHER PROGRAMS.
014686,000184: 
014687,000185:                                                                                                  #  MXM3
014688,000186:                                                                                                  #  ----
014689,000187: 
014690,000188:                                                                                                  #  THIS SUBROUTINE MULTIPLIES TWO 3X3 MATRICES AND LEAVES THE RESULT IN THE FIRST 18 LOCATIONS OF THE PUSH
014691,000189:                                                                                                  #  DOWN LIST, I.E.,
014692,000190:                                                                                                  #                        ( M     M     M  )
014693,000191:                                                                                                  #                        (  0     1     2 )
014694,000192:                                                                                                  #        *               (                )              *               *
014695,000193:                                                                                                  #        M       =       ( M     M     M  )      =       M1      X       M2
014696,000194:                                                                                                  #                        (  3     4     5 )
014697,000195:                                                                                                  #                        (                )
014698,000196:                                                                                                  #                        ( M     M     M  )

Page 345

014700,000198:                                                                                                  #                        (  6     7     8 )
014701,000199:                                                                                                  #                                                                                   *
014702,000200:                                                                                                  #  INDEX REGISTER X1 MUST BE LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M1, AND X2 MUST BE
014703,000201:                                                                                                  #                                                         *
014704,000202:                                                                                                  #  LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M2.  THE ROUTINE USES THE FIRST 20 LOCATIONS OF THE PUSH
014705,000203:                                                                                                  #  DOWN LIST.  THE FIRST ELEMENT OF THE MATRIX APPEARS IN PDO.  PUSH UP FOR M .
014706,000204:                                                                                                  #                                                                            8
014707,000205:                                                                                                  #  TRANSPOS
014708,000206:                                                                                                  #  --------
014709,000207: 
014710,000208:                                                                                                  #  THIS ROUTINE TRANSPOSES A 3X3 MATRIX AND LEAVES THE RESULT IN THE PUSH DOWN LIST, I.E.,
014711,000209:                                                                                                  #  
014712,000210:                                                                                                  #        *               * T
014713,000211:                                                                                                  #        M       =       M1
014714,000212: 
014715,000213:                                                                                                  #  INDEX REGISTER X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M1.  PUSH UP FOR THE FIRST AND SUB-
014716,000214:                                                                                                  #                         *
014717,000215:                                                                                                  #  SEQUENT COMPONENTS OF M.  THIS SUBROUTINE ALSO USES THE FIRST 20 LOCATIONS OF THE PUSH DOWN LIST.
014718,000216: 
014719,000217:                                                                                                  #  CDU TO DCM
014720,000218:                                                                                                  #  ----------
014721,000219: 
014722,000220:                                                                                                  #  THIS SUBROUTINE CONVERTS THREE CDU ANGLES IN T(MPAC) TO A DIRECTION COSINE MATRIX (SCALED BY 2) RELATING
014723,000221:                                                                                                  #  THE CORRESPONDING S/C ORIENTATIONS TO THE STABLE MEMBER FRAME.  THE FORMULAS FOR THIS CONVERSION ARE
014724,000222: 
014725,000223:                                                                                                  #        M       =       COSY COSZ
014726,000224:                                                                                                  #         0
014727,000225: 
014728,000226:                                                                                                  #        M       =       -COSY SINZ COSX + SINY SINX
014729,000227:                                                                                                  #         1
014730,000228: 
014731,000229:                                                                                                  #        M       =       COSY SINZ SINX + SINY COSX
014732,000230:                                                                                                  #         2
014733,000231: 
014734,000232:                                                                                                  #        M       =       SINZ
014735,000233:                                                                                                  #         3
014736,000234: 
014737,000235:                                                                                                  #        M       =       COSZ COSX
014738,000236:                                                                                                  #         4
014739,000237: 
014740,000238:                                                                                                  #        M       =       -COSZ SINX
014741,000239:                                                                                                  #         5
014742,000240: 
014743,000241:                                                                                                  #        M       =       -SINY COSZ
014744,000242:                                                                                                  #         6
014745,000243:                                                                                                  #        
014746,000244:                                                                                                  #        M       =       SINY SINZ COSX + COSY SINX
014747,000245:                                                                                                  #         7

Page 346

014749,000247:                                                                                                  #        M       =       -SINY SINZ SINX + COSY COSX
014750,000248:                                                                                                  #         8
014751,000249: 
014752,000250:                                                                                                  #  WHERE         X       =       OUTER GIMBAL ANGLE
014753,000251:                                                                                                  #                Y       =       INNER GIMBAL ANGLE
014754,000252:                                                                                                  #                Z       =       MIDDLE GIMBAL ANGLE
014755,000253: 
014756,000254:                                                                                                  #  THE INTERPRETATION OF THIS MATRIX IS AS FOLLOWS
014757,000255: 
014758,000256:                                                                                                  #  IF A , A , A  REPRESENT THE COMPONENTS OF A VECTOR IN S/C AXES THEN THE COMPONENTS OF THE SAME VECTOR IN
014759,000257:                                                                                                  #      X   Y   Z
014760,000258:                                                                                                  #  STABLE MEMBER AXES (B , B , B ) ARE
014761,000259:                                                                                                  #                       X   Y   Z
014762,000260: 
014763,000261:                                                                                                  #        ( B  )                  ( A  )
014764,000262:                                                                                                  #        (  X )                  (  X )
014765,000263:                                                                                                  #        (    )                  (    )
014766,000264:                                                                                                  #        (    )            *     (    )
014767,000265:                                                                                                  #        ( B  )     =      M     ( A  )
014768,000266:                                                                                                  #        (  Y )                  (  Y )
014769,000267:                                                                                                  #        (    )                  (    )
014770,000268:                                                                                                  #        ( B  )                  ( A  )
014771,000269:                                                                                                  #        (  Z )                  (  Z )
014772,000270: 
014773,000271:                                                                                                  #  THE SUBROUTINE WILL STORE THIS MATRIX IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY AS SPECIFIED BY THE CALLING
014774,000272:                                                                                                  #                                                                                                              *
014775,000273:                                                                                                  #  PROGRAM.  TO DO THIS THE CALLING PROGRAM MUST FIRST LOAD X2 WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M.
014776,000274: 
014777,000275:                                                                                                  #  INTERNALLY, THE ROUTINE USES THE FIRST 16 LOCATIONS OF THE PUSH DOWN LIST, ALSO STEP REGISTER S1 AND INDEX
014778,000276:                                                                                                  #  REGISTER X2.
014779,000277: 
014780,000278:                                                                                                  #  DCM TO CDU
014781,000279:                                                                                                  #  ----------
014782,000280:                                                                                                  #                                                                       *
014783,000281:                                                                                                  #  THIS ROUTINE EXTRACTS THE CDU ANGLES FROM A DIRECTION COSINE MATRIX (M SCALED BY 2) RELATING S/C AXIS TO
014784,000282:                                                                                                  #                                                                                  *
014785,000283:                                                                                                  #  STABLE MEMBER AXES.  X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M.  THE SUBROUTINE LEAVES THE
014786,000284:                                                                                                  #  CORRESPONDING GIMBAL ANGLES IN V(MPAC) AS DOUBLE PRECISION 1:S COMPLEMENT ANGLES SCALED BY 2PI.  THE FORMULAS
014787,000285:                                                                                                  #  FOR THIS CONVERSION ARE
014788,000286: 
014789,000287:                                                                                                  #        Z       =       ARCSIN (M  )
014790,000288:                                                                                                  #                                 3
014791,000289: 
014792,000290:                                                                                                  #        Y       =       ARCSIN (-M /COSZ)
014793,000291:                                                                                                  #                                  6
014794,000292: 
014795,000293:                                                                                                  #  IF M  IS NEGATIVE, Y IS REPLACED BY PI SGN Y - Y
014796,000294:                                                                                                  #      0

Page 347

014798,000296:                                                                                                  #        X       =       ARCSIN (-M /COSZ)
014799,000297:                                                                                                  #                                  5
014800,000298: 
014801,000299:                                                                                                  #  IF M  IS NEGATIVE X IS REPLACED BY PI SGN X - X
014802,000300:                                                                                                  #      4
014803,000301: 
014804,000302:                                                                                                  #  THIS ROUTINE DOES NOT SET THE PUSH DOWN POINTER, BUT USES THE NEXT 8 LOCATIONS OF THE PUSH DOWN LIST AND
014805,000303:                                                                                                  #  RETURNS THE POINTER TO ITS ORIGINAL SETTING.  THIS PROCEDURE ALLOWS THE CALLER TO STORE THE MATRIX AT THE TOP OF
014806,000304:                                                                                                  #  THE PUSH DOWN LIST.
014807,000305: 
014808,000306:                                                                                                  #  DELCOMP
014809,000307:                                                                                                  #  -------
014810,000308:                                                                                                  #                                                      *
014811,000309:                                                                                                  #  THIS ROUTINE COMPUTES THE DIRECTION COSINE MATRIX (DEL) RELATING ON
014812,000310:                                                                                                  #                                                                            -
014813,000311:                                                                                                  #  IS ROTATED WITH RESPECT TO THE FIRST BY AN ANGLE, A, ABOUT A UNIT VECTOR, U.  THE FORMULA FOR THIS MATRIX IS
014814,000312: 
014815,000313:                                                                                                  #         *              *        - -T              *
014816,000314:                                                                                                  #        DEL     =       I COSA + U U  (1 - COSA) + V  SINA
014817,000315:                                                                                                  #                                                    X
014818,000316: 
014819,000317:                                                                                                  #  WHERE         *               ( 1    0    0 )
014820,000318:                                                                                                  #                I       =       ( 0    1    0 )
014821,000319:                                                                                                  #                                ( 0    0    1 )
014822,000320: 
014823,000321:                                                                                                  #                                     2                             
014824,000322:                                                                                                  #                                (  U           U  U          U  U  )
014825,000323:                                                                                                  #                                (   X           X  Y          X  Z )
014826,000324:                                                                                                  #                                (                                  )
014827,000325:                                                                                                  #                - -T            (                 2                )
014828,000326:                                                                                                  #                U U     =       ( U  U          U            U  U  )
014829,000327:                                                                                                  #                                (  Y  X          Y            Y  Z )
014830,000328:                                                                                                  #                                (                                  )
014831,000329:                                                                                                  #                                (                               2  )
014832,000330:                                                                                                  #                                ( U  U         U  U           U    )
014833,000331:                                                                                                  #                                (  Z  X         Z  Y           Z   )
014834,000332: 
014835,000333: 
014836,000334:                                                                                                  #                                (   0           -U               U  )
014837,000335:                                                                                                  #                                (                 Z               Y )
014838,000336:                                                                                                  #                *               (                                   )
014839,000337:                                                                                                  #                V       =       (  U             0              -U  )
014840,000338:                                                                                                  #                 X              (   Z                             X )
014841,000339:                                                                                                  #                                (                                   )
014842,000340:                                                                                                  #                                ( -U             U               0  )
014843,000341:                                                                                                  #                                (   Y             X                 )
014844,000342: 

Page 348

014846,000344:                                                                                                  #        -
014847,000345:                                                                                                  #        U       =       UNIT ROTATION VECTOR RESOLVED INTO S/C AXES
014848,000346:                                                                                                  #        A       =       ROTATION ANGLE
014849,000347: 
014850,000348:                                                                                                  #                         *
014851,000349:                                                                                                  #  THE INTERPRETATION OF DEL IS AS FOLLOWS
014852,000350: 
014853,000351:                                                                                                  #  IF A , A , A  REPRESENT THE COMPONENT OF A VECTOR IN THE ROTATED FRAME, THEN THE COMPONENTS OF THE SAME
014854,000352:                                                                                                  #      X   Y   Z
014855,000353:                                                                                                  #  VECTOR IN THE ORIGINAL S/C AXES (B , B , B ) ARE
014856,000354:                                                                                                  #                                    X   Y   Z
014857,000355: 
014858,000356:                                                                                                  #        ( B  )                  ( A  )
014859,000357:                                                                                                  #        (  X )                  (  X )
014860,000358:                                                                                                  #        (    )            *     (    )
014861,000359:                                                                                                  #        ( B  )     =     DEL    ( A  )
014862,000360:                                                                                                  #        (  Y )                  (  Y )
014863,000361:                                                                                                  #        (    )                  (    )
014864,000362:                                                                                                  #        ( B  )                  ( A  )
014865,000363:                                                                                                  #        (  Z )                  (  Z )
014866,000364: 
014867,000365:                                                                                                  #  THE ROUTINE WILL STORE THIS MATRIX (SCALED UNITY) IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY BEGINNING WITH
014868,000366:                                                                                                  #                                                                                              -
014869,000367:                                                                                                  #  THE LOCATION CALLED DEL.  IN ORDER TO USE THE ROUTINE, THE CALLING PROGRAM MUST FIRST STORE U (A HALF UNIT
014870,000368:                                                                                                  #  DOUBLE PRECISION VECTOR) IN THE SET OF ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS CALLED COF.  THE ANGLE, A,
014871,000369:                                                                                                  #  MUST THEN BE LOADED INTO D(MPAC).
014872,000370:                                                                                                  #  
014873,000371:                                                                                                  #  INTERNALLY, THE PROGRAM ALSO USES THE FIRST 10 LOCATIONS OF THE PUSH DOWN LIST.
014874,000372: 
014875,000373:                                                                                                  #  READCDUK
014876,000374:                                                                                                  #  --------
014877,000375: 
014878,000376:                                                                                                  #  THIS BASIC LANGUAGE SUBROUTINE LOADS T(MPAC) WITH THE THREE CDU ANGLES.
014879,000377: 
014880,000378:                                                                                                  #  SIGNMPAC
014881,000379:                                                                                                  #  --------
014882,000380: 
014883,000381:                                                                                                  #  THIS IS A BASIC LANGUAGE SUBROUTINE WHICH LIMITS THE MAGNITUDE OF D(MPAC) TO + OR - DPOSMAX ON OVERFLOW.
014884,000382: 
014885,000383:                                                                                                  #  PROGRAM STORAGE ALLOCATION
014886,000384: 
014887,000385:                                                                                                  #        1)      FIXED MEMORY            1059 WORDS
014888,000386:                                                                                                  #        2)      ERASABLE MEMORY           98
014889,000387:                                                                                                  #        3)      STATE SWITCHES             3

Page 349

014891,000389:                                                                                                  #        4)      FLAGS                      1
014892,000390: 
014893,000391:                                                                                                  #  JOB PRIORITIES
014894,000392: 
014895,000393:                                                                                                  #        1)      KALCMANU                TBD
014896,000394:                                                                                                  #        2)      ONE SECOND UPDATE       TBD
014897,000395: 
014898,000396:                                                                                                  #  SUMMARY OF STATE SWITCHES AND FLAGWORDS USED BY KALCMANU.
014899,000397: 
014900,000398:                                                                                                  #        STATE           FLAGWRD 2       SETTING         MEANING
014901,000399:                                                                                                  #        SWITCH NO.      BIT NO.
014902,000400: 
014903,000401:                                                                                                  #          *
014904,000402:                                                                                                  #        31              14              0               MANEUVER WENT THROUGH GIMBAL LOCK
014905,000403:                                                                                                  #                                        1               MANEUVER DID NOT GO THROUGH GIMBAL LOCK
014906,000404:                                                                                                  #          *
014907,000405:                                                                                                  #        32              13              0               CONTINUE UPDATE PROCESS
014908,000406:                                                                                                  #                                        1               START UPDATE PROCESS
014909,000407: 
014910,000408:                                                                                                  #        33              12              0               PERFORM FINAL P-AXIS YAW IF REQUIRED
014911,000409:                                                                                                  #                                        1               IGNORE ANY FINAL P-AXIS YAW
014912,000410: 
014913,000411:                                                                                                  #        34              11              0               SIGNAL END OF KALCMANU
014914,000412:                                                                                                  #                                        1               KALCMANU IN PROCESS     USER MUST SET SWITCH BEFORE INITIATING
014915,000413: 
014916,000414:                                                                                                  #        * INTERNAL TO KALCMANU
014917,000415: 
014918,000416:                                                                                                  #  SUGGESTIONS FOR PROGRAM INTEGRATION
014919,000417: 
014920,000418:                                                                                                  #  THE FOLLOWING VARIABLES SHOULD BE ASSIGNED TO UNSWITCH ERASABLE
014921,000419: 
014922,000420:                                                                                                  #        CPHI
014923,000421:                                                                                                  #        CTHETA
014924,000422:                                                                                                  #        CPSI
014925,000423:                                                                                                  #        POINTVSM +5
014926,000424:                                                                                                  #        SCAXIS   +5
014927,000425:                                                                                                  #        DELDCDU
014928,000426:                                                                                                  #        DELDCDU1
014929,000427:                                                                                                  #        DELDCDU2
014930,000428:                                                                                                  #        RATEINDX
014931,000429: 
014932,000430:                                                                                                  #  THE FOLLOWING SUBROUTINES MAY BE PUT IN A DIFFERENT BANK
014933,000431: 
014934,000432:                                                                                                  #        MXM3

Page 350

014936,000434:                                                                                                  #        TRANSPOS
014937,000435:                                                                                                  #        SIGNMPAC
014938,000436:                                                                                                  #        READCDUK
014939,000437:                                                                                                  #        CDUTODCM
014940,000438: 

Page 351

014942,000440: 15,2050                                           BANK     15                                    
014943,000441: 22,2000                                           SETLOC   KALCMON1                              
014944,000442: 22,2000                                           BANK                                           
014945,000443: 
014946,000444: 22,2004  E6,1676                                  EBANK=   BCDU                                  
014947,000445: 
014948,000446:                                                                                                  #  THE THREE DESIRED CDU ANGLES MUST BE STORED AS SINGLE PRECISION TWOS COMPLEMENT ANGLES IN THE THREE SUCCESSIVE
014949,000447:                                                                                                  #  LOCATIONS, CPHI, CTHETA, CPSI.
014950,000448: 
014951,000449: 22,2004                                           COUNT*   $$/KALC                               
014952,000450: 22,2004           06037        KALCMAN3           TC       INTPRET                               #  PICK UP THE CURRENT CDU ANGLES AND
014953,000451: 22,2005           77634                           RTB                                            #        COMPUTE THE MATRIX FROM INITIAL S/C
014954,000452: 22,2006           44403                                    READCDUK                              #        AXES TO FINAL S/C AXES
014955,000453: 22,2007           03277                           STORE    BCDU                                  #  STORE INITIAL S/C ANGLES
014956,000454: 22,2010           51535                           SLOAD    ABS                                   #  CHECK THE MAGNITUDE OF THE DESIRED
014957,000455: 22,2011           00324                                    CPSI                                  #  MIDDLE GIMBAL ANGLE
014958,000456: 22,2012           51025                           DSU      BPL                                   
014959,000457: 22,2013           04403                                    LOCKANGL                              #  IF GREATER THAN 70 DEG ABORT MANEUVER
014960,000458: 22,2014           44724                                    TOOBADF                               
014961,000459: 22,2015           72364                           AXC,2    TLOAD                                 
014962,000460: 22,2016           03246                                    MIS                                   
014963,000461: 22,2017           03277                                    BCDU                                  
014964,000462: 22,2020           77624                           CALL                                           #  COMPUTE THE TRANSFORMATION FROM INITIAL
014965,000463: 22,2021           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES
014966,000464: 22,2022           72364                           AXC,2    TLOAD                                 
014967,000465: 22,2023           02230                                    MFS                                   #  PREPARE TO CALCULATE ARRAY MFS
014968,000466: 22,2024           00322                                    CPHI                                  
014969,000467: 22,2025           77624                           CALL                                           
014970,000468: 22,2026           44410                                    CDUTODCM                              
014971,000469: 22,2027           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED         $2
014972,000470: 22,2030           03246                                    MIS                                   
014973,000471: 22,2031           44326                                    TRANSPOS                              
014974,000472: 22,2032           45575                           VLOAD    STADR                                 
014975,000473: 22,2033           50457                           STOVL    TMIS       +12D                       
014976,000474: 22,2034           77626                           STADR                                          
014977,000475: 22,2035           50465                           STOVL    TMIS       +6                         
014978,000476: 22,2036           77626                           STADR                                          
014979,000477: 22,2037           74473                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
014980,000478: 22,2040           75160                           AXC,1    AXC,2                                 
014981,000479: 22,2041           03303                                    TMIS                                  
014982,000480: 22,2042           02230                                    MFS                                   
014983,000481: 22,2043           77624                           CALL                                           
014984,000482: 22,2044           44312                                    MXM3                                  
014985,000483: 22,2045           45575                           VLOAD    STADR                                 
014986,000484: 22,2046           51532                           STOVL    MFI        +12D                       
014987,000485: 22,2047           77626                           STADR                                          
014988,000486: 22,2050           51540                           STOVL    MFI        +6                         
014989,000487: 22,2051           77626                           STADR                                          
014990,000488: 22,2052           75546                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
014991,000489: 22,2053           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST

Page 352

014993,000491: 22,2054           00023                                    18D                                   
014994,000492: 22,2055           44335                                    TRNSPSPD                              
014995,000493: 22,2056           45575                           VLOAD    STADR                                 
014996,000494: 22,2057           50457                           STOVL    TMFI       +12D                       
014997,000495: 22,2060           77626                           STADR                                          
014998,000496: 22,2061           50465                           STOVL    TMFI       +6                         
014999,000497: 22,2062           77626                           STADR                                          
015000,000498: 22,2063           74473                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI) SCALED BY 4
015001,000499: 
015002,000500:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
015003,000501: 
015004,000502: 22,2064           45345                           DLOAD    DSU                                   
015005,000503: 22,2065           03306                                    TMFI       +2                         
015006,000504: 22,2066           02233                                    MFI        +2                         
015007,000505: 22,2067           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
015008,000506: 22,2070           02235                                    MFI        +4                         
015009,000507: 22,2071           03310                                    TMFI       +4                         
015010,000508: 22,2072           45325                           PDDL     DSU                                   
015011,000509: 22,2073           03316                                    TMFI       +10D                       
015012,000510: 22,2074           02243                                    MFI        +10D                       
015013,000511: 22,2075           77666                           VDEF                                           
015014,000512: 22,2076           03326                           STORE    COFSKEW                               #  EQUALS MFISKEW
015015,000513: 
015016,000514:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
015017,000515: 
015018,000516: 22,2077           43345                           DLOAD    DAD                                   
015019,000517: 22,2100           02231                                    MFI                                   
015020,000518: 22,2101           02251                                    MFI        +16D                       
015021,000519: 22,2102           43225                           DSU      DAD                                   
015022,000520: 22,2103           06512                                    DP1/4TH                               
015023,000521: 22,2104           02241                                    MFI        +8D                        
015024,000522: 22,2105           03334                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
015025,000523: 22,2106           77726                           ARCCOS                                         
015026,000524: 22,2107           03336                           STORE    AM                                    #  AM=ARCCOS(CAM)        (AM SCALED BY 2)
015027,000525: 22,2110           51025                           DSU      BPL                                   
015028,000526: 22,2111           04363                                    MINANG                                
015029,000527: 22,2112           44117                                    CHECKMAX                              
015030,000528: 22,2113           77751                           TLOAD                                          #  MANEUVER LESS THAN .25 DEGREES
015031,000529: 22,2114           00322                                    CPHI                                  #  GO DIRECTLY INTO ATTITUDE HOLD
015032,000530: 22,2115           37236                           STCALL   CDUXD                                 #  ABOUT COMMANDED ANGLES
015033,000531: 22,2116           44742                                    TOOBADI                               #  STOP RATE AND EXIT
015034,000532: 
015035,000533: 22,2117           45345        CHECKMAX           DLOAD    DSU                                   
015036,000534: 22,2120           03336                                    AM                                    
015037,000535: 22,2121           04365                                    MAXANG                                
015038,000536: 22,2122           77244                           BPL      VLOAD                                 
015039,000537: 22,2123           44131                                    ALTCALC                               #  UNIT
015040,000538: 22,2124           03326                                    COFSKEW                               #  COFSKEW
015041,000539: 22,2125           77656                           UNIT                                           
015042,000540: 22,2126           03271                           STORE    COF                                   #  COF IS THE MANEUVER AXIS

Page 353

015044,000542: 22,2127           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
015045,000543: 22,2130           44744                                    LOCSKIRT                              
015046,000544: 22,2131           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
015047,000545: 22,2132           02231                                    MFI                                   
015048,000546: 22,2133           03304                                    TMFI                                  
015049,000547: 22,2134           77762                           VSR1                                           
015050,000548: 22,2135           27304                           STOVL    MFISYM                                
015051,000549: 22,2136           02237                                    MFI        +6                         
015052,000550: 22,2137           74455                           VAD      VSR1                                  
015053,000551: 22,2140           03312                                    TMFI       +6                         
015054,000552: 22,2141           27312                           STOVL    MFISYM     +6                         
015055,000553: 22,2142           02245                                    MFI        +12D                       
015056,000554: 22,2143           74455                           VAD      VSR1                                  
015057,000555: 22,2144           03320                                    TMFI       +12D                       
015058,000556: 22,2145           03320                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
015059,000557: 
015060,000558:                                                                                                  #  CALCULATE COF
015061,000559: 
015062,000560: 22,2146           70545                           DLOAD    SR1                                   
015063,000561: 22,2147           03334                                    CAM                                   
015064,000562: 22,2150           45325                           PDDL     DSU                                   #  PDO CAM                               $4
015065,000563: 22,2151           06520                                    DPHALF                                
015066,000564: 22,2152           03334                                    CAM                                   
015067,000565: 22,2153           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                           $2
015068,000566: 22,2154           21712                                    SIGNMPAC                              
015069,000567: 22,2155           03324                                    MFISYM     +16D                       
015070,000568: 22,2156           56225                           DSU      DDV                                   
015071,000569: 22,2157           00001                                    0                                     
015072,000570: 22,2160           00003                                    2                                     
015073,000571: 22,2161           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
015074,000572: 22,2162           03314                                    MFISYM     +8D                        #                                $ ROOT 2
015075,000573: 22,2163           56225                           DSU      DDV                                   
015076,000574: 22,2164           00001                                    0                                     
015077,000575: 22,2165           00003                                    2                                     
015078,000576: 22,2166           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM)  $ROOT2
015079,000577: 22,2167           03304                                    MFISYM                                
015080,000578: 22,2170           56225                           DSU      DDV                                   
015081,000579: 22,2171           00001                                    0                                     
015082,000580: 22,2172           00003                                    2                                     
015083,000581: 22,2173           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM)  $ROOT 2
015084,000582: 22,2174           77656                           UNIT                                           
015085,000583: 22,2175           03271                           STORE    COF                                   
015086,000584: 
015087,000585:                                                                                                  #  DETERMINE LARGEST COF AND ADJUST ACCORDINGLY
015088,000586: 
015089,000587: 22,2176           45345        COFMAXGO           DLOAD    DSU                                   
015090,000588: 22,2177           03271                                    COF                                   
015091,000589: 22,2200           03273                                    COF        +2                         
015092,000590: 22,2201           71240                           BMN      DLOAD                                 #  COFY G COFX

Page 354

015094,000592: 22,2202           44211                                    COMP12                                
015095,000593: 22,2203           03271                                    COF                                   
015096,000594: 22,2204           50025                           DSU      BMN                                   
015097,000595: 22,2205           03275                                    COF        +4                         
015098,000596: 22,2206           44266                                    METHOD3                               #  COFZ G COFX OR COFY
015099,000597: 22,2207           77650                           GOTO                                           
015100,000598: 22,2210           44242                                    METHOD1                               #  COFX G COFY OR COFZ
015101,000599: 22,2211           45345        COMP12             DLOAD    DSU                                   
015102,000600: 22,2212           03273                                    COF        +2                         
015103,000601: 22,2213           03275                                    COF        +4                         
015104,000602: 22,2214           77640                           BMN                                            
015105,000603: 22,2215           44266                                    METHOD3                               #  COFZ G COFY OR COFX
015106,000604: 
015107,000605: 22,2216           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
015108,000606: 22,2217           03330                                    COFSKEW    +2                         #  UY
015109,000607: 22,2220           44224                                    U2POS                                 
015110,000608: 22,2221           57575                           VLOAD    VCOMP                                 
015111,000609: 22,2222           03271                                    COF                                   
015112,000610: 22,2223           03271                           STORE    COF                                   
015113,000611: 22,2224           51145        U2POS              DLOAD    BPL                                   
015114,000612: 22,2225           03306                                    MFISYM     +2                         #  UX UY
015115,000613: 22,2226           44232                                    OKU21                                 
015116,000614: 22,2227           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
015117,000615: 22,2230           03271                                    COF                                   
015118,000616: 22,2231           03271                           STORE    COF                                   
015119,000617: 22,2232           51145        OKU21              DLOAD    BPL                                   
015120,000618: 22,2233           03316                                    MFISYM     +10D                       #  UY UZ
015121,000619: 22,2234           44744                                    LOCSKIRT                              
015122,000620: 22,2235           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
015123,000621: 22,2236           03275                                    COF        +4                         
015124,000622: 22,2237           03275                           STORE    COF        +4                         
015125,000623: 22,2240           77650                           GOTO                                           
015126,000624: 22,2241           44744                                    LOCSKIRT                              
015127,000625: 22,2242           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
015128,000626: 22,2243           03326                                    COFSKEW                               #  UX
015129,000627: 22,2244           44250                                    U1POS                                 
015130,000628: 22,2245           57575                           VLOAD    VCOMP                                 
015131,000629: 22,2246           03271                                    COF                                   
015132,000630: 22,2247           03271                           STORE    COF                                   
015133,000631: 22,2250           51145        U1POS              DLOAD    BPL                                   
015134,000632: 22,2251           03306                                    MFISYM     +2                         #  UX UY
015135,000633: 22,2252           44256                                    OKU12                                 
015136,000634: 22,2253           57545                           DLOAD    DCOMP                                 
015137,000635: 22,2254           03273                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
015138,000636: 22,2255           03273                           STORE    COF        +2                         
015139,000637: 22,2256           51145        OKU12              DLOAD    BPL                                   
015140,000638: 22,2257           03310                                    MFISYM     +4                         #  UX UZ
015141,000639: 22,2260           44744                                    LOCSKIRT                              
015142,000640: 22,2261           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
015143,000641: 22,2262           03275                                    COF        +4                         

Page 355

015145,000643: 22,2263           03275                           STORE    COF        +4                         
015146,000644: 22,2264           77650                           GOTO                                           
015147,000645: 22,2265           44744                                    LOCSKIRT                              
015148,000646: 22,2266           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX
015149,000647: 22,2267           03332                                    COFSKEW    +4                         #  UZ
015150,000648: 22,2270           44274                                    U3POS                                 
015151,000649: 22,2271           57575                           VLOAD    VCOMP                                 
015152,000650: 22,2272           03271                                    COF                                   
015153,000651: 22,2273           03271                           STORE    COF                                   
015154,000652: 22,2274           51145        U3POS              DLOAD    BPL                                   
015155,000653: 22,2275           03310                                    MFISYM     +4                         #  UX UZ
015156,000654: 22,2276           44302                                    OKU31                                 
015157,000655: 22,2277           57545                           DLOAD    DCOMP                                 
015158,000656: 22,2300           03271                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
015159,000657: 22,2301           03271                           STORE    COF                                   
015160,000658: 22,2302           51145        OKU31              DLOAD    BPL                                   
015161,000659: 22,2303           03316                                    MFISYM     +10D                       #  UY UZ
015162,000660: 22,2304           44744                                    LOCSKIRT                              
015163,000661: 22,2305           57545                           DLOAD    DCOMP                                 
015164,000662: 22,2306           03273                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
015165,000663: 22,2307           03273                           STORE    COF        +2                         
015166,000664: 22,2310           77650                           GOTO                                           
015167,000665: 22,2311           44744                                    LOCSKIRT                              

Page 356

015169,000667:                                                                                                  #  MATRIX OPERATIONS
015170,000668: 
015171,000669: 13,2207                                           BANK     13                                    
015172,000670: 22,2000                                           SETLOC   KALCMON2                              
015173,000671: 22,2000                                           BANK                                           
015174,000672: 
015175,000673: 22,2312  E6,1676                                  EBANK=   BCDU                                  
015176,000674: 
015177,000675: 22,2312           76601        MXM3               SETPD    VLOAD*                                #  MXM3 MULTIPLIES 2 3X3 MATRICES
015178,000676: 22,2313           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
015179,000677: 22,2314           00001                                    0,1                                   #  AND MPAC
015180,000678: 22,2315           62703                           VXM*     PDVL*                                 
015181,000679: 22,2316           77776                                    0,2                                   
015182,000680: 22,2317           00007                                    6,1                                   
015183,000681: 22,2320           62703                           VXM*     PDVL*                                 
015184,000682: 22,2321           77776                                    0,2                                   
015185,000683: 22,2322           00015                                    12D,1                                 
015186,000684: 22,2323           41503                           VXM*     PUSH                                  
015187,000685: 22,2324           77776                                    0,2                                   
015188,000686: 22,2325           77616                           RVQ                                            
015189,000687: 
015190,000688:                                                                                                  #  RETURN WITH M1XM2 IN PD LIST
015191,000689: 
015192,000690: 22,2326           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
015193,000691: 22,2327           00001                                    0                                     #        AND LEAVES RESULT IN PD LIST
015194,000692: 22,2330           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
015195,000693: 22,2331           62713                           PDVL*    PDVL*                                 
015196,000694: 22,2332           00007                                    6,1                                   
015197,000695: 22,2333           00015                                    12D,1                                 
015198,000696: 22,2334           77606                           PUSH                                           #  MATRIX IN PD
015199,000697: 22,2335           77776        TRNSPSPD           EXIT                                           #  ENTER WITH MATRIX AT 0 IN PD LIST
015200,000698: 22,2336           50120                           INDEX    FIXLOC                                
015201,000699: 22,2337           52013                           DXCH     12                                    
015202,000700: 22,2340           50120                           INDEX    FIXLOC                                
015203,000701: 22,2341           52017                           DXCH     16                                    
015204,000702: 22,2342           50120                           INDEX    FIXLOC                                
015205,000703: 22,2343           52013                           DXCH     12                                    
015206,000704: 22,2344           50120                           INDEX    FIXLOC                                
015207,000705: 22,2345           52015                           DXCH     14                                    
015208,000706: 22,2346           50120                           INDEX    FIXLOC                                
015209,000707: 22,2347           52005                           DXCH     4                                     
015210,000708: 22,2350           50120                           INDEX    FIXLOC                                
015211,000709: 22,2351           52015                           DXCH     14                                    
015212,000710: 22,2352           50120                           INDEX    FIXLOC                                
015213,000711: 22,2353           52003                           DXCH     2                                     
015214,000712: 22,2354           50120                           INDEX    FIXLOC                                
015215,000713: 22,2355           52007                           DXCH     6                                     
015216,000714: 22,2356           50120                           INDEX    FIXLOC                                
015217,000715: 22,2357           52003                           DXCH     2                                     

Page 357

015219,000717: 22,2360           06037                           TC       INTPRET                               
015220,000718: 22,2361           77616                           RVQ                                            
015221,000719: 
015222,000720: 15,2050                                           BANK     15                                    
015223,000721: 22,2000                                           SETLOC   KALCMON1                              
015224,000722: 22,2000                                           BANK                                           
015225,000723: 
015226,000724: 22,2362  E6,1676                                  EBANK=   BCDU                                  
015227,000725: 
015228,000726: 22,2362           00013 13563  MINANG             2DEC     0.00069375                            
015229,000727: 
015230,000728: 22,2364           17070 34343  MAXANG             2DEC     0.472222222                            
015231,000729: 
015232,000730:                                                                                                  #  GIMBAL LOCK CONSTANTS
015233,000731: 
015234,000732:                                                                                                  #  D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
015235,000733:                                                                                                  #        NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
015236,000734: 
015237,000735: 22,2366           15666 20443  SD                 2DEC     .433015                               #  = SIN(D)                      $2
015238,000736: 
015239,000737: 22,2370           33555 01106  K3S1               2DEC     .86603                                #  = SIN(D)                      $1
015240,000738: 
015241,000739: 22,2372           67777 77777  K4                 2DEC     -.25                                  #  = -COS(D)                     $2
015242,000740: 
015243,000741: 22,2374           04000 00000  K4SQ               2DEC     .125                                  #  = COS(D)COS(D)                $2
015244,000742: 
015245,000743: 22,2376           00216 36323  SNGLCD             2DEC     .008725                               #  = SIN(NGL)COS(D)              $2
015246,000744: 
015247,000745: 22,2400           17773 00057  CNGL               2DEC     .499695                               #  COS(NGL)                      $2
015248,000746: 
015249,000747: 22,2402           14344        LOCKANGL           DEC      .388889                               #  = 70 DEGREES
015250,000748: 
015251,000749:                                                                                                  #  INTERPRETIVE SUBROUTINE TO READ THE CDU ANGLES
015252,000750: 
015253,000751: 22,2403           30034        READCDUK           CA       CDUZ                                  #  LOAD T(MPAC) WITH CDU ANGLES
015254,000752: 22,2404           54156                           TS       MPAC       +2                         
015255,000753: 22,2405           00006                           EXTEND                                         
015256,000754: 22,2406           30033                           DCA      CDUX                                  #  AND CHANGE MODE TO TRIPLE PRECISION
015257,000755: 22,2407           16476                           TCF      TLOAD      +6                         
015258,000756: 
015259,000757: 22,2410           66370        CDUTODCM           AXT,1    SSP                                   
015260,000758: 22,2411           00003                           OCT      3                                     
015261,000759: 22,2412           00051                                    S1                                    
015262,000760: 22,2413           00001                           OCT      1                                     #  SET XR1, S1, AND PD FOR LOOP
015263,000761: 22,2414           00010                           STORE    7                                     
015264,000762: 22,2415           77601                           SETPD                                          
015265,000763: 22,2416           00001                                    0                                     
015266,000764: 22,2417           47133        LOOPSIN            SLOAD*   RTB                                   
015267,000765: 22,2420           00013                                    10D,1                                 
015268,000766: 22,2421           21576                                    CDULOGIC                              

Page 358

015270,000768: 22,2422           00013                           STORE    10D                                   #  LOAD PD WITH  0 SIN(PHI)
015271,000769: 22,2423           65356                           SIN      PDDL                                  #                2 COS(PHI)
015272,000770: 22,2424           00013                                    10D                                   #                4 SIN(THETA)
015273,000771: 22,2425           41546                           COS      PUSH                                  #                6 COS(THETA)
015274,000772: 22,2426           71300                           TIX,1    DLOAD                                 #                8 SIN(PSI)
015275,000773: 22,2427           44417                                    LOOPSIN                               #                10 COS(PSI)
015276,000774: 22,2430           00007                                    6                                     
015277,000775: 22,2431           72405                           DMP      SL1                                   
015278,000776: 22,2432           00013                                    10D                                   
015279,000777: 22,2433           10001                           STORE    0,2                                   #  C0 = COS(THETA)COS(PSI)
015280,000778: 22,2434           41345                           DLOAD    DMP                                   
015281,000779: 22,2435           00005                                    4                                     
015282,000780: 22,2436           00001                                    0                                     
015283,000781: 22,2437           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI))
015284,000782: 22,2440           00007                                    6                                     
015285,000783: 22,2441           00011                                    8D                                    
015286,000784: 22,2442           72405                           DMP      SL1                                   
015287,000785: 22,2443           00003                                    2                                     
015288,000786: 22,2444           72421                           BDSU     SL1                                   
015289,000787: 22,2445           00015                                    12D                                   
015290,000788: 22,2446           10003                           STORE    2,2                                   #  C1=-COS(THETA)SIN(PSI)COS(PHI)
015291,000789: 22,2447           41345                           DLOAD    DMP                                   
015292,000790: 22,2450           00003                                    2                                     
015293,000791: 22,2451           00005                                    4                                     
015294,000792: 22,2452           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
015295,000793: 22,2453           00007                                    6                                     
015296,000794: 22,2454           00011                                    8D                                    
015297,000795: 22,2455           72405                           DMP      SL1                                   
015298,000796: 22,2456           00001                                    0                                     
015299,000797: 22,2457           72415                           DAD      SL1                                   
015300,000798: 22,2460           00017                                    14D                                   
015301,000799: 22,2461           10005                           STORE    4,2                                   #  C2=COS(THETA)SIN(PSI)SIN(PHI)
015302,000800: 22,2462           77745                           DLOAD                                          
015303,000801: 22,2463           00011                                    8D                                    
015304,000802: 22,2464           10007                           STORE    6,2                                   #  C3=SIN(PSI)
015305,000803: 22,2465           77745                           DLOAD                                          
015306,000804: 22,2466           00013                                    10D                                   
015307,000805: 22,2467           72405                           DMP      SL1                                   
015308,000806: 22,2470           00003                                    2                                     
015309,000807: 22,2471           10011                           STORE    8D,2                                  #  C4=COS(PSI)COS(PHI)
015310,000808: 22,2472           41345                           DLOAD    DMP                                   
015311,000809: 22,2473           00013                                    10D                                   
015312,000810: 22,2474           00001                                    0                                     
015313,000811: 22,2475           72476                           DCOMP    SL1                                   
015314,000812: 22,2476           10013                           STORE    10D,2                                 #  C5=-COS(PSI)SIN(PHI)
015315,000813: 22,2477           41345                           DLOAD    DMP                                   
015316,000814: 22,2500           00005                                    4                                     
015317,000815: 22,2501           00013                                    10D                                   
015318,000816: 22,2502           72476                           DCOMP    SL1                                   
015319,000817: 22,2503           10015                           STORE    12D,2                                 #  C6=-SIN(THETA)COS(PSI)

Page 359

015321,000819: 22,2504           77745                           DLOAD                                          
015322,000820: 22,2505           72405                           DMP      SL1                                   #  (PUSH UP 7)
015323,000821: 22,2506           00011                                    8D                                    
015324,000822: 22,2507           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE 4
015325,000823: 22,2510           00007                                    6                                     
015326,000824: 22,2511           00001                                    0                                     
015327,000825: 22,2512           72415                           DAD      SL1                                   #  (PUSH UP 7)
015328,000826: 22,2513           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
015329,000827: 22,2514           67760                           STORE    14D,2                                 #        +COS(THETA)SIN(PHI)
015330,000828: 22,2515           77745                           DLOAD                                          
015331,000829: 22,2516           72405                           DMP      SL1                                   #  (PUSH UP 6)
015332,000830: 22,2517           00011                                    8D                                    
015333,000831: 22,2520           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE 4
015334,000832: 22,2521           00007                                    6                                     
015335,000833: 22,2522           00003                                    2                                     
015336,000834: 22,2523           72425                           DSU      SL1                                   #  (PUSH UP 6)
015337,000835: 22,2524           77626                           STADR                                          
015338,000836: 22,2525           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
015339,000837: 22,2526           77616                           RVQ                                            #  +COS(THETA)COS(PHI)
015340,000838: 
015341,000839:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
015342,000840: 
015343,000841:                                                                                                  #         *         *           --T           *
015344,000842:                                                                                                  #        DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)          SCALED 1
015345,000843:                                                                                                  #              -
015346,000844:                                                                                                  #        WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
015347,000845:                                                                                                  #        A IS THE ANGLE OF ROTATION (DP SCALED 2)
015348,000846:                                                                                                  #                                            -
015349,000847:                                                                                                  #        UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
015350,000848: 
015351,000849: 22,2527           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
015352,000850: 22,2530           00001                                    0                                     
015353,000851: 22,2531           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
015354,000852: 22,2532           41546                           COS      PUSH                                  #  PD2 = COS(A)
015355,000853: 22,2533           65302                           SR2      PDDL                                  #  PD2 = COS(A)                          $8
015356,000854: 22,2534           41021                           BDSU     BOVB                                  
015357,000855: 22,2535           06520                                    DPHALF                                
015358,000856: 22,2536           21712                                    SIGNMPAC                              
015359,000857: 22,2537           77725                           PDDL                                           #  PD4 = 1-COS(A)
015360,000858: 
015361,000859:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
015362,000860: 
015363,000861: 22,2540           03271                                    COF                                   
015364,000862: 22,2541           41316                           DSQ      DMP                                   
015365,000863: 22,2542           00005                                    4                                     
015366,000864: 22,2543           52415                           DAD      SL3                                   
015367,000865: 22,2544           00003                                    2                                     
015368,000866: 22,2545           77604                           BOVB                                           
015369,000867: 22,2546           21712                                    SIGNMPAC                              

Page 360

015371,000869: 22,2547           16231                           STODL    KEL                                   #  UX UX(1-COS(A)) +COS(A)               $1
015372,000870: 22,2550           03273                                    COF        +2                         
015373,000871: 22,2551           41316                           DSQ      DMP                                   
015374,000872: 22,2552           00005                                    4                                     
015375,000873: 22,2553           52415                           DAD      SL3                                   
015376,000874: 22,2554           00003                                    2                                     
015377,000875: 22,2555           77604                           BOVB                                           
015378,000876: 22,2556           21712                                    SIGNMPAC                              
015379,000877: 22,2557           16241                           STODL    KEL        +8D                        #  UY UY(1-COS(A)) +COS(A)               $1
015380,000878: 22,2560           03275                                    COF        +4                         
015381,000879: 22,2561           41316                           DSQ      DMP                                   
015382,000880: 22,2562           00005                                    4                                     
015383,000881: 22,2563           52415                           DAD      SL3                                   
015384,000882: 22,2564           00003                                    2                                     
015385,000883: 22,2565           77604                           BOVB                                           
015386,000884: 22,2566           21712                                    SIGNMPAC                              
015387,000885: 22,2567           02251                           STORE    KEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)               $1
015388,000886: 
015389,000887:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
015390,000888: 
015391,000889: 22,2570           41345                           DLOAD    DMP                                   
015392,000890: 22,2571           03271                                    COF                                   
015393,000891: 22,2572           03273                                    COF        +2                         
015394,000892: 22,2573           72405                           DMP      SL1                                   
015395,000893: 22,2574           00005                                    4                                     
015396,000894: 22,2575           41325                           PDDL     DMP                                   #  D6     UX UY (1-COS A)                $4
015397,000895: 22,2576           03275                                    COF        +4                         
015398,000896: 22,2577           00001                                    0                                     
015399,000897: 22,2600           43206                           PUSH     DAD                                   #  D8    UZ SIN A                        $4
015400,000898: 22,2601           00007                                    6                                     
015401,000899: 22,2602           41112                           SL2      BOVB                                  
015402,000900: 22,2603           21712                                    SIGNMPAC                              
015403,000901: 22,2604           16237                           STODL    KEL        +6                         
015404,000902: 22,2605           62421                           BDSU     SL2                                   
015405,000903: 22,2606           77604                           BOVB                                           
015406,000904: 22,2607           21712                                    SIGNMPAC                              
015407,000905: 22,2610           16233                           STODL    KEL        +2                         
015408,000906: 22,2611           03271                                    COF                                   
015409,000907: 22,2612           41205                           DMP      DMP                                   
015410,000908: 22,2613           03275                                    COF        +4                         
015411,000909: 22,2614           00005                                    4                                     
015412,000910: 22,2615           65352                           SL1      PDDL                                  #  D6    UX UZ (1-COS A)                 $4
015413,000911: 22,2616           03273                                    COF        +2                         
015414,000912: 22,2617           41405                           DMP      PUSH                                  #  D8    UY SIN(A)
015415,000913: 22,2620           00001                                    0                                     
015416,000914: 22,2621           62415                           DAD      SL2                                   
015417,000915: 22,2622           00007                                    6                                     
015418,000916: 22,2623           77604                           BOVB                                           
015419,000917: 22,2624           21712                                    SIGNMPAC                              
015420,000918: 22,2625           16235                           STODL    KEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)

Page 361

015422,000920: 22,2626           62421                           BDSU     SL2                                   
015423,000921: 22,2627           77604                           BOVB                                           
015424,000922: 22,2630           21712                                    SIGNMPAC                              
015425,000923: 22,2631           16245                           STODL    KEL        +12D                       #  UX UZ (1-COS(A))-UY SIN(A)
015426,000924: 22,2632           03273                                    COF        +2                         
015427,000925: 22,2633           41205                           DMP      DMP                                   
015428,000926: 22,2634           03275                                    COF        +4                         
015429,000927: 22,2635           00005                                    4                                     
015430,000928: 22,2636           65352                           SL1      PDDL                                  #  D6    UY UZ (1-COS(A))                $ 4
015431,000929: 22,2637           03271                                    COF                                   
015432,000930: 22,2640           41405                           DMP      PUSH                                  #  D8    UX SIN(A)
015433,000931: 22,2641           00001                                    0                                     
015434,000932: 22,2642           62415                           DAD      SL2                                   
015435,000933: 22,2643           00007                                    6                                     
015436,000934: 22,2644           77604                           BOVB                                           
015437,000935: 22,2645           21712                                    SIGNMPAC                              
015438,000936: 22,2646           16247                           STODL    KEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
015439,000937: 22,2647           62421                           BDSU     SL2                                   
015440,000938: 22,2650           77604                           BOVB                                           
015441,000939: 22,2651           21712                                    SIGNMPAC                              
015442,000940: 22,2652           02243                           STORE    KEL        +10D                       #  UY UZ (1-COS(A)) -UX SIN(A)
015443,000941: 22,2653           77616                           RVQ                                            
015444,000942: 
015445,000943:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
015446,000944:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
015447,000945:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
015448,000946:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
015449,000947: 
015450,000948:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS***
015451,000949: 
015452,000950:                                                                                                  #        C  = COS(THETA) COS(PSI)
015453,000951:                                                                                                  #         0
015454,000952: 
015455,000953:                                                                                                  #        C  = -COS(THETA) SIN(PSI) COS(PHI) + SI (THETA) SIN(PHI)
015456,000954:                                                                                                  #         1
015457,000955: 
015458,000956:                                                                                                  #        C  = COS(THETA) SIN(PSI) SIN(PHI) + S N(THETA) COS(PHI)
015459,000957:                                                                                                  #         2
015460,000958: 
015461,000959:                                                                                                  #        C  = SIN(PSI)
015462,000960:                                                                                                  #         3
015463,000961: 
015464,000962:                                                                                                  #        C  = COS(PSI) COS(PHI)
015465,000963:                                                                                                  #         4
015466,000964: 
015467,000965:                                                                                                  #        C  = -COS(PSI) SIN(PHI)
015468,000966:                                                                                                  #         5
015469,000967: 
015470,000968:                                                                                                  #        C  = -SIN(THETA) COS(PSI)
015471,000969:                                                                                                  #         6
015472,000970: 
015473,000971:                                                                                                  #        C  = SIN(THETA) SIN(PSI) COS(PHI) + COS THETA) SIN(PHI)
015474,000972:                                                                                                  #         7
015475,000973: 
015476,000974:                                                                                                  #        C  = -SIN(THETA) SIN(PSI) SIN(PHI) + CO (THETA)COS(PHI)
015477,000975:                                                                                                  #         8

Page 362

015479,000977: 
015480,000978:                                                                                                  #  WHERE PHI = OGA
015481,000979:                                                                                                  #        THETA = IGA
015482,000980:                                                                                                  #        PSI = MGA
015483,000981: 
015484,000982: 22,2654           67543        DCMTOCDU           DLOAD*   ARCSIN                                
015485,000983: 22,2655           00007                                    6,1                                   
015486,000984: 22,2656           71406                           PUSH     COS                                   #  PD +0         PSI
015487,000985: 22,2657           41152                           SL1      BOVB                                  
015488,000986: 22,2660           21712                                    SIGNMPAC                              
015489,000987: 22,2661           00051                           STORE    S1                                    
015490,000988: 22,2662           57543                           DLOAD*   DCOMP                                 
015491,000989: 22,2663           00015                                    12D,1                                 
015492,000990: 22,2664           67471                           DDV      ARCSIN                                
015493,000991: 22,2665           00051                                    S1                                    
015494,000992: 22,2666           51123                           PDDL*    BPL                                   #  PD +2         THETA
015495,000993: 22,2667           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
015496,000994: 22,2670           44702                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
015497,000995: 22,2671           57545                           DLOAD    DCOMP                                 
015498,000996: 22,2672           43244                           BPL      DAD                                   
015499,000997: 22,2673           44677                                    SUHALFA                               
015500,000998: 22,2674           06520                                    DPHALF                                
015501,000999: 22,2675           77650                           GOTO                                           
015502,001000: 22,2676           44701                                    CALCPHI                               
015503,001001: 22,2677           77625        SUHALFA            DSU                                            
015504,001002: 22,2700           06520                                    DPHALF                                
015505,001003: 22,2701           77606        CALCPHI            PUSH                                           
015506,001004: 22,2702           57543        OKTHETA            DLOAD*   DCOMP                                 
015507,001005: 22,2703           00013                                    10D,1                                 
015508,001006: 22,2704           67471                           DDV      ARCSIN                                
015509,001007: 22,2705           00051                                    S1                                    
015510,001008: 22,2706           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI
015511,001009: 22,2707           00011                                    8D,1                                  
015512,001010: 22,2710           44722                                    OKPHI                                 
015513,001011: 22,2711           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
015514,001012: 22,2712           43244                           BPL      DAD                                   
015515,001013: 22,2713           44717                                    SUHALFAP                              
015516,001014: 22,2714           06520                                    DPHALF                                
015517,001015: 22,2715           77650                           GOTO                                           
015518,001016: 22,2716           44723                                    VECOFANG                              
015519,001017: 22,2717           52025        SUHALFAP           DSU      GOTO                                  
015520,001018: 22,2720           06520                                    DPHALF                                
015521,001019: 22,2721           44723                                    VECOFANG                              
015522,001020: 22,2722           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
015523,001021: 22,2723           43466        VECOFANG           VDEF     RVQ                                   

Page 363

015525,001023:                                                                                                  #  ROUTINES FOR TERMINATING THE AUTOMATIC MANEUVER AND RETURNING TO USER
015526,001024: 
015527,001025: 22,2724           77776        TOOBADF            EXIT                                           
015528,001026: 22,2725           05567                           TC       ALARM                                 
015529,001027: 22,2726           00401                           OCT      00401                                 
015530,001028: 
015531,001029: 22,2727           12732                           TCF      NOGO                                  #  DO NOT ZERO ATTITUDE ERRORS
015532,001030: 
015533,001031: 22,2730           04616                           TC       BANKCALL                              
015534,001032: 22,2731           40153                           CADR     ZATTEROR                              #  ZERO ATTITUDE ERRORS
015535,001033: 
015536,001034: 22,2732           04616        NOGO               TC       BANKCALL                              
015537,001035: 22,2733           40165                           CADR     STOPRATE                              #  STOP RATES
015538,001036: 
015539,001037: 22,2734           34752                           CAF      TWO                                   
015540,001038: 22,2735           00004                           INHINT                                         #  ALL RETURNS ARE NOW MADE VIA GOODEND
015541,001039: 22,2736           05203                           TC       WAITLIST                              
015542,001040: 22,2737  E6,1676                                  EBANK=   BCDU                                  
015543,001041: 22,2737           03234 44066                     2CADR    GOODMANU                              
015544,001042: 
015545,001043: 22,2741           15155                           TCF      ENDOFJOB                              
015546,001044: 
015547,001045: 22,2742           77776        TOOBADI            EXIT                                           
015548,001046: 22,2743           12732                           TCF      NOGO                                  
015549,001047: 
015550,001048: 

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