Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

014176,000002:                                                                                                  ## Copyright:   Public domain.
014177,000003:                                                                                                  ## Filename:    ATTITUDE_MANEUVER_ROUTINE.agc
014178,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
014179,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
014180,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
014181,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
014182,000008:                                                                                                  ##              that the code format has been changed to conform to the
014183,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the 
014184,000010:                                                                                                  ##              original YUL assembler.
014185,000011:                                                                                                  ## Reference:   pp. 344-365
014186,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014187,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014188,000014:                                                                                                  ## Mod history: 05/10/03 RSB.   Began transcribing.
014189,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
014190,000016:                                                                                                  ##              2010-08-24 JL   Added missing page number comments.
014191,000017:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
014192,000018:                                                                                                  ##                              original harcopy, as opposed to the PDF page
014193,000019:                                                                                                  ##                              numbers in 1701.pdf.
014194,000020:                                                                                                  ##              2017-02-23 RSB  Proofed comment text using octopus/ProoferComments.
014195,000021:                                                                                                  ##              2017-02-28 RSB  Fixed lingering typos.
014196,000022:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
014197,000023:                                                                                                  ##              2017-03-15 RSB  Comment-text fixes identified in 5-way
014198,000024:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
014199,000025: 

Page 344

014201,000027:                                                                                                  #  BLOCK 2 LGC ATTITUDE MANEUVER ROUTINE - KALCMANU
014202,000028: 
014203,000029:                                                                                                  #  MOD 2         DATE 5/1/67     BY DON KEENE
014204,000030: 
014205,000031:                                                                                                  #  PROGRAM DESCRIPTION
014206,000032: 
014207,000033:                                                                                                  #  KALCMANU IS A ROUTINE WHICH GENERATES COMMANDS FOR THE LM DAP TO CHANGE THE ATTITUDE OF THE SPACECRAFT
014208,000034:                                                                                                  #  DURING FREE FALL.  IT IS DESIGNED TO MANEUVER THE SPACECRAFT FROM ITS INITIAL ORIENTATION TO SOME DESIRED
014209,000035:                                                                                                  #  ORIENTATION SPECIFIED BY THE PROGRAM WHICH CALLS KALCMANU, AVOIDING GIMBAL LOCK IN THE PROCESS.  IN THE 
014210,000036:                                                                                                  #  MOD 2 VERSION, THIS DESIRED ATTITUDE IS SPECIFIED BY A SET OF THREE COMMANDED CDU ANGLES STORED AS 2S COMPLEMENT
014211,000037:                                                                                                  #  SINGLE PRECISION ANGLES IN THE THREE CONSECUTIVE LOCATIONS, CPHI, CTHETA, CPSI, WHERE
014212,000038: 
014213,000039:                                                                                                  #        CPHI = COMMANDED OUTER GIMBAL ANGLE
014214,000040:                                                                                                  #        CTHETA = COMMANDED INNER GIMBAL ANGLE
014215,000041:                                                                                                  #        CPSI = COMMANDED MIDDLE GIMBAL ANGLE
014216,000042: 
014217,000043:                                                                                                  #      WHEN POINTING A SPACECRAFT AXIS (E.I.  X, Y, Z, THE AOT, THRUST AXIS, ETC) THE SUBROUTINE VECPOINT MAY BE
014218,000044:                                                                                                  #  USED TO GENERATE THIS SET OF DESIRED CDU ANGLES (SEE DESCRIPTION IN R60)    -
014219,000045: 
014220,000046:                                                                                                  #  WITH THIS INFORMATION KALCMANU DETERMINES THE DIRECTION OF THE SINGLE EQUIVALENT ROTATION (COF ALSO U) AND THE
014221,000047:                                                                                                  #  MAGNITUDE OF THE ROTATION (AM) TO BRING THE S/C FROM ITS INITIAL ORIENTATION TO ITS FINAL ORIENTATION.
014222,000048:                                                                                                  #  THIS DIRECTION REMAINS FIXED BOTH IN INERTIAL COORDINATES AND IN COMMANDED S/C AXES THROUGHOUT THE 
014223,000049:                                                                                                  #                   -
014224,000050:                                                                                                  #  MANEUVER.  ONCE COF AND AM HAVE BEEN DETERMINED, KALCMANU THEN EXAMINES THE MANEUVER TO SEE IF IT WILL BRING
014225,000051:                                                                                                  #                                        -
014226,000052:                                                                                                  #  THE S/C THROUGH GIMBAL LOCK.  IF SO, COF AND AM ARE READJUSTED SO THAT THE S/C WILL JUST SKIM THE GIMBAL
014227,000053:                                                                                                  #  LOCK ZONE AND ALIGN THE X-AXIS.  IN GENERAL A FINAL YAW ABOUT X WILL BE NECESSARY TO COMPLETE THE MANEUVER.
014228,000054:                                                                                                  #  NEEDLESS TO SAY, NEITHER THE INITIAL NOR THE FINAL ORIENTATION CAN BE IN GIMBAL LOCK.
014229,000055: 
014230,000056:                                                                                                  #  FOR PROPER ATTITUDE CONTROL THE DIGITAL AUTOPILOT MUST BE GIVEN AN ATTITUDE REFERENCE WHICH IT CAN TRACK.
014231,000057:                                                                                                  #  KALCMANU DOES THIS BY GENERATING A REFERENCE OF DESIRED GIMBAL ANGLES (CDUXD, CDUYD, CDUZD) WHICH ARE UPDATED
014232,000058:                                                                                                  #  EVERY ONE SECOND DURING THE MANEUVER.  TO ACHIEVE A SMOOTHER SEQUENCE OF COMMANDS BETWEEN SUCCESSIVE UPDATES,
014233,000059:                                                                                                  #  THE PROGRAM ALSO GENERATES A SET OF INCREMENTAL CDU ANGLES (DELDCDU) TO BE ADDED TO CDU DESIRED BY THE DIGITAL
014234,000060:                                                                                                  #  AUTOPILOT.  KALCMANU ALSO CALCULATES THE COMPONENT MANEUVER RATES (OMEGAPD, OMEGAQD, OMEGARD), WHICH CAN
014235,000061:                                                                                                  #                                       -
014236,000062:                                                                                                  #  BE DETERMINED SIMPLY BY MULTIPLYING COF BY SOME SCALAR (ARATE) CORRESPONDING TO THE DESIRED ROTATIONAL RATE.
014237,000063: 
014238,000064:                                                                                                  #  AUTOMATIC MANEUVERS ARE TIMED WITH THE HELP OF WAITLIST SO THAT AFTER A SPECIFIED INTERVAL THE Y AND Z
014239,000065:                                                                                                  #  DESIRED RATES ARE SET TO ZERO AND THE DESIRED CDU ANGLES (CDUYD, CDUZD) ARE SET EQUAL TO THE FINAL DESIRED CDU
014240,000066:                                                                                                  #  ANGLES (CTHETA, CPSI).  IF ANY YAW REMAINS DUE TO GIMBAL LOCK AVOIDANCE, THE FINAL YAW  MANEUVER IS
014241,000067:                                                                                                  #  CALCULATED AND THE DESIRED YAW RATE SET TO SOME FIXED VALUE (ROLLRATE = + OR - 2 DEGREES PER SEC).
014242,000068:                                                                                                  #  IN THIS CASE ONLY AN INCREMENTAL CDUX ANGLE (DELFROLL) IS SUPPLIED TO THE DAP.  AT THE END OF THE YAW
014243,000069:                                                                                                  #  MANEUVER OR IN THE EVENT THAT THERE WAS NO FINAL YAW, CDUXD IS SET EQUAL TO CPHI AND THE X-AXIS DESIRED
014244,000070:                                                                                                  #  RATE SET TO ZERO.  THUS, UPON COMPLETION OF THE MANEUVER THE S/C WILL FINISH UP IN A LIMIT CYCLE ABOUT THE
014245,000071:                                                                                                  #  DESIRED FINAL GIMBAL ANGLES.
014246,000072: 
014247,000073:                                                                                                  #  PROGRAM LOGIC FLOW
014248,000074: 
014249,000075:                                                                                                  #  KALCMANU IS CALLED AS A HIGH PRIORITY JOB WITH ENTRY POINTS AT KALCMAN3 AND VECPOINT.  IT FIRST PICKS
014250,000076:                                                                                                  #  UP THE CURRENT CDU ANGLES TO BE USED AS THE BASIS FOR ALL COMPUTATIONS INVOLVING THE INITIAL S/C ORIENTATION.

Page 345

014252,000078:                                                                                                  #  IT THEN DETERMINES THE DIRECTION COSINE MATRICES RELATING BOTH THE INITIAL AND FINAL S/C ORIENTATION TO STABLE
014253,000079:                                                                                                  #                *   *                                                                               *
014254,000080:                                                                                                  #  MEMBER AXES (MIS,MFS).  IT ALSO COMPUTES THE MATRIX RELATING FINAL S/C AXES TO INITIAL S/C AXES (MFI).  THE
014255,000081:                                                                                                  #  ANGLE OF ROTATION (AM) IS THEN EXTRACTED FROM THIS MATRIX, AND TESTS ARE MADE TO DETERMINE IF
014256,000082: 
014257,000083:                                                                                                  #        A)      AM LESS THAN .25 DEGREES (MINANG)
014258,000084:                                                                                                  #        B)      AM GREATER THAN 170 DEGREES (MAXANG)
014259,000085: 
014260,000086:                                                                                                  #  IF AM LESS THAN .25 DEGREES, NO COMPLICATED AUTOMATIC MANEUVERING IS NECESSARY.  THEREFORE WE CAN SIMPLY
014261,000087:                                                                                                  #  SET CDU DESIRED EQUAL TO THE FINAL CDU DESIRED ANGLES AND TERMINATE THE JOB.
014262,000088: 
014263,000089:                                                                                                  #  IF AM IS GREATER THAN .25 DEGREES BUT LESS THAN 170 DEGREES, THE AXES OF THE SINGLE EQUIVALENT ROTATION
014264,000090:                                                                                                  #    -                                                       *
014265,000091:                                                                                                  #  (COF) IS EXTRACTED FROM THE SKEW SYMMETRIC COMPONENTS OF MFI.                       *     *
014266,000092:                                                                                                  #  IF AM GREATER THAN 170 DEGREES AN ALTERNATE METHOD EMPLOYING THE SYMMETRIC PART OF MFI (MFISYM) IS USED
014267,000093:                                                                                                  #                -
014268,000094:                                                                                                  #  TO DETERMINE COF.
014269,000095: 
014270,000096:                                                                                                  #  THE PROGRAM THEN CHECKS TO SEE IF THE MANEUVER AS COMPUTED WILL BRING THE S/C THROUGH GIMBAL LOCK.  IF
014271,000097:                                                                                                  #  SO, A NEW MANEUVER IS CALCULATED WHICH WILL JUST SKIM THE GIMBAL LOCK ZONE AND ALIGN THE S/C X-AXIS.  THIS
014272,000098:                                                                                                  #  METHOD ASSURES THAT THE ADDITIONAL MANEUVERING TO AVOID GIMBAL LOCK WILL BE KEPT TO A MINIMUM.  SINCE A FINAL
014273,000099:                                                                                                  #  P AXIS YAW WILL BE NECESSARY, A SWITCH IS RESET (STATE SWITCH 31) TO ALLOW FOR THE COMPUTATION OF THIS FINAL
014274,000100:                                                                                                  #  YAW.
014275,000101: 
014276,000102:                                                                                                  #  AS STATED PREVIOUSLY KALCMANU GENERATES A SEQUENCE OF DESIRED GIMBAL ANGLES WHICH ARE UPDATED EVERY 
014277,000103:                                                                                                  #                                                                                               -
014278,000104:                                                                                                  #  SECOND.  THIS IS ACCOMPLISHED BY A SMALL ROTATION OF THE DESIRED S/C FRAME ABOUT THE VECTOR COF.  THE NEW
014279,000105:                                                                                                  #  DESIRED REFERENCE MATRIX IS THEN,
014280,000106:                                                                                                  #         *               *       *
014281,000107:                                                                                                  #        MIS     =       MIS     DEL
014282,000108:                                                                                                  #           N+1             N
014283,000109:                                                                                                  #         *
014284,000110:                                                                                                  #  WHERE DEL IS THE MATRIX CORRESPONDING TO THIS SMALL ROTATION.  THE NEW CDU ANGLES CAN THEN BE EXTRACTED
014285,000111:                                                                                                  #        *
014286,000112:                                                                                                  #  FROM MIS.
014287,000113: 
014288,000114:                                                                                                  #  AT THE BEGINNING OF THE MANEUVER THE AUTOPILOT DESIRED RATES (OMEGAPD, OMEGAQD, OMEGARD) AND THE 
014289,000115:                                                                                                  #  MANEUVER TIMINGS ARE ESTABLISHED.  ON THE FIRST PASS AND ON ALL SUBSEQUENT UPDATES THE CDU DESIRED
014290,000116:                                                                                                  #  ANGLES ARE LOADED WITH THE APPROPRIATE VALUES AND THE INCREMENTAL CDU ANGLES ARE COMPUTED.  THE AGC CLOCKS
014291,000117:                                                                                                  #  (TIME1 AND TIME2) ARE THAN CHECKED TO SEE IF THE MANEUVER WILL TERMINATE BEFORE THE NEXT UPDATE.  IF
014292,000118:                                                                                                  #  NOT, KALCMANU CALLS FOR ANOTHER UPDATE (RUN AS A JOB WITH PRIORITY TBD) IN ONE SECOND.  ANY DELAYS IN THIS
014293,000119:                                                                                                  #  CALLING SEQUENCE ARE AUTOMATICALLY COMPENSATED IN CALLING FOR THE NEXT UPDATE.
014294,000120: 
014295,000121:                                                                                                  #  IF IT IS FOUND THAT THE MANEUVER IS TO TERMINATE BEFORE THE NEXT UPDATE A ROUTINE IS CALLED (AS A WAIT-
014296,000122:                                                                                                  #  LIST TASK) TO STOP THE MANEUVER AT THE APPROPRIATE TIME AS EXPLAINED ABOVE.
014297,000123: 

Page 346

014299,000125:                                                                                                  #  CALLING SEQUENCE
014300,000126: 
014301,000127:                                                                                                  #  IN ORDER TO PERFORM A KALCMANU SUPERVISED MANEUVER, THE COMMANDED GIMBAL ANGLES MUST BE PRECOMPUTED AND
014302,000128:                                                                                                  #  STORED IN LOCATIONS CPHI, CTHETA, CPSI.  THE USER:S PROGRAM MUST THEN CLEAR STATE SWITCH NO 33 TO ALLOW THE 
014303,000129:                                                                                                  #  ATTITUDE MANEUVER ROUTINE TO PERFORM ANY FINAL P-AXIS YAW INCURRED BY AVOIDING GIMBAL LOCK.  THE MANEUVER IS
014304,000130:                                                                                                  #  THEN INITIATED BY ESTABLISHING THE FOLLOWING EXECUTIVE JOB
014305,000131:                                                                                                  #                       *
014306,000132:                                                                                                  #        CAF     PRIO XX
014307,000133:                                                                                                  #                     --
014308,000134:                                                                                                  #        INHINT
014309,000135:                                                                                                  #        TC      FINDVAC
014310,000136:                                                                                                  #        2CADR   KALCMAN3
014311,000137:                                                                                                  #        RELINT
014312,000138: 
014313,000139:                                                                                                  #  THE USER:S PROGRAM MAY EITHER CONTINUE OR WAIT FOR THE TERMINATION OF THE MANEUVER.  IF THE USER WISHES TO
014314,000140:                                                                                                  #  WAIT, HE MAY PUT HIS JOB TO SLEEP WITH THE FOLLOWING INSTRUCTIONS
014315,000141: 
014316,000142:                                                                                                  #        L       TC      BANKCALL
014317,000143:                                                                                                  #        L+1     CADR    ATTSTALL
014318,000144:                                                                                                  #        L+2     (BAD RETURN)
014319,000145:                                                                                                  #        L+3     (GOOD RETURN)
014320,000146: 
014321,000147:                                                                                                  #  UPON COMPLETION OF THE MANEUVER, THE PROGRAM WILL BE AWAKENED AT L+3 IF THE MANEUVER WAS COMPLETED
014322,000148:                                                                                                  #  SUCCESSFULLY, OR AT L+2 IF THE MANEUVER WAS ABORTED.  THIS ABORT WOULD OCCUR IF THE INITIAL OR FINAL ATTITUDE
014323,000149:                                                                                                  #  WAS IN GIMBAL LOCK.
014324,000150: 
014325,000151:                                                                                                  #  *** NOTA BENE ***  IT IS ASSUMED THAT THE DESIRED MANEUVERING RATE (0.5, 2, 5, 10, DEG/SEC) HAS BEEN SELECTED BY
014326,000152:                                                                                                  #  KEYBOARD ENTRY PRIOR TO THE EXECUTION OF KALCMANU.
014327,000153: 
014328,000154:                                                                                                  #  IT IS ALSO ASSUMED THAT THE AUTOPILOT IS IN THE AUTO MODE.  IF THE MODE SWITCH IS CHANGED DURING THE
014329,000155:                                                                                                  #  MANEUVER, KALCMANU WILL TERMINATE VIA GOODEND WITHIN 1 SECOND SO THAT R60 MAY REQUEST A TRIM OF THE S/C ATTITUDE
014330,000156:                                                                                                  #  THIS IS THE ONLY MEANS FOR MANUALLY TERMINATING A KALCMANU SUPERVISED MANEUVER.
014331,000157:                                                                                                  #  SUBROUTINES
014332,000158: 
014333,000159:                                                                                                  #  KALCMANU USES A NUMBER OF INTERPRETIVE SUBROUTINES WHICH MAY BE OF GENERAL INTEREST.  SINCE THESE ROUTINES
014334,000160:                                                                                                  #  WERE PROGRAMMED EXCLUSIVELY FOR KALCMANU, THEY ARE NOT, AS YET, GENERALLY AVAILABLE FOR USE BY OTHER PROGRAMS.
014335,000161: 
014336,000162:                                                                                                  #  MXM3
014337,000163:                                                                                                  #  ----
014338,000164: 
014339,000165:                                                                                                  #  THIS SUBROUTINE MULTIPLIES TWO 3X3 MATRICES AND LEAVES THE RESULT IN THE FIRST 18 LOCATIONS OF THE PUSH
014340,000166:                                                                                                  #  DOWN LIST, I.E.,
014341,000167:                                                                                                  #                        ( M     M     M  )
014342,000168:                                                                                                  #                        (  0     1     2 )
014343,000169:                                                                                                  #        *               (                )              *               *
014344,000170:                                                                                                  #        M       =       ( M     M     M  )      =       M1      X       M2
014345,000171:                                                                                                  #                        (  3     4     5 )
014346,000172:                                                                                                  #                        (                )
014347,000173:                                                                                                  #                        ( M     M     M  )

Page 347

014349,000175:                                                                                                  #                        (  6     7     8 )
014350,000176:                                                                                                  #                                                                                   *
014351,000177:                                                                                                  #  INDEX REGISTER X1 MUST BE LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M1, AND X2 MUST BE
014352,000178:                                                                                                  #                                                         *
014353,000179:                                                                                                  #  LOADED WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M2.  THE ROUTINE USES THE FIRST 20 LOCATIONS OF THE PUSH
014354,000180:                                                                                                  #  DOWN LIST.  THE FIRST ELEMENT OF THE MATRIX APPEARS IN PDO.  PUSH UP FOR M .
014355,000181:                                                                                                  #                                                                            8
014356,000182:                                                                                                  #  TRANSPOS
014357,000183:                                                                                                  #  --------
014358,000184: 
014359,000185:                                                                                                  #  THIS ROUTINE TRANSPOSES A 3X3 MATRIX AND LEAVES THE RESULT IN THE PUSH DOWN LIST, I.E.,
014360,000186:                                                                                                  #  
014361,000187:                                                                                                  #        *               * T
014362,000188:                                                                                                  #        M       =       M1
014363,000189: 
014364,000190:                                                                                                  #  INDEX REGISTER X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M1.  PUSH UP FOR THE FIRST AND SUB-
014365,000191:                                                                                                  #                         *
014366,000192:                                                                                                  #  SEQUENT COMPONENTS OF M.  THIS SUBROUTINE ALSO USES THE FIRST 20 LOCATIONS OF THE PUSH DOWN LIST.
014367,000193: 
014368,000194:                                                                                                  #  CDU TO DCM
014369,000195:                                                                                                  #  ----------
014370,000196: 
014371,000197:                                                                                                  #  THIS SUBROUTINE CONVERTS THREE CDU ANGLES IN T(MPAC) TO A DIRECTION COSINE MATRIX (SCALED BY 2) RELATING
014372,000198:                                                                                                  #  THE CORRESPONDING S/C ORIENTATIONS TO THE STABLE MEMBER FRAME.  THE FORMULAS FOR THIS CONVERSION ARE
014373,000199: 
014374,000200:                                                                                                  #        M       =       COSY COSZ
014375,000201:                                                                                                  #         0
014376,000202: 
014377,000203:                                                                                                  #        M       =       -COSY SINZ COSX + SINY SINX
014378,000204:                                                                                                  #         1
014379,000205: 
014380,000206:                                                                                                  #        M       =       COSY SINZ SINX + SINY COSX
014381,000207:                                                                                                  #         2
014382,000208: 
014383,000209:                                                                                                  #        M       =       SINZ
014384,000210:                                                                                                  #         3
014385,000211: 
014386,000212:                                                                                                  #        M       =       COSZ COSX
014387,000213:                                                                                                  #         4
014388,000214: 
014389,000215:                                                                                                  #        M       =       -COSZ SINX
014390,000216:                                                                                                  #         5
014391,000217: 
014392,000218:                                                                                                  #        M       =       -SINY COSZ
014393,000219:                                                                                                  #         6
014394,000220:                                                                                                  #        
014395,000221:                                                                                                  #        M       =       SINY SINZ COSX + COSY SINX
014396,000222:                                                                                                  #         7

Page 348

014398,000224:                                                                                                  #        M       =       -SINY SINZ SINX + COSY COSX
014399,000225:                                                                                                  #         8
014400,000226: 
014401,000227:                                                                                                  #  WHERE         X       =       OUTER GIMBAL ANGLE
014402,000228:                                                                                                  #                Y       =       INNER GIMBAL ANGLE
014403,000229:                                                                                                  #                Z       =       MIDDLE GIMBAL ANGLE
014404,000230: 
014405,000231:                                                                                                  #  THE INTERPRETATION OF THIS MATRIX IS AS FOLLOWS
014406,000232: 
014407,000233:                                                                                                  #  IF A , A , A  REPRESENT THE COMPONENTS OF A VECTOR IN S/C AXES THEN THE COMPONENTS OF THE SAME VECTOR IN
014408,000234:                                                                                                  #      X   Y   Z
014409,000235:                                                                                                  #  STABLE MEMBER AXES (B , B , B ) ARE
014410,000236:                                                                                                  #                       X   Y   Z
014411,000237: 
014412,000238:                                                                                                  #        ( B  )                  ( A  )
014413,000239:                                                                                                  #        (  X )                  (  X )
014414,000240:                                                                                                  #        (    )                  (    )
014415,000241:                                                                                                  #        (    )            *     (    )
014416,000242:                                                                                                  #        ( B  )     =      M     ( A  )
014417,000243:                                                                                                  #        (  Y )                  (  Y )
014418,000244:                                                                                                  #        (    )                  (    )
014419,000245:                                                                                                  #        ( B  )                  ( A  )
014420,000246:                                                                                                  #        (  Z )                  (  Z )
014421,000247: 
014422,000248:                                                                                                  #  THE SUBROUTINE WILL STORE THIS MATRIX IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY AS SPECIFIED BY THE CALLING
014423,000249:                                                                                                  #                                                                                                              *
014424,000250:                                                                                                  #  PROGRAM.  TO DO THIS THE CALLING PROGRAM MUST FIRST LOAD X2 WITH THE COMPLEMENT OF THE STARTING ADDRESS FOR M.
014425,000251: 
014426,000252:                                                                                                  #  INTERNALLY, THE ROUTINE USES THE FIRST 16 LOCATIONS OF THE PUSH DOWN LIST, ALSO STEP REGISTER S1 AND INDEX
014427,000253:                                                                                                  #  REGISTER X2.
014428,000254: 
014429,000255:                                                                                                  #  DCM TO CDU
014430,000256:                                                                                                  #  ----------
014431,000257:                                                                                                  #                                                                      *
014432,000258:                                                                                                  #  THIS ROUTINE EXTRACTS THE CDU ANGLES FROMA DIRECTION COSINE MATRIX (M SCALED BY 2) RELATING S/C AXIS TO
014433,000259:                                                                                                  #                                                                                  *
014434,000260:                                                                                                  #  STABLE MEMBER AXES.  X1 MUST CONTAIN THE COMPLEMENT OF THE STARTING ADDRESS FOR M.  THE SUBROUTINE LEAVES THE
014435,000261:                                                                                                  #  CORRESPONDING GIMBAL ANGLES IN V(MPAC) AS DOUBLE PRECISION 1:S COMPLEMENT ANGLES SCALED BY 2PI.  THE FORMULAS
014436,000262:                                                                                                  #  FOR THIS CONVERSION ARE
014437,000263: 
014438,000264:                                                                                                  #        Z       =       ARCSIN (M  )
014439,000265:                                                                                                  #                                 3
014440,000266: 
014441,000267:                                                                                                  #        Y       =       ARCSIN (-M /COSZ)
014442,000268:                                                                                                  #                                  6
014443,000269: 
014444,000270:                                                                                                  #  IF M  IS NEGATIVE, Y IS REPLACED BY PI SGN Y - Y
014445,000271:                                                                                                  #      0

Page 349

014447,000273:                                                                                                  #        X       =       ARCSIN (-M /COSZ)
014448,000274:                                                                                                  #                                  5
014449,000275: 
014450,000276:                                                                                                  #  IF M  IS NEGATIVE X IS REPLACED BY PI SGN X - X
014451,000277:                                                                                                  #      4
014452,000278: 
014453,000279:                                                                                                  #  THIS ROUTINE DOES NOT SET THE PUSH DOWN POINTER, BUT USES THE NEXT 8 LOCATIONS OF THE PUSH DOWN LIST AND
014454,000280:                                                                                                  #  RETURNS THE POINTER TO ITS ORIGINAL SETTING.  THIS PROCEDURE ALLOWS THE CALLER TO STORE THE MATRIX AT THE TOP OF
014455,000281:                                                                                                  #  THE PUSH DOWN LIST.
014456,000282: 
014457,000283:                                                                                                  #  DELCOMP
014458,000284:                                                                                                  #  -------
014459,000285:                                                                                                  #                                                      *
014460,000286:                                                                                                  #  THIS ROUTINE COMPUTES THE DIRECTION COSINE MATRIX (DEL) RELATING ON
014461,000287:                                                                                                  #                                                                           -
014462,000288:                                                                                                  #  IS ROTATED WITH RESPECT TO THE FIRST BY AN ANGLE, A, ABOUT A UNIT VECTOR, U.  THE FORMULA FOR THIS MATRIX IS
014463,000289: 
014464,000290:                                                                                                  #         *              *        - -T              *
014465,000291:                                                                                                  #        DEL     =       I COSA + U U  (1 - COSA) + V  SINA
014466,000292:                                                                                                  #                                                    X
014467,000293: 
014468,000294:                                                                                                  #  WHERE         *               ( 1    0    0 )
014469,000295:                                                                                                  #                I       =       ( 0    1    0 )
014470,000296:                                                                                                  #                                ( 0    0    1 )
014471,000297: 
014472,000298:                                                                                                  #                                     2                             
014473,000299:                                                                                                  #                                (  U           U  U          U  U  )
014474,000300:                                                                                                  #                                (   X           X  Y          X  Z )
014475,000301:                                                                                                  #                                (                                  )
014476,000302:                                                                                                  #                - -T            (                 2                )
014477,000303:                                                                                                  #                U U     =       ( U  U          U            U  U  )
014478,000304:                                                                                                  #                                (  Y  X          Y            Y  Z )
014479,000305:                                                                                                  #                                (                                  )
014480,000306:                                                                                                  #                                (                               2  )
014481,000307:                                                                                                  #                                ( U  U         U  U           U    )
014482,000308:                                                                                                  #                                (  Z  X         Z  Y           Z   )
014483,000309: 
014484,000310: 
014485,000311:                                                                                                  #                                (   0           -U               U  )
014486,000312:                                                                                                  #                                (                 Z               Y )
014487,000313:                                                                                                  #                *               (                                   )
014488,000314:                                                                                                  #                V       =       (  U             0              -U  )
014489,000315:                                                                                                  #                 X              (   Z                             X )
014490,000316:                                                                                                  #                                (                                   )
014491,000317:                                                                                                  #                                ( -U             U               0  )
014492,000318:                                                                                                  #                                (   Y             X                 )
014493,000319: 

Page 350

014495,000321:                                                                                                  #        -
014496,000322:                                                                                                  #        U       =       UNIT ROTATION VECTOR RESOLVED INTO S/C AXES
014497,000323:                                                                                                  #        A       =       ROTATION ANGLE
014498,000324: 
014499,000325:                                                                                                  #                         *
014500,000326:                                                                                                  #  THE INTERPRETATION OF DEL IS AS FOLLOWS
014501,000327: 
014502,000328:                                                                                                  #  IF A , A , A  REPRESENT THE COMPONENT OF A VECTOR INTHE ROTATED FRAME, THEN THE COMPONENTS OF THE SAME
014503,000329:                                                                                                  #      X   Y   Z
014504,000330:                                                                                                  #  VECTOR IN THE ORIGINAL S/C AXES (B , B , B ) ARE
014505,000331:                                                                                                  #                                    X   Y   Z
014506,000332: 
014507,000333:                                                                                                  #        ( B  )                  ( A  )
014508,000334:                                                                                                  #        (  X )                  (  X )
014509,000335:                                                                                                  #        (    )            *     (    )
014510,000336:                                                                                                  #        ( B  )     =     DEL    ( A  )
014511,000337:                                                                                                  #        (  Y )                  (  Y )
014512,000338:                                                                                                  #        (    )                  (    )
014513,000339:                                                                                                  #        ( B  )                  ( A  )
014514,000340:                                                                                                  #        (  Z )                  (  Z )
014515,000341: 
014516,000342:                                                                                                  #  THE ROUTINE WILL STORE THIS MATRIX (SCALED UNITY) IN SEQUENTIAL LOCATIONS OF ERASABLE MEMORY BEGINNING WITH
014517,000343:                                                                                                  #                                                                                              -
014518,000344:                                                                                                  #  THE LOCATION CALLED DEL.  IN ORDER TO USE THE ROUTINE, THE CALLING PROGRAM MUST FIRST STORE U (A HALF UNIT
014519,000345:                                                                                                  #  DOUBLE PRECISION VECTOR) IN THE SET OF ERASABLE LOCATIONS BEGINNING WITH THE ADDRESS CALLED COF.  THE ANGLE, A,
014520,000346:                                                                                                  #  MUST THEN BE LOADED INTO D(MPAC).
014521,000347:                                                                                                  #  
014522,000348:                                                                                                  #  INTERNALLY, THE PROGRAM ALSO USES THE FIRST 10 LOCATIONS OF THE PUSH DOWN LIST.
014523,000349: 
014524,000350:                                                                                                  #  READCDUK
014525,000351:                                                                                                  #  --------
014526,000352: 
014527,000353:                                                                                                  #  THIS BASIC LANGUAGE SUBROUTINE LOADS T(MPAC) WITH THE THREE CDU ANGLES.
014528,000354: 
014529,000355:                                                                                                  #  SIGNMPAC
014530,000356:                                                                                                  #  --------
014531,000357: 
014532,000358:                                                                                                  #  THIS IS A BASIC LANGUAGE SUBROUTINE WHICH LIMITS THE MAGNITUDE OF D(MPAC) TO + OR - DPOSMAX ON OVERFLOW.
014533,000359: 
014534,000360:                                                                                                  #  PROGRAM STORAGE ALLOCATION
014535,000361: 
014536,000362:                                                                                                  #        1)      FIXED MEMORY            1059 WORDS
014537,000363:                                                                                                  #        2)      ERASABLE MEMORY           98
014538,000364:                                                                                                  #        3)      STATE SWITCHES             3

Page 351

014540,000366:                                                                                                  #        4)      FLAGS                      1
014541,000367: 
014542,000368:                                                                                                  #  JOB PRIORITIES
014543,000369: 
014544,000370:                                                                                                  #        1)      KALCMANU                TBD
014545,000371:                                                                                                  #        2)      ONE SECOND UPDATE       TBD
014546,000372: 
014547,000373:                                                                                                  #  SUMMARY OF STATE SWITCHES AND FLAGWORDS USED BY KALCMANU.
014548,000374: 
014549,000375:                                                                                                  #        STATE           FLAGWRD 2       SETTING         MEANING
014550,000376:                                                                                                  #        SWITCH NO.      BIT NO.
014551,000377: 
014552,000378:                                                                                                  #          *
014553,000379:                                                                                                  #        31              14              0               MANEUVER WENT THROUGH GIMBAL LOCK
014554,000380:                                                                                                  #                                        1               MANEUVER DID NOT GO THROUGH GIMBAL LOCK
014555,000381:                                                                                                  #          *
014556,000382:                                                                                                  #        32              13              0               CONTINUE UPDATE PROCESS
014557,000383:                                                                                                  #                                        1               START UPDATE PROCESS
014558,000384: 
014559,000385:                                                                                                  #        33              12              0               PERFORM FINAL P-AXIS YAW IF REQUIRED
014560,000386:                                                                                                  #                                        1               IGNORE ANY FINAL P-AXIS YAW
014561,000387: 
014562,000388:                                                                                                  #        34              11              0               SIGNAL END OF KALCMANU
014563,000389:                                                                                                  #                                        1               KALCMANU IN PROCESS     USER MUST SET SWITCH BEFORE INITIATING
014564,000390: 
014565,000391:                                                                                                  #        * INTERNAL TO KALCMANU
014566,000392: 
014567,000393:                                                                                                  #  SUGGESTIONS FOR PROGRAM INTEGRATION
014568,000394: 
014569,000395:                                                                                                  #  THE FOLLOWING VARIABLES SHOULD BE ASSIGNED TO UNSWITCH ERASABLE
014570,000396: 
014571,000397:                                                                                                  #        CPHI
014572,000398:                                                                                                  #        CTHETA
014573,000399:                                                                                                  #        CPSI
014574,000400:                                                                                                  #        POINTVSM +5
014575,000401:                                                                                                  #        SCAXIS +5
014576,000402:                                                                                                  #        DELDCDU
014577,000403:                                                                                                  #        DELDCDU1
014578,000404:                                                                                                  #        DELDCDU2
014579,000405:                                                                                                  #        RATEINDX
014580,000406: 
014581,000407:                                                                                                  #  THE FOLLOWING SUBROUTINES MAY BE PUT IN A DIFFERENT BANK
014582,000408: 
014583,000409:                                                                                                  #        MXM3

Page 352

014585,000411:                                                                                                  #        TRANSPOS
014586,000412:                                                                                                  #        SIGNMPAC
014587,000413:                                                                                                  #        READCDUK
014588,000414:                                                                                                  #        CDUTODCM
014589,000415: 

Page 353

014591,000417: 15,2050                                           BANK     15                                    
014592,000418: 22,2000                                           SETLOC   KALCMON1                              
014593,000419: 22,2000                                           BANK                                           
014594,000420: 
014595,000421: 22,2004  E6,1675                                  EBANK=   BCDU                                  
014596,000422: 
014597,000423:                                                                                                  #  THE THREE DESIRED CDU ANGLES MUST BE STORED AS SINGLE PRECISION TWOS COMPLEMENT ANGLES IN THE THREE SUCCESSIVE
014598,000424:                                                                                                  #  LOCATIONS, CPHI, CTHETA, CPSI.
014599,000425: 
014600,000426: 22,2004                                           COUNT*   $$/KALC                               
014601,000427: 22,2004           06042        KALCMAN3           TC       INTPRET                               #  PICK UP THE CURRENT CDU ANGLES AND
014602,000428: 22,2005           77634                           RTB                                            #        COMPUTE THE MATRIX FROM INITIAL S/C
014603,000429: 22,2006           44403                                    READCDUK                              #        AXES TO FINAL S/C AXES
014604,000430: 22,2007           03276                           STORE    BCDU                                  #  STORE INITIAL S/C ANGLES
014605,000431: 22,2010           51535                           SLOAD    ABS                                   #  CHECK THE MAGNITUDE OF THE DESIRED
014606,000432: 22,2011           00324                                    CPSI                                  #  MIDDLE GIMBAL ANGLE
014607,000433: 22,2012           51025                           DSU      BPL                                   
014608,000434: 22,2013           04403                                    LOCKANGL                              #  IF GREATER THAN 70 DEG ABORT MANEUVER
014609,000435: 22,2014           44724                                    TOOBADF                               
014610,000436: 22,2015           72364                           AXC,2    TLOAD                                 
014611,000437: 22,2016           03245                                    MIS                                   
014612,000438: 22,2017           03276                                    BCDU                                  
014613,000439: 22,2020           77624                           CALL                                           #  COMPUTE THE TRANSFORMATION FROM INITIAL
014614,000440: 22,2021           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES
014615,000441: 22,2022           72364                           AXC,2    TLOAD                                 
014616,000442: 22,2023           02230                                    MFS                                   #  PREPARE TO CALCULATE ARRAY MFS
014617,000443: 22,2024           00322                                    CPHI                                  
014618,000444: 22,2025           77624                           CALL                                           
014619,000445: 22,2026           44410                                    CDUTODCM                              
014620,000446: 22,2027           45160        SECAD              AXC,1    CALL                                  #  MIS AND MFS ARRAYS CALCULATED         $2
014621,000447: 22,2030           03245                                    MIS                                   
014622,000448: 22,2031           44326                                    TRANSPOS                              
014623,000449: 22,2032           45575                           VLOAD    STADR                                 
014624,000450: 22,2033           50460                           STOVL    TMIS       +12D                       
014625,000451: 22,2034           77626                           STADR                                          
014626,000452: 22,2035           50466                           STOVL    TMIS       +6                         
014627,000453: 22,2036           77626                           STADR                                          
014628,000454: 22,2037           74474                           STORE    TMIS                                  #  TMIS = TRANSPOSE(MIS) SCALED BY 2
014629,000455: 22,2040           75160                           AXC,1    AXC,2                                 
014630,000456: 22,2041           03302                                    TMIS                                  
014631,000457: 22,2042           02230                                    MFS                                   
014632,000458: 22,2043           77624                           CALL                                           
014633,000459: 22,2044           44312                                    MXM3                                  
014634,000460: 22,2045           45575                           VLOAD    STADR                                 
014635,000461: 22,2046           51532                           STOVL    MFI        +12D                       
014636,000462: 22,2047           77626                           STADR                                          
014637,000463: 22,2050           51540                           STOVL    MFI        +6                         
014638,000464: 22,2051           77626                           STADR                                          
014639,000465: 22,2052           75546                           STORE    MFI                                   #  MFI = TMIS MFS (SCALED BY 4)
014640,000466: 22,2053           45001                           SETPD    CALL                                  #  TRANSPOSE MFI IN PD LIST

Page 354

014642,000468: 22,2054           00023                                    18D                                   
014643,000469: 22,2055           44335                                    TRNSPSPD                              
014644,000470: 22,2056           45575                           VLOAD    STADR                                 
014645,000471: 22,2057           50460                           STOVL    TMFI       +12D                       
014646,000472: 22,2060           77626                           STADR                                          
014647,000473: 22,2061           50466                           STOVL    TMFI       +6                         
014648,000474: 22,2062           77626                           STADR                                          
014649,000475: 22,2063           74474                           STORE    TMFI                                  #  TMFI = TRANSPOSE (MFI) SCALED BY 4
014650,000476: 
014651,000477:                                                                                                  #  CALCULATE COFSKEW AND MFISYM
014652,000478: 
014653,000479: 22,2064           45345                           DLOAD    DSU                                   
014654,000480: 22,2065           03305                                    TMFI       +2                         
014655,000481: 22,2066           02233                                    MFI        +2                         
014656,000482: 22,2067           45325                           PDDL     DSU                                   #  CALCULATE COF SCALED BY 2/SIN(AM)
014657,000483: 22,2070           02235                                    MFI        +4                         
014658,000484: 22,2071           03307                                    TMFI       +4                         
014659,000485: 22,2072           45325                           PDDL     DSU                                   
014660,000486: 22,2073           03315                                    TMFI       +10D                       
014661,000487: 22,2074           02243                                    MFI        +10D                       
014662,000488: 22,2075           77666                           VDEF                                           
014663,000489: 22,2076           03325                           STORE    COFSKEW                               #  EQUALS MFISKEW
014664,000490: 
014665,000491:                                                                                                  #  CALCULATE AM AND PROCEED ACCORDING TO ITS MAGNITUDE
014666,000492: 
014667,000493: 22,2077           43345                           DLOAD    DAD                                   
014668,000494: 22,2100           02231                                    MFI                                   
014669,000495: 22,2101           02251                                    MFI        +16D                       
014670,000496: 22,2102           43225                           DSU      DAD                                   
014671,000497: 22,2103           06514                                    DP1/4TH                               
014672,000498: 22,2104           02241                                    MFI        +8D                        
014673,000499: 22,2105           03333                           STORE    CAM                                   #  CAM = (MFI0+MFI4+MFI8-1)/2 HALF SCALE
014674,000500: 22,2106           77726                           ARCCOS                                         
014675,000501: 22,2107           03335                           STORE    AM                                    #  AM=ARCCOS(CAM)        (AM SCALED BY 2)
014676,000502: 22,2110           51025                           DSU      BPL                                   
014677,000503: 22,2111           04363                                    MINANG                                
014678,000504: 22,2112           44117                                    CHECKMAX                              
014679,000505: 22,2113           77751                           TLOAD                                          #  MANEUVER LESS THAN .25 DEGREES
014680,000506: 22,2114           00322                                    CPHI                                  #  GO DIRECTLY INTO ATTITUDE HOLD
014681,000507: 22,2115           37235                           STCALL   CDUXD                                 #  ABOUT COMMANDED ANGLES
014682,000508: 22,2116           44742                                    TOOBADI                               #  STOP RATE AND EXIT
014683,000509: 
014684,000510: 22,2117           45345        CHECKMAX           DLOAD    DSU                                   
014685,000511: 22,2120           03335                                    AM                                    
014686,000512: 22,2121           04365                                    MAXANG                                
014687,000513: 22,2122           77244                           BPL      VLOAD                                 
014688,000514: 22,2123           44131                                    ALTCALC                               #  UNIT
014689,000515: 22,2124           03325                                    COFSKEW                               #  COFSKEW
014690,000516: 22,2125           77656                           UNIT                                           
014691,000517: 22,2126           03270                           STORE    COF                                   #  COF IS THE MANEUVER AXIS

Page 355

014693,000519: 22,2127           77650                           GOTO                                           #  SEE IF MANEUVER GOES THRU GIMBAL LOCK
014694,000520: 22,2130           44744                                    LOCSKIRT                              
014695,000521: 22,2131           53375        ALTCALC            VLOAD    VAD                                   #  IF AM GREATER THAN 170 DEGREES
014696,000522: 22,2132           02231                                    MFI                                   
014697,000523: 22,2133           03303                                    TMFI                                  
014698,000524: 22,2134           77762                           VSR1                                           
014699,000525: 22,2135           27303                           STOVL    MFISYM                                
014700,000526: 22,2136           02237                                    MFI        +6                         
014701,000527: 22,2137           74455                           VAD      VSR1                                  
014702,000528: 22,2140           03311                                    TMFI       +6                         
014703,000529: 22,2141           27311                           STOVL    MFISYM     +6                         
014704,000530: 22,2142           02245                                    MFI        +12D                       
014705,000531: 22,2143           74455                           VAD      VSR1                                  
014706,000532: 22,2144           03317                                    TMFI       +12D                       
014707,000533: 22,2145           03317                           STORE    MFISYM     +12D                       #  MFISYM=(MFI+TMFI)/2   SCALED BY 4
014708,000534: 
014709,000535:                                                                                                  #  CALCULATE COF
014710,000536: 
014711,000537: 22,2146           70545                           DLOAD    SR1                                   
014712,000538: 22,2147           03333                                    CAM                                   
014713,000539: 22,2150           45325                           PDDL     DSU                                   #  PDO CAM                               $4
014714,000540: 22,2151           06522                                    DPHALF                                
014715,000541: 22,2152           03333                                    CAM                                   
014716,000542: 22,2153           65204                           BOVB     PDDL                                  #  PD2 1 - CAM                           $2
014717,000543: 22,2154           21713                                    SIGNMPAC                              
014718,000544: 22,2155           03323                                    MFISYM     +16D                       
014719,000545: 22,2156           56225                           DSU      DDV                                   
014720,000546: 22,2157           00001                                    0                                     
014721,000547: 22,2160           00003                                    2                                     
014722,000548: 22,2161           65366                           SQRT     PDDL                                  #  COFZ = SQRT(MFISYM8-CAM)/1-CAM)
014723,000549: 22,2162           03313                                    MFISYM     +8D                        #                                $ ROOT 2
014724,000550: 22,2163           56225                           DSU      DDV                                   
014725,000551: 22,2164           00001                                    0                                     
014726,000552: 22,2165           00003                                    2                                     
014727,000553: 22,2166           65366                           SQRT     PDDL                                  #  COFY = SQRT(MFISYM4-CAM)/(1-CAM)      $ROOT2
014728,000554: 22,2167           03303                                    MFISYM                                
014729,000555: 22,2170           56225                           DSU      DDV                                   
014730,000556: 22,2171           00001                                    0                                     
014731,000557: 22,2172           00003                                    2                                     
014732,000558: 22,2173           55566                           SQRT     VDEF                                  #  COFX = SQRT(MFISYM-CAM)/(1-CAM)       $ROOT 2
014733,000559: 22,2174           77656                           UNIT                                           
014734,000560: 22,2175           03270                           STORE    COF                                   
014735,000561: 
014736,000562:                                                                                                  #  DETERMINE LARGEST COF AND ADJUST ACCORDINGLY
014737,000563: 
014738,000564: 22,2176           45345        COFMAXGO           DLOAD    DSU                                   
014739,000565: 22,2177           03270                                    COF                                   
014740,000566: 22,2200           03272                                    COF        +2                         
014741,000567: 22,2201           71240                           BMN      DLOAD                                 #  COFY G COFX

Page 356

014743,000569: 22,2202           44211                                    COMP12                                
014744,000570: 22,2203           03270                                    COF                                   
014745,000571: 22,2204           50025                           DSU      BMN                                   
014746,000572: 22,2205           03274                                    COF        +4                         
014747,000573: 22,2206           44266                                    METHOD3                               #  COFZ G COFX OR COFY
014748,000574: 22,2207           77650                           GOTO                                           
014749,000575: 22,2210           44242                                    METHOD1                               #  COFX G COFY OR COFZ
014750,000576: 22,2211           45345        COMP12             DLOAD    DSU                                   
014751,000577: 22,2212           03272                                    COF        +2                         
014752,000578: 22,2213           03274                                    COF        +4                         
014753,000579: 22,2214           77640                           BMN                                            
014754,000580: 22,2215           44266                                    METHOD3                               #  COFZ G COFY OR COFX
014755,000581: 
014756,000582: 22,2216           51145        METHOD2            DLOAD    BPL                                   #  COFY MAX
014757,000583: 22,2217           03327                                    COFSKEW    +2                         #  UY
014758,000584: 22,2220           44224                                    U2POS                                 
014759,000585: 22,2221           57575                           VLOAD    VCOMP                                 
014760,000586: 22,2222           03270                                    COF                                   
014761,000587: 22,2223           03270                           STORE    COF                                   
014762,000588: 22,2224           51145        U2POS              DLOAD    BPL                                   
014763,000589: 22,2225           03305                                    MFISYM     +2                         #  UX UY
014764,000590: 22,2226           44232                                    OKU21                                 
014765,000591: 22,2227           57545                           DLOAD    DCOMP                                 #  SIGN OF UX OPPOSITE TO UY
014766,000592: 22,2230           03270                                    COF                                   
014767,000593: 22,2231           03270                           STORE    COF                                   
014768,000594: 22,2232           51145        OKU21              DLOAD    BPL                                   
014769,000595: 22,2233           03315                                    MFISYM     +10D                       #  UY UZ
014770,000596: 22,2234           44744                                    LOCSKIRT                              
014771,000597: 22,2235           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
014772,000598: 22,2236           03274                                    COF        +4                         
014773,000599: 22,2237           03274                           STORE    COF        +4                         
014774,000600: 22,2240           77650                           GOTO                                           
014775,000601: 22,2241           44744                                    LOCSKIRT                              
014776,000602: 22,2242           51145        METHOD1            DLOAD    BPL                                   #  COFX MAX
014777,000603: 22,2243           03325                                    COFSKEW                               #  UX
014778,000604: 22,2244           44250                                    U1POS                                 
014779,000605: 22,2245           57575                           VLOAD    VCOMP                                 
014780,000606: 22,2246           03270                                    COF                                   
014781,000607: 22,2247           03270                           STORE    COF                                   
014782,000608: 22,2250           51145        U1POS              DLOAD    BPL                                   
014783,000609: 22,2251           03305                                    MFISYM     +2                         #  UX UY
014784,000610: 22,2252           44256                                    OKU12                                 
014785,000611: 22,2253           57545                           DLOAD    DCOMP                                 
014786,000612: 22,2254           03272                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UX
014787,000613: 22,2255           03272                           STORE    COF        +2                         
014788,000614: 22,2256           51145        OKU12              DLOAD    BPL                                   
014789,000615: 22,2257           03307                                    MFISYM     +4                         #  UX UZ
014790,000616: 22,2260           44744                                    LOCSKIRT                              
014791,000617: 22,2261           57545                           DLOAD    DCOMP                                 #  SIGN OF UZ OPPOSITE TO UY
014792,000618: 22,2262           03274                                    COF        +4                         

Page 357

014794,000620: 22,2263           03274                           STORE    COF        +4                         
014795,000621: 22,2264           77650                           GOTO                                           
014796,000622: 22,2265           44744                                    LOCSKIRT                              
014797,000623: 22,2266           51145        METHOD3            DLOAD    BPL                                   #  COFZ MAX
014798,000624: 22,2267           03331                                    COFSKEW    +4                         #  UZ
014799,000625: 22,2270           44274                                    U3POS                                 
014800,000626: 22,2271           57575                           VLOAD    VCOMP                                 
014801,000627: 22,2272           03270                                    COF                                   
014802,000628: 22,2273           03270                           STORE    COF                                   
014803,000629: 22,2274           51145        U3POS              DLOAD    BPL                                   
014804,000630: 22,2275           03307                                    MFISYM     +4                         #  UX UZ
014805,000631: 22,2276           44302                                    OKU31                                 
014806,000632: 22,2277           57545                           DLOAD    DCOMP                                 
014807,000633: 22,2300           03270                                    COF                                   #  SIGN OF UX OPPOSITE TO UZ
014808,000634: 22,2301           03270                           STORE    COF                                   
014809,000635: 22,2302           51145        OKU31              DLOAD    BPL                                   
014810,000636: 22,2303           03315                                    MFISYM     +10D                       #  UY UZ
014811,000637: 22,2304           44744                                    LOCSKIRT                              
014812,000638: 22,2305           57545                           DLOAD    DCOMP                                 
014813,000639: 22,2306           03272                                    COF        +2                         #  SIGN OF UY OPPOSITE TO UZ
014814,000640: 22,2307           03272                           STORE    COF        +2                         
014815,000641: 22,2310           77650                           GOTO                                           
014816,000642: 22,2311           44744                                    LOCSKIRT                              

Page 358

014818,000644:                                                                                                  #  MATRIX OPERATIONS
014819,000645: 
014820,000646: 13,2207                                           BANK     13                                    
014821,000647: 22,2000                                           SETLOC   KALCMON2                              
014822,000648: 22,2000                                           BANK                                           
014823,000649: 
014824,000650: 22,2312  E6,1675                                  EBANK=   BCDU                                  
014825,000651: 
014826,000652: 22,2312           76601        MXM3               SETPD    VLOAD*                                #  MXM3 MULTIPLIES 2 3X3 MATRICES
014827,000653: 22,2313           00001                                    0                                     #  AND LEAVES RESULT IN PD LIST
014828,000654: 22,2314           00001                                    0,1                                   #  AND MPAC
014829,000655: 22,2315           62703                           VXM*     PDVL*                                 
014830,000656: 22,2316           77776                                    0,2                                   
014831,000657: 22,2317           00007                                    6,1                                   
014832,000658: 22,2320           62703                           VXM*     PDVL*                                 
014833,000659: 22,2321           77776                                    0,2                                   
014834,000660: 22,2322           00015                                    12D,1                                 
014835,000661: 22,2323           41503                           VXM*     PUSH                                  
014836,000662: 22,2324           77776                                    0,2                                   
014837,000663: 22,2325           77616                           RVQ                                            
014838,000664: 
014839,000665:                                                                                                  #  RETURN WITH M1XM2 IN PD LIST
014840,000666: 
014841,000667: 22,2326           76601        TRANSPOS           SETPD    VLOAD*                                #  TRANSPOS TRANSPOSES A 3X3 MATRIX
014842,000668: 22,2327           00001                                    0                                     #        AND LEAVES RESULT IN PD LIST
014843,000669: 22,2330           00001                                    0,1                                   #  MATRIX ADDRESS IN XR1
014844,000670: 22,2331           62713                           PDVL*    PDVL*                                 
014845,000671: 22,2332           00007                                    6,1                                   
014846,000672: 22,2333           00015                                    12D,1                                 
014847,000673: 22,2334           77606                           PUSH                                           #  MATRIX IN PD
014848,000674: 22,2335           77776        TRNSPSPD           EXIT                                           #  ENTER WITH MATRIX AT 0 IN PD LIST
014849,000675: 22,2336           50120                           INDEX    FIXLOC                                
014850,000676: 22,2337           52013                           DXCH     12                                    
014851,000677: 22,2340           50120                           INDEX    FIXLOC                                
014852,000678: 22,2341           52017                           DXCH     16                                    
014853,000679: 22,2342           50120                           INDEX    FIXLOC                                
014854,000680: 22,2343           52013                           DXCH     12                                    
014855,000681: 22,2344           50120                           INDEX    FIXLOC                                
014856,000682: 22,2345           52015                           DXCH     14                                    
014857,000683: 22,2346           50120                           INDEX    FIXLOC                                
014858,000684: 22,2347           52005                           DXCH     4                                     
014859,000685: 22,2350           50120                           INDEX    FIXLOC                                
014860,000686: 22,2351           52015                           DXCH     14                                    
014861,000687: 22,2352           50120                           INDEX    FIXLOC                                
014862,000688: 22,2353           52003                           DXCH     2                                     
014863,000689: 22,2354           50120                           INDEX    FIXLOC                                
014864,000690: 22,2355           52007                           DXCH     6                                     
014865,000691: 22,2356           50120                           INDEX    FIXLOC                                
014866,000692: 22,2357           52003                           DXCH     2                                     

Page 359

014868,000694: 22,2360           06042                           TC       INTPRET                               
014869,000695: 22,2361           77616                           RVQ                                            
014870,000696: 
014871,000697: 15,2050                                           BANK     15                                    
014872,000698: 22,2000                                           SETLOC   KALCMON1                              
014873,000699: 22,2000                                           BANK                                           
014874,000700: 
014875,000701: 22,2362  E6,1675                                  EBANK=   BCDU                                  
014876,000702: 
014877,000703: 22,2362           00013 13563  MINANG             2DEC     0.00069375                            
014878,000704: 22,2364           17070 34343  MAXANG             2DEC     0.472222222                            
014879,000705: 
014880,000706:                                                                                                  #  GIMBAL LOCK CONSTANTS
014881,000707: 
014882,000708:                                                                                                  #  D = MGA CORRESPONDING TO GIMBAL LOCK = 60 DEGREES
014883,000709:                                                                                                  #        NGL = BUFFER ANGLE (TO AVOID DIVISIONS BY ZERO) = 2 DEGREES
014884,000710: 
014885,000711: 22,2366           15666 20443  SD                 2DEC     .433015                               #  = SIN(D)                              $2
014886,000712: 22,2370           33555 01106  K3S1               2DEC     .86603                                #  = SIN(D)                              $1
014887,000713: 22,2372           67777 77777  K4                 2DEC     -.25                                  #  = -COS(D)                             $2
014888,000714: 22,2374           04000 00000  K4SQ               2DEC     .125                                  #  = COS(D)COS(D)                        $2
014889,000715: 22,2376           00216 36323  SNGLCD             2DEC     .008725                               #  = SIN(NGL)COS(D)                      $2
014890,000716: 22,2400           17773 00057  CNGL               2DEC     .499695                               #  COS(NGL)                              $2
014891,000717: 22,2402           14344        LOCKANGL           DEC      .388889                               #  = 70 DEGREES
014892,000718: 
014893,000719:                                                                                                  #  INTERPRETIVE SUBROUTINE TO READ THE CDU ANGLES
014894,000720: 
014895,000721: 22,2403           30034        READCDUK           CA       CDUZ                                  #  LOAD T(MPAC) WITH CDU ANGLES
014896,000722: 22,2404           54156                           TS       MPAC       +2                         
014897,000723: 22,2405           00006                           EXTEND                                         
014898,000724: 22,2406           30033                           DCA      CDUX                                  #  AND CHANGE MODE TO TRIPLE PRECISION
014899,000725: 22,2407           16501                           TCF      TLOAD      +6                         
014900,000726: 
014901,000727: 22,2410           66370        CDUTODCM           AXT,1    SSP                                   
014902,000728: 22,2411           00003                           OCT      3                                     
014903,000729: 22,2412           00051                                    S1                                    
014904,000730: 22,2413           00001                           OCT      1                                     #  SET XR1, S1, AND PD FOR LOOP
014905,000731: 22,2414           00010                           STORE    7                                     
014906,000732: 22,2415           77601                           SETPD                                          
014907,000733: 22,2416           00001                                    0                                     
014908,000734: 22,2417           47133        LOOPSIN            SLOAD*   RTB                                   
014909,000735: 22,2420           00013                                    10D,1                                 
014910,000736: 22,2421           21577                                    CDULOGIC                              

Page 360

014912,000738: 22,2422           00013                           STORE    10D                                   #  LOAD PD WITH  0 SIN(PHI)
014913,000739: 22,2423           65356                           SIN      PDDL                                  #                2 COS(PHI)
014914,000740: 22,2424           00013                                    10D                                   #                4 SIN(THETA)
014915,000741: 22,2425           41546                           COS      PUSH                                  #                6 COS(THETA)
014916,000742: 22,2426           71300                           TIX,1    DLOAD                                 #                8 SIN(PSI)
014917,000743: 22,2427           44417                                    LOOPSIN                               #                10 COS(PSI)
014918,000744: 22,2430           00007                                    6                                     
014919,000745: 22,2431           72405                           DMP      SL1                                   
014920,000746: 22,2432           00013                                    10D                                   
014921,000747: 22,2433           10001                           STORE    0,2                                   #  C0 = COS(THETA)COS(PSI)
014922,000748: 22,2434           41345                           DLOAD    DMP                                   
014923,000749: 22,2435           00005                                    4                                     
014924,000750: 22,2436           00001                                    0                                     
014925,000751: 22,2437           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI))
014926,000752: 22,2440           00007                                    6                                     
014927,000753: 22,2441           00011                                    8D                                    
014928,000754: 22,2442           72405                           DMP      SL1                                   
014929,000755: 22,2443           00003                                    2                                     
014930,000756: 22,2444           72421                           BDSU     SL1                                   
014931,000757: 22,2445           00015                                    12D                                   
014932,000758: 22,2446           10003                           STORE    2,2                                   #  C1=-COS(THETA)SIN(PSI)COS(PHI)
014933,000759: 22,2447           41345                           DLOAD    DMP                                   
014934,000760: 22,2450           00003                                    2                                     
014935,000761: 22,2451           00005                                    4                                     
014936,000762: 22,2452           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)) SCALED 4
014937,000763: 22,2453           00007                                    6                                     
014938,000764: 22,2454           00011                                    8D                                    
014939,000765: 22,2455           72405                           DMP      SL1                                   
014940,000766: 22,2456           00001                                    0                                     
014941,000767: 22,2457           72415                           DAD      SL1                                   
014942,000768: 22,2460           00017                                    14D                                   
014943,000769: 22,2461           10005                           STORE    4,2                                   #  C2=COS(THETA)SIN(PSI)SIN(PHI)
014944,000770: 22,2462           77745                           DLOAD                                          
014945,000771: 22,2463           00011                                    8D                                    
014946,000772: 22,2464           10007                           STORE    6,2                                   #  C3=SIN(PSI)
014947,000773: 22,2465           77745                           DLOAD                                          
014948,000774: 22,2466           00013                                    10D                                   
014949,000775: 22,2467           72405                           DMP      SL1                                   
014950,000776: 22,2470           00003                                    2                                     
014951,000777: 22,2471           10011                           STORE    8D,2                                  #  C4=COS(PSI)COS(PHI)
014952,000778: 22,2472           41345                           DLOAD    DMP                                   
014953,000779: 22,2473           00013                                    10D                                   
014954,000780: 22,2474           00001                                    0                                     
014955,000781: 22,2475           72476                           DCOMP    SL1                                   
014956,000782: 22,2476           10013                           STORE    10D,2                                 #  C5=-COS(PSI)SIN(PHI)
014957,000783: 22,2477           41345                           DLOAD    DMP                                   
014958,000784: 22,2500           00005                                    4                                     
014959,000785: 22,2501           00013                                    10D                                   
014960,000786: 22,2502           72476                           DCOMP    SL1                                   
014961,000787: 22,2503           10015                           STORE    12D,2                                 #  C6=-SIN(THETA)COS(PSI)

Page 361

014963,000789: 22,2504           77745                           DLOAD                                          
014964,000790: 22,2505           72405                           DMP      SL1                                   #  (PUSH UP 7)
014965,000791: 22,2506           00011                                    8D                                    
014966,000792: 22,2507           41325                           PDDL     DMP                                   #  (PD7 COS(PHI)SIN(THETA)SIN(PSI)) SCALE 4
014967,000793: 22,2510           00007                                    6                                     
014968,000794: 22,2511           00001                                    0                                     
014969,000795: 22,2512           72415                           DAD      SL1                                   #  (PUSH UP 7)
014970,000796: 22,2513           77626                           STADR                                          #  C7=COS(PHI)SIN(THETA)SIN(PSI)
014971,000797: 22,2514           67760                           STORE    14D,2                                 #        +COS(THETA)SIN(PHI)
014972,000798: 22,2515           77745                           DLOAD                                          
014973,000799: 22,2516           72405                           DMP      SL1                                   #  (PUSH UP 6)
014974,000800: 22,2517           00011                                    8D                                    
014975,000801: 22,2520           41325                           PDDL     DMP                                   #  (PD6 SIN(THETA)SIN(PHI)SIN(PSI)) SCALE 4
014976,000802: 22,2521           00007                                    6                                     
014977,000803: 22,2522           00003                                    2                                     
014978,000804: 22,2523           72425                           DSU      SL1                                   #  (PUSH UP 6)
014979,000805: 22,2524           77626                           STADR                                          
014980,000806: 22,2525           67756                           STORE    16D,2                                 #  C8=-SIN(THETA)SIN(PHI)SIN(PSI)
014981,000807: 22,2526           77616                           RVQ                                            #  +COS(THETA)COS(PHI)
014982,000808: 
014983,000809:                                                                                                  #  CALCULATION OF THE MATRIX DEL......
014984,000810: 
014985,000811:                                                                                                  #         *         *           --T           *
014986,000812:                                                                                                  #        DEL = (IDMATRIX)COS(A)+UU (1-COS(A))+UX SIN(A)          SCALED 1
014987,000813:                                                                                                  #              -
014988,000814:                                                                                                  #        WHERE U IS A UNIT VECTOR (DP SCALED 2) ALONG THE AXIS OF ROTATION.
014989,000815:                                                                                                  #        A IS THE ANGLE OF ROTATION (DP SCALED 2)
014990,000816:                                                                                                  #                                           -
014991,000817:                                                                                                  #        UPON ENTRY THE STARTING ADDRESS OF U IS COF, AND A IS IN MPAC
014992,000818: 
014993,000819: 22,2527           41401        DELCOMP            SETPD    PUSH                                  #  MPAC CONTAINS THE ANGLE A
014994,000820: 22,2530           00001                                    0                                     
014995,000821: 22,2531           65356                           SIN      PDDL                                  #  PD0 = SIN(A)
014996,000822: 22,2532           41546                           COS      PUSH                                  #  PD2 = COS(A)
014997,000823: 22,2533           65302                           SR2      PDDL                                  #  PD2 = COS(A)                                  $8
014998,000824: 22,2534           41021                           BDSU     BOVB                                  
014999,000825: 22,2535           06522                                    DPHALF                                
015000,000826: 22,2536           21713                                    SIGNMPAC                              
015001,000827: 22,2537           77725                           PDDL                                           #  PD4 = 1-COS(A)
015002,000828: 
015003,000829:                                                                                                  #  COMPUTE THE DIAGONAL COMPONENTS OF DEL
015004,000830: 
015005,000831: 22,2540           03270                                    COF                                   
015006,000832: 22,2541           41316                           DSQ      DMP                                   
015007,000833: 22,2542           00005                                    4                                     
015008,000834: 22,2543           52415                           DAD      SL3                                   
015009,000835: 22,2544           00003                                    2                                     
015010,000836: 22,2545           77604                           BOVB                                           
015011,000837: 22,2546           21713                                    SIGNMPAC                              

Page 362

015013,000839: 22,2547           16231                           STODL    KEL                                   #  UX UX(1-COS(A)) +COS(A)               $1
015014,000840: 22,2550           03272                                    COF        +2                         
015015,000841: 22,2551           41316                           DSQ      DMP                                   
015016,000842: 22,2552           00005                                    4                                     
015017,000843: 22,2553           52415                           DAD      SL3                                   
015018,000844: 22,2554           00003                                    2                                     
015019,000845: 22,2555           77604                           BOVB                                           
015020,000846: 22,2556           21713                                    SIGNMPAC                              
015021,000847: 22,2557           16241                           STODL    KEL        +8D                        #  UY UY(1-COS(A)) +COS(A)               $1
015022,000848: 22,2560           03274                                    COF        +4                         
015023,000849: 22,2561           41316                           DSQ      DMP                                   
015024,000850: 22,2562           00005                                    4                                     
015025,000851: 22,2563           52415                           DAD      SL3                                   
015026,000852: 22,2564           00003                                    2                                     
015027,000853: 22,2565           77604                           BOVB                                           
015028,000854: 22,2566           21713                                    SIGNMPAC                              
015029,000855: 22,2567           02251                           STORE    KEL        +16D                       #  UZ UZ(1-COS(A)) +COS(A)               $1
015030,000856: 
015031,000857:                                                                                                  #  COMPUTE THE OFF DIAGONAL TERMS OF DEL
015032,000858: 
015033,000859: 22,2570           41345                           DLOAD    DMP                                   
015034,000860: 22,2571           03270                                    COF                                   
015035,000861: 22,2572           03272                                    COF        +2                         
015036,000862: 22,2573           72405                           DMP      SL1                                   
015037,000863: 22,2574           00005                                    4                                     
015038,000864: 22,2575           41325                           PDDL     DMP                                   #  D6     UX UY (1-COS A)                $4
015039,000865: 22,2576           03274                                    COF        +4                         
015040,000866: 22,2577           00001                                    0                                     
015041,000867: 22,2600           43206                           PUSH     DAD                                   #  D8    UZ SIN A                        $4
015042,000868: 22,2601           00007                                    6                                     
015043,000869: 22,2602           41112                           SL2      BOVB                                  
015044,000870: 22,2603           21713                                    SIGNMPAC                              
015045,000871: 22,2604           16237                           STODL    KEL        +6                         
015046,000872: 22,2605           62421                           BDSU     SL2                                   
015047,000873: 22,2606           77604                           BOVB                                           
015048,000874: 22,2607           21713                                    SIGNMPAC                              
015049,000875: 22,2610           16233                           STODL    KEL        +2                         
015050,000876: 22,2611           03270                                    COF                                   
015051,000877: 22,2612           41205                           DMP      DMP                                   
015052,000878: 22,2613           03274                                    COF        +4                         
015053,000879: 22,2614           00005                                    4                                     
015054,000880: 22,2615           65352                           SL1      PDDL                                  #  D6    UX UZ (1-COS A)                 $4
015055,000881: 22,2616           03272                                    COF        +2                         
015056,000882: 22,2617           41405                           DMP      PUSH                                  #  D8    UY SIN(A)
015057,000883: 22,2620           00001                                    0                                     
015058,000884: 22,2621           62415                           DAD      SL2                                   
015059,000885: 22,2622           00007                                    6                                     
015060,000886: 22,2623           77604                           BOVB                                           
015061,000887: 22,2624           21713                                    SIGNMPAC                              
015062,000888: 22,2625           16235                           STODL    KEL        +4                         #  UX UZ (1-COS(A))+UY SIN(A)

Page 363

015064,000890: 22,2626           62421                           BDSU     SL2                                   
015065,000891: 22,2627           77604                           BOVB                                           
015066,000892: 22,2630           21713                                    SIGNMPAC                              
015067,000893: 22,2631           16245                           STODL    KEL        +12D                       #  UX UZ (1-COS(A))-UY SIN(A)
015068,000894: 22,2632           03272                                    COF        +2                         
015069,000895: 22,2633           41205                           DMP      DMP                                   
015070,000896: 22,2634           03274                                    COF        +4                         
015071,000897: 22,2635           00005                                    4                                     
015072,000898: 22,2636           65352                           SL1      PDDL                                  #  D6    UY UZ (1-COS(A))                        $4
015073,000899: 22,2637           03270                                    COF                                   
015074,000900: 22,2640           41405                           DMP      PUSH                                  #  D8    UX SIN(A)
015075,000901: 22,2641           00001                                    0                                     
015076,000902: 22,2642           62415                           DAD      SL2                                   
015077,000903: 22,2643           00007                                    6                                     
015078,000904: 22,2644           77604                           BOVB                                           
015079,000905: 22,2645           21713                                    SIGNMPAC                              
015080,000906: 22,2646           16247                           STODL    KEL        +14D                       #  UY UZ(1-COS(A)) +UX SIN(A)
015081,000907: 22,2647           62421                           BDSU     SL2                                   
015082,000908: 22,2650           77604                           BOVB                                           
015083,000909: 22,2651           21713                                    SIGNMPAC                              
015084,000910: 22,2652           02243                           STORE    KEL        +10D                       #  UY UZ (1-COS(A)) -UX SIN(A)
015085,000911: 22,2653           77616                           RVQ                                            
015086,000912: 
015087,000913:                                                                                                  #  DIRECTION COSINE MATRIX TO CDU ANGLE ROUTINE
015088,000914: 
015089,000915:                                                                                                  #  X1 CONTAINS THE COMPLEMENT OF THE STARTING ADDRESS FOR MATRIX (SCALED 2)
015090,000916:                                                                                                  #  LEAVES CDU ANGLES SCALED 2PI IN V(MPAC)
015091,000917:                                                                                                  #  COS(MGA) WILL BE LEFT IN S1 (SCALED 1)
015092,000918:                                                                                                  #  THE DIRECTION COSINE MATRIX RELATING S/C AXES TO STABLE MEMBER AXES CAN BE WRITTEN AS***
015093,000919: 
015094,000920:                                                                                                  #        C =COS(THETA)COS(PSI)
015095,000921:                                                                                                  #         0
015096,000922: 
015097,000923:                                                                                                  #        C =-COS(THETA)SIN(PSI)COS(PHI)+SI (THETA)SIN(PHI)
015098,000924:                                                                                                  #         1
015099,000925: 
015100,000926:                                                                                                  #        C =COS(THETA)SIN(PSI)SIN(PHI) + S N(THETA)COS(PHI)
015101,000927:                                                                                                  #         2
015102,000928: 
015103,000929:                                                                                                  #        C =SIN(PSI)
015104,000930:                                                                                                  #         3
015105,000931: 
015106,000932:                                                                                                  #        C =COS(PSI)COS(PHI)
015107,000933:                                                                                                  #         4
015108,000934: 
015109,000935:                                                                                                  #        C =-COS(PSI)SIN(PHI)
015110,000936:                                                                                                  #         5
015111,000937: 
015112,000938:                                                                                                  #        C =-SIN(THETA)COS(PSI)
015113,000939:                                                                                                  #         6
015114,000940: 
015115,000941:                                                                                                  #        C =SIN(THETA)SIN(PSI)COS(PHI)+COS THETA)SIN(PHI)
015116,000942:                                                                                                  #         7
015117,000943: 
015118,000944:                                                                                                  #        C =-SIN(THETA)SIN(PSI)SIN(PHI)+CO (THETA)COS(PHI)
015119,000945:                                                                                                  #         8

Page 364

015121,000947: 
015122,000948:                                                                                                  #  WHERE PHI = OGA
015123,000949:                                                                                                  #        THETA = IGA
015124,000950:                                                                                                  #        PSI = MGA
015125,000951: 
015126,000952: 22,2654           67543        DCMTOCDU           DLOAD*   ARCSIN                                
015127,000953: 22,2655           00007                                    6,1                                   
015128,000954: 22,2656           71406                           PUSH     COS                                   #  PD +0         PSI
015129,000955: 22,2657           41152                           SL1      BOVB                                  
015130,000956: 22,2660           21713                                    SIGNMPAC                              
015131,000957: 22,2661           00051                           STORE    S1                                    
015132,000958: 22,2662           57543                           DLOAD*   DCOMP                                 
015133,000959: 22,2663           00015                                    12D,1                                 
015134,000960: 22,2664           67471                           DDV      ARCSIN                                
015135,000961: 22,2665           00051                                    S1                                    
015136,000962: 22,2666           51123                           PDDL*    BPL                                   #  PD +2         THETA
015137,000963: 22,2667           00001                                    0,1                                   #  MUST CHECK THE SIGN OF COS(THETA)
015138,000964: 22,2670           44702                                    OKTHETA                               #  TO DETERMINE THE PROPER QUADRANT
015139,000965: 22,2671           57545                           DLOAD    DCOMP                                 
015140,000966: 22,2672           43244                           BPL      DAD                                   
015141,000967: 22,2673           44677                                    SUHALFA                               
015142,000968: 22,2674           06522                                    DPHALF                                
015143,000969: 22,2675           77650                           GOTO                                           
015144,000970: 22,2676           44701                                    CALCPHI                               
015145,000971: 22,2677           77625        SUHALFA            DSU                                            
015146,000972: 22,2700           06522                                    DPHALF                                
015147,000973: 22,2701           77606        CALCPHI            PUSH                                           
015148,000974: 22,2702           57543        OKTHETA            DLOAD*   DCOMP                                 
015149,000975: 22,2703           00013                                    10D,1                                 
015150,000976: 22,2704           67471                           DDV      ARCSIN                                
015151,000977: 22,2705           00051                                    S1                                    
015152,000978: 22,2706           51123                           PDDL*    BPL                                   #  PUSH DOWN PHI
015153,000979: 22,2707           00011                                    8D,1                                  
015154,000980: 22,2710           44722                                    OKPHI                                 
015155,000981: 22,2711           57545                           DLOAD    DCOMP                                 #  PUSH UP PHI
015156,000982: 22,2712           43244                           BPL      DAD                                   
015157,000983: 22,2713           44717                                    SUHALFAP                              
015158,000984: 22,2714           06522                                    DPHALF                                
015159,000985: 22,2715           77650                           GOTO                                           
015160,000986: 22,2716           44723                                    VECOFANG                              
015161,000987: 22,2717           52025        SUHALFAP           DSU      GOTO                                  
015162,000988: 22,2720           06522                                    DPHALF                                
015163,000989: 22,2721           44723                                    VECOFANG                              
015164,000990: 22,2722           77745        OKPHI              DLOAD                                          #  PUSH UP PHI
015165,000991: 22,2723           43466        VECOFANG           VDEF     RVQ                                   

Page 365

015167,000993:                                                                                                  #  ROUTINES FOR TERMINATING THE AUTOMATIC MANEUVER AND RETURNING TO USER
015168,000994: 
015169,000995: 22,2724           77776        TOOBADF            EXIT                                           
015170,000996: 22,2725           05567                           TC       ALARM                                 
015171,000997: 22,2726           00401                           OCT      00401                                 
015172,000998: 
015173,000999: 22,2727           12732                           TCF      NOGO                                  #  DO NOT ZERO ATTITUDE ERRORS
015174,001000: 
015175,001001: 22,2730           04616                           TC       BANKCALL                              
015176,001002: 22,2731           40154                           CADR     ZATTEROR                              #  ZERO ATTITUDE ERRORS
015177,001003: 
015178,001004: 22,2732           04616        NOGO               TC       BANKCALL                              
015179,001005: 22,2733           40166                           CADR     STOPRATE                              #  STOP RATES
015180,001006: 
015181,001007: 22,2734           34752                           CAF      TWO                                   
015182,001008: 22,2735           00004                           INHINT                                         #  ALL RETURNS ARE NOW MADE VIA GOODEND
015183,001009: 22,2736           05203                           TC       WAITLIST                              
015184,001010: 22,2737  E6,1675                                  EBANK=   BCDU                                  
015185,001011: 22,2737           03234 44066                     2CADR    GOODMANU                              
015186,001012: 
015187,001013: 22,2741           15155                           TCF      ENDOFJOB                              
015188,001014: 
015189,001015: 22,2742           77776        TOOBADI            EXIT                                           
015190,001016: 22,2743           12732                           TCF      NOGO                                  
015191,001017: 
015192,001018: 

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