Source Code

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

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

021404,000002:                                                                                                  ## Copyright:   Public domain.
021405,000003:                                                                                                  ## Filename:    R60,R62.agc
021406,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
021407,000005:                                                                                                  ##              It is part of the source code for the original release
021408,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
021409,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
021410,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
021411,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
021412,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
021413,000011:                                                                                                  ##              that the code format has been changed to conform to the
021414,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
021415,000013:                                                                                                  ##              original YUL assembler.
021416,000014:                                                                                                  ## Reference:   pp. 485-497
021417,000015:                                                                                                  ## Assembler:   yaYUL
021418,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021419,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021420,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
021421,000019:                                                                                                  ##              2016-12-14 MAS  Updated from comment-proofed Luminary 99 version.
021422,000020:                                                                                                  ##              2017-01-20 RRB  Updated for Luminary 69.
021423,000021:                                                                                                  ##              2017-01-27 RSB  Proofed comment text using octopus/prooferComments
021424,000022:                                                                                                  ##                              and fixed errors found.
021425,000023:                                                                                                  ##              2017-03-09 RSB  Comment text fixes noted in proofing Luminary 116.
021426,000024: 

Page 485

021428,000026:                                                                                                  #  MOD NO: 0                             DATE: 1 MAY 1968
021429,000027:                                                                                                  #  MOD BY: DIGITAL DEVEL GROUP           LOG SECTION R60,R62
021430,000028: 
021431,000029:                                                                                                  #  FUNCTIONAL DESCRIPTION:
021432,000030: 
021433,000031:                                                                                                  #  CALLED AS A GENERAL SUBROUTINE TO MANEUVER THE LM TO A SPECIFIED
021434,000032:                                                                                                  #  ATTITUDE.
021435,000033: 
021436,000034:                                                                                                  #  1. IF THE 3-AXIS FLAG IS NOT SET THE FINAL CDU ANGLES ARE
021437,000035:                                                                                                  #  CALCULATED (VECPOINT).
021438,000036: 
021439,000037:                                                                                                  #  2. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
021440,000038: 
021441,000039:                                                                                                  #  3. REQUEST FLASHING DISPLAY V50 N18 PLEASE PERFORM AUTO MANEUVER.
021442,000040: 
021443,000041:                                                                                                  #  4. IF PRIORITY DISPLAY FLAG IS SET DO A PHASECHANGE. THEN AWAIT
021444,000042:                                                                                                  #  ASTRONAUT RESPONSE.
021445,000043: 
021446,000044:                                                                                                  #  5. DISPLAY RESPONSE RETURNS:
021447,000045: 
021448,000046:                                                                                                  #        A.      ENTER - RESET 3-AXIS FLAG AND RETURN TO CLIENT.
021449,000047: 
021450,000048:                                                                                                  #        B.      TERMINATE - IF IN P00 GO TO STEP 5A. OTHERWISE CHECK IF R61 IS
021451,000049:                                                                                                  #                THE CALLING PROGRAM. IF IN R61 AN EXIT IS MADE TO GOTOV56.  IF
021452,000050:                                                                                                  #                NOT IN R61 AN EXIT IS DONE VIA GOTOP00H.
021453,000051: 
021454,000052:                                                                                                  #        C.      PROCEED - CONTINUE WITH PROGRAM AT STEP 6.
021455,000053: 
021456,000054:                                                                                                  #  6. IF THE 3-AXISFLAG IS NOT SET, THE FINAL CDU ANGLES ARE CALCULATED
021457,000055:                                                                                                  #  (VECPOINT).
021458,000056: 
021459,000057:                                                                                                  #  7. THE FDAI BALL ANGLES (NOUN 18) ARE CALCULATED (BALLANGS).
021460,000058: 
021461,000059:                                                                                                  #  8. IF THE G+N SWITCH IS NOT SET GO BACK TO STEP 3.
021462,000060:                                                                                                  #  
021463,000061:                                                                                                  #  9. IF THE AUTO SWITCH IS NOT SET GO BACK TO STEP 3.
021464,000062: 
021465,000063:                                                                                                  #  10. NONFLASHING DISPLAY V06N18 (FDAI ANGLES).
021466,000064: 
021467,000065:                                                                                                  #  11. DO A PHASECHANGE.
021468,000066: 
021469,000067:                                                                                                  #  12. DO A MANEUVER CALCULATION AND ICDU DRIVE ROUTINE TO ACHIEVE FINAL
021470,000068: 
021471,000069:                                                                                                  #  GIMBAL ANGLES (GOMANUR).
021472,000070:                                                                                                  #  13. AT END OF MANEUVER GO TO STEP 3.
021473,000071: 
021474,000072:                                                                                                  #        IF SATISFACTORY MANEUVER STEP 5A EXITS R60.
021475,000073:                                                                                                  #        FOR FURTHER ADJUSTMENT OF THE VEHICLE ATTITUDE ABOUT THE
021476,000074:                                                                                                  #        DESIRED VECTOR, THE ROUTINE MAY BE PERFORMED AGAIN STARTING AT

Page 486

021478,000076:                                                                                                  #        STEP 5C.
021479,000077: 
021480,000078:                                                                                                  #  CALLING SEQUENCE:     TC      BANKCALL
021481,000079:                                                                                                  #                        CADR    R60LEM
021482,000080: 
021483,000081:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:     SCAXIS, POINTVSM (FOR VECPOINT)
021484,000082:                                                                                                  #                                        3AXISFLG.
021485,000083: 
021486,000084:                                                                                                  #  SUBROUTINES CALLED:   VECPOINT, BALLANGS, GOPERF2R, LINUS, GODSPER,
021487,000085:                                                                                                  #                        GOMANUR, DOWNFLAG, PHASCHNG, UPFLAG
021488,000086: 
021489,000087:                                                                                                  #  NORMAL EXIT MODES:    CAE     TEMPR60         (CALLERS RETURN ADDRESS)
021490,000088:                                                                                                  #                        TC      BANKJUMP
021491,000089: 
021492,000090:                                                                                                  #  ALARMS: NONE
021493,000091: 
021494,000092:                                                                                                  #  OUTPUT: NONE
021495,000093: 
021496,000094:                                                                                                  #  DEBRIS: CPHI, CTHETA, CPSI, 3AXISFLG, TBASE2
021497,000095: 
021498,000096: 34,2000                                           BANK     34                                    
021499,000097: 26,2000                                           SETLOC   MANUVER                               
021500,000098: 26,2000                                           BANK                                           
021501,000099: 
021502,000100: 26,2101     1164                                  EBANK=   TEMPR60                               
021503,000101: 
021504,000102: 26,2101                                           COUNT*   $$/R06                                
021505,000103: 26,2101           04645        R60LEM             TC       MAKECADR                              
021506,000104: 26,2102           55164                           TS       TEMPR60                               
021507,000105: 
021508,000106: 26,2103           34746        REDOMANN           CAF      3AXISBIT                              
021509,000107: 26,2104           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
021510,000108: 26,2105           10000                           CCS      A                                     
021511,000109: 26,2106           12114                           TCF      TOBALL                                #  YES
021512,000110: 26,2107           06036                           TC       INTPRET                               
021513,000111: 26,2110           77624                           CALL                                           
021514,000112: 26,2111           56016                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
021515,000113: 26,2112           00322                           STORE    CPHI                                  #  STORE FINAL ANGLES - CPHI, CTHETA, CPSI
021516,000114: 26,2113           77776                           EXIT                                           
021517,000115: 
021518,000116: 26,2114           04616        TOBALL             TC       BANKCALL                              
021519,000117: 26,2115           54244                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021520,000118: 26,2116           32232        TOBALLA            CAF      V06N18                                
021521,000119: 26,2117           04616                           TC       BANKCALL                              
021522,000120: 26,2120           20563                           CADR     GOPERF2R                              #  DISPLAY PLEASE PERFORM AUTO MANEUVER
021523,000121: 26,2121           02220                           TC       R61TEST                               
021524,000122: 26,2122           02126                           TC       REDOMANC                              #  PROCEED
021525,000123: 26,2123           02153                           TC       ENDMANU1                              #  ENTER I.E. FINISHED WITH R60

Page 487

021527,000125: 26,2124           02157                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
021528,000126: 26,2125           05155                           TC       ENDOFJOB                              
021529,000127: 
021530,000128: 26,2126           34746        REDOMANC           CAF      3AXISBIT                              
021531,000129: 26,2127           70101                           MASK     FLAGWRD5                              #  IS 3-AXIS FLAG SET
021532,000130: 26,2130           10000                           CCS      A                                     
021533,000131: 26,2131           12137                           TCF      TOBALLC                               #  YES
021534,000132: 26,2132           06036                           TC       INTPRET                               
021535,000133: 26,2133           77624                           CALL                                           
021536,000134: 26,2134           56016                                    VECPOINT                              #  TO COMPUTE FINAL ANGLES
021537,000135: 26,2135           00322                           STORE    CPHI                                  #  STORE ANGLES
021538,000136: 26,2136           77776                           EXIT                                           
021539,000137: 
021540,000138: 26,2137           04616        TOBALLC            TC       BANKCALL                              
021541,000139: 26,2140           54244                           CADR     BALLANGS                              #  TO CONVERT ANGLES TO FDAI
021542,000140: 26,2141           02233                           TC       G+N,AUTO                              #  CHECK AUTO MODE
021543,000141: 26,2142           10000                           CCS      A                                     
021544,000142: 26,2143           12116                           TCF      TOBALLA                               #  NOT AUTO, GO REREQUEST AUTO MANEUVER.
021545,000143: 
021546,000144: 26,2144           32232        AUTOMANV           CAF      V06N18                                #  STATIC DISPLAY DURING AUTO MANEUVER
021547,000145: 26,2145           04616                           TC       BANKCALL                              #                                        -
021548,000146: 26,2146           20327                           CADR     GODSPR                                #                                        -
021549,000147: 26,2147           02157                           TC       CHKLINUS                              #  TO CHECK FOR PRIORITY DISPLAYS
021550,000148: 
021551,000149: 26,2150           04616        STARTMNV           TC       BANKCALL                              #  PERFORM MANEUVER VIA KALCMANU
021552,000150: 26,2151           17723                           CADR     GOMANUR                               
021553,000151: 
021554,000152: 26,2152           12116        ENDMANUV           TCF      TOBALLA                               #  FINISHED MANEUVER.
021555,000153: 26,2153           05516        ENDMANU1           TC       DOWNFLAG                              #  RESET 3-AXIS FLAG
021556,000154: 26,2154           00124                           ADRES    3AXISFLG                              
021557,000155: 26,2155           31164                           CAE      TEMPR60                               #                                        -
021558,000156: 26,2156           04640                           TC       BANKJUMP                              #                                        -
021559,000157: 
021560,000158: 26,2157           40100        CHKLINUS           CS       FLAGWRD4                              
021561,000159: 26,2160           74740                           MASK     PDSPFBIT                              #  IS PRIORITY DISPLAY FLAG SET?
021562,000160: 26,2161           10000                           CCS      A                                     #                                        -
021563,000161: 26,2162           00002                           TC       Q                                     #  NO - EXIT
021564,000162: 26,2163           30002                           CA       Q                                     
021565,000163: 26,2164           54156                           TS       MPAC       +2                         #  SAVE RETURN
021566,000164: 26,2165           46244                           CS       THREE                                 #  OBTAIN LOCATION FOR RESTART
021567,000165: 26,2166           60133                           AD       BUF2                                  #  HOLDS Q OF LAST DISPLAY
021568,000166: 26,2167           55055                           TS       TBASE2                                
021569,000167: 
021570,000168: 26,2170           05353                           TC       PHASCHNG                              
021571,000169: 26,2171           00132                           OCT      00132                                 
021572,000170: 
021573,000171: 26,2172           34745                           CAF      BIT7                                  
021574,000172: 26,2173           05464                           TC       LINUS                                 #  GO SET BITS FOR PRIORITY DISPLAY      -
021575,000173: 26,2174           00156                           TC       MPAC       +2                         
021576,000174: 

Page 488

021578,000176: 26,2175           37713        RELINUS            CAF      PRIO26                                #  RESTORE ORIGINAL PRIORITY
021579,000177: 26,2176           05146                           TC       PRIOCHNG                              
021580,000178: 
021581,000179: 26,2177           34747                           CAF      TRACKBIT                              #  DON'T CONTINUE R60 UNLESS TRACKFLAG ON.
021582,000180: 26,2200           70075                           MASK     FLAGWRD1                              
021583,000181: 26,2201           10000                           CCS      A                                     
021584,000182: 26,2202           12215                           TCF      RER60                                 
021585,000183: 
021586,000184: 26,2203           34745                           CAF      RNDVZBIT                              #  IS IT P20?
021587,000185: 26,2204           70074                           MASK     FLAGWRD0                              
021588,000186: 26,2205           10000                           CCS      A                                     
021589,000187: 26,2206           02212                           TC       +4                                    #  YES
021590,000188: 26,2207           05353                           TC       PHASCHNG                              #  NO, MUST BE P25, SET 2.11 SPOT
021591,000189: 26,2210           40112                           OCT      40112                                 
021592,000190: 
021593,000191: 26,2211           05155                           TC       ENDOFJOB                              
021594,000192: 
021595,000193: 26,2212           05353                           TC       PHASCHNG                              #  SET 2.7 SPOT FOR P20
021596,000194: 26,2213           40072                           OCT      40072                                 
021597,000195: 
021598,000196: 26,2214           05155                           TC       ENDOFJOB                              
021599,000197: 
021600,000198: 26,2215           05504        RER60              TC       UPFLAG                                #  SET PRIO DISPLAY FLAG AFTER RESTART
021601,000199: 26,2216           00077                           ADRES    PDSPFLAG                              
021602,000200: 
021603,000201: 26,2217           01055                           TC       TBASE2                                
021604,000202: 
021605,000203: 26,2220           31011        R61TEST            CA       MODREG                                #  IF WE ARE IN P00 IT MUST BE V49 OR V89
021606,000204: 26,2221           00006                           EXTEND                                         
021607,000205: 26,2222           12153                           BZF      ENDMANU1                              #  THUS WE GO TO ENDEXT VIA USER
021608,000206: 
021609,000207: 26,2223           30100                           CA       FLAGWRD4                              #  ARE WE IN R61 (P20 OR P25)
021610,000208: 26,2224           74740                           MASK     PDSPFBIT                              
021611,000209: 26,2225           00006                           EXTEND                                         
021612,000210: 26,2226           16001                           BZF      GOTOPOOH                              #  NO
021613,000211: 26,2227           06022                           TC       GOTOV56                               #  YES
021614,000212: 
021615,000213: 26,2230           20100        BIT14+7            OCT      20100                                 #                                        -
021616,000214: 26,2231           00203        OCT203             OCT      203                                   
021617,000215: 26,2232           01422        V06N18             VN       0618                                  
021618,000216: 
021619,000217:                                                                                                  #  SUBROUTINE TO CHECK FOR G+N CONTROL, AUTO STABILIZATION
021620,000218: 
021621,000219:                                                                                                  #  RETURNS WITH C(A) = +         IF NOT SET FOR G+N, AUTO
021622,000220:                                                                                                  #  RETURNS WITH C(A) = +0        IF SWITCHES ARE SET
021623,000221: 
021624,000222: 26,2233           00006        G+N,AUTO           EXTEND                                         
021625,000223: 26,2234           00030                           READ     CHAN30                                
021626,000224: 26,2235           74742                           MASK     BIT10                                 
021627,000225: 26,2236           10000                           CCS      A                                     
021628,000226: 26,2237           00002                           TC       Q                                     #  NOT IN G+N    C(A) = +

Page 489

021630,000228: 26,2240           00006        ISITAUTO           EXTEND                                         #  CHECK FOR AUTO MODE
021631,000229: 26,2241           00031                           READ     CHAN31                                
021632,000230: 26,2242           74736                           MASK     BIT14                                 
021633,000231: 26,2243           00002                           TC       Q                                     #  (+) = NOT IN AUTO, (+0) = AOK
021634,000232: 

Page 490

021636,000234:                                                                                                  #  PROGRAM DESCRIPTION BALLANGS
021637,000235:                                                                                                  #  MOD NO.         LOG SECTION R60,R62
021638,000236: 
021639,000237:                                                                                                  #  WRITTEN BY RAMA M. AIYAWAR
021640,000238:                                                                                                  #  FUNCTIONAL DESCRIPTION
021641,000239: 
021642,000240:                                                                                                  #  COMPUTES LM FDAI BALL DISPLAY ANGLES
021643,000241:                                                                                                  #  CALLING SEQUENCE
021644,000242: 
021645,000243:                                                                                                  #           TC     BALLANGS
021646,000244:                                                                                                  #  NORMAL EXIT MODE
021647,000245: 
021648,000246:                                                                                                  #           TC     BALLEXIT        (SAVED Q)
021649,000247: 
021650,000248:                                                                                                  #  ALARM OR EXIT MODE  NIL
021651,000249:                                                                                                  #  SUBROUTINES CALLED
021652,000250:                                                                                                  #           CD*TR*G
021653,000251:                                                                                                  #           ARCTAN
021654,000252: 
021655,000253:                                                                                                  #  INPUT
021656,000254: 
021657,000255:                                                                                                  #  CPHI,CTHETA,CPSI  ARE  THE ANGLES CORRESPONDING TO AOG,AIG,AMG. THEY ARE
021658,000256:                                                                                                  #  SP,2S COMPLIMENT SCALED TO HALF REVOLUTION.
021659,000257:                                                                                                  #  OUTPUT
021660,000258: 
021661,000259:                                                                                                  #  FDAIX, FDAIY, FDAIZ ARE THE REQUIRED BALL ANGLES SCALED TO HALF REVOLUTION
021662,000260:                                                                                                  #  SP,2S COMPLIMENT.
021663,000261:                                                                                                  #  THESE ANGLES WILL BE DISPLAYED AS DEGREES AND HUNDREDTHS, IN THE ORDER ROLL, PITCH, YAW, USING NOUNS 18 & 19.
021664,000262: 
021665,000263:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
021666,000264: 
021667,000265:                                                                                                  #  CPHI,CTHETA,CPSI EACH A SP REGISTER
021668,000266:                                                                                                  #  DEBRIS
021669,000267: 
021670,000268:                                                                                                  #  A,L,Q,MPAC,SINCDU,COSCDU,PUSHLIST,BALLEXIT
021671,000269: 
021672,000270:                                                                                                  #  NOMENCLATURE:  CPHI, CTHETA, & CPSI REPRESENT THE OUTER, INNER, & MIDDLE GIMBAL ANGLES, RESPECTIVELY; OR
021673,000271:                                                                                                  #  EQUIVALENTLY, CDUX, CDUY, & CDUZ.
021674,000272: 
021675,000273:                                                                                                  #  NOTE:  ARCTAN CHECKS FOR OVERFLOW AND SHOULD BE ABLE TO HANDLE ANY SINGULARITIES.
021676,000274: 
021677,000275: 26,2000                                           SETLOC   BAWLANGS                              
021678,000276: 26,2000                                           BANK                                           
021679,000277: 
021680,000278: 26,2244                                           COUNT*   $$/BALL                               
021681,000279: 26,2244           04645        BALLANGS           TC       MAKECADR                              
021682,000280: 26,2245           55342                           TS       BALLEXIT                              
021683,000281: 26,2246           30321                           CA       CPHI                                  

Page 491

021685,000283: 26,2247           54772                           TS       CDUSPOT    +4                         
021686,000284: 26,2250           30322                           CA       CTHETA                                
021687,000285: 26,2251           54766                           TS       CDUSPOT                               
021688,000286: 26,2252           30323                           CA       CPSI                                  
021689,000287: 26,2253           54770                           TS       CDUSPOT    +2                         
021690,000288: 
021691,000289: 26,2254           06036                           TC       INTPRET                               
021692,000290: 26,2255           45001                           SETPD    CALL                                  
021693,000291: 26,2256           00001                                    0D                                    
021694,000292: 26,2257           47447                                    CD*TR*G                               
021695,000293: 
021696,000294: 26,2260           41345                           DLOAD    DMP                                   
021697,000295: 26,2261           00743                                    SINCDUX                               #  SIN (OGA)
021698,000296: 26,2262           00747                                    COSCDUZ                               #  COS (MGA)
021699,000297: 
021700,000298: 26,2263           57552                           SL1      DCOMP                                 #  SCALE
021701,000299: 26,2264           65336                           ARCSIN   PDDL                                  #  YAW = ARCSIN(-SXCZ) INTO 0 PD
021702,000300: 26,2265           00741                                    SINCDUZ                               
021703,000301: 26,2266           14023                           STODL    SINTH                                 #  (SINTH = 18D IN PD)
021704,000302: 26,2267           00747                                    COSCDUZ                               
021705,000303: 26,2270           72405                           DMP      SL1                                   #  RESCALE
021706,000304: 26,2271           00751                                    COSCDUX                               
021707,000305: 26,2272           34021                           STCALL   COSTH                                 #  (COSTH= 16D IN PD)
021708,000306: 26,2273           26510                                    ARCTAN                                
021709,000307: 26,2274           41325                           PDDL     DMP                                   #  ROLL = ARCTAN(SZ/CZCX) INTO 2 PD
021710,000308: 26,2275           00741                                    SINCDUZ                               
021711,000309: 26,2276           00743                                    SINCDUX                               
021712,000310: 26,2277           41512                           SL2      PUSH                                  #  SXSZ INTO 4 PD
021713,000311: 26,2300           65205                           DMP      PDDL                                  #  SXSZCY INTO 4 PD
021714,000312: 26,2301           00745                                    COSCDUY                               
021715,000313: 26,2302           65205                           DMP      PDDL                                  #  SXSZSY INTO 6 PD
021716,000314: 26,2303           00737                                    SINCDUY                               
021717,000315: 26,2304           00751                                    COSCDUX                               
021718,000316: 26,2305           72405                           DMP      SL1                                   #  CXCY
021719,000317: 26,2306           00745                                    COSCDUY                               
021720,000318: 26,2307           45425                           DSU      STADR                                 #  PULL UP FROM 6 PD
021721,000319: 26,2310           63756                           STODL    COSTH                                 #  COSTH = CXCY - SXSZSY
021722,000320: 26,2311           00737                                    SINCDUY                               
021723,000321: 26,2312           72405                           DMP      SL1                                   
021724,000322: 26,2313           00751                                    COSCDUX                               #  CXSY
021725,000323: 26,2314           45415                           DAD      STADR                                 #  PULL UP FROM 4 PD
021726,000324: 26,2315           43754                           STCALL   SINTH                                 #  SINTH = CXSY + SXSZCY
021727,000325: 26,2316           26510                                    ARCTAN                                #  RETURNS WITH D(MPAC) = PITCH
021728,000326: 26,2317           55525                           PDDL     VDEF                                  #  PITCH INTO 2 PD, ROLL INTO MPAC FROM 2 PD
021729,000327: 26,2320           77634                           RTB                                            #  VDEF MAKES V(MPAC) = ROLL, PITCH, YAW
021730,000328: 26,2321           21524                                    V1STO2S                               
021731,000329: 26,2322           02351                           STORE    FDAIX                                 #  MODE IS TP
021732,000330: 26,2323           77776                           EXIT                                           
021733,000331: 
021734,000332: 26,2324           31342        ENDBALL            CA       BALLEXIT                              
021735,000333: 

Page 492

021737,000335: 26,2325           04640                           TC       BANKJUMP                              
021738,000336: 

Page 493

021740,000338:                                                                                                  #  PROGRAM DESCRIPTION - VECPOINT
021741,000339: 
021742,000340:                                                                                                  #           THIS INTERPRETIVE SUBROUTINE MAY BE USED TO POINT A SPACECRAFT AXIS IN A DESIRED DIRECTION.  THE AXIS
021743,000341:                                                                                                  #  TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN SUCCESSIVE LOCATIONS OF ERASABLE MEMORY
021744,000342:                                                                                                  #  BEGINNING WITH THE LOCATION CALLED SCAXIS.  THE COMPONENTS OF THIS VECTOR ARE GIVEN IN SPACECRAFT COORDINATES.
021745,000343:                                                                                                  #  THE DIRECTION IN WHICH THIS AXIS IS TO BE POINTED MUST APPEAR AS A HALF UNIT DOUBLE PRECISION VECTOR IN
021746,000344:                                                                                                  #  SUCCESSIVE LOCATIONS OF ERASABLE MEMORY BEGINNING WITH THE ADDRESS CALLED POINTVSM.  THE COMPONENTS OF THIS
021747,000345:                                                                                                  #  VECTOR ARE GIVEN IN STABLE MEMBER COORDINATES.  WITH THIS INFORMATION VECPOINT COMPUTES A SET OF THREE GIMBAL
021748,000346:                                                                                                  #  ANGLES (2S COMPLEMENT) CORESPONDING TO THE CROSS-PRODUCT ROTATION BETWEEN SCAXIS AND POINTVSM AND STORES THEM
021749,000347:                                                                                                  #  IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021750,000348:                                                                                                  #           THIS ROTATION, HOWEVER, MAY BRING THE S/C INTO GIMBAL LOCK.  WHEN POINTING A VECTOR IN THE Y-Z PLANE,
021751,000349:                                                                                                  #  THE TRANSPONDER AXIS, OR THE AOT FOR THE LEM, THE PROGRAM WILL CORRECT THIS PROBLEM BY ROTATING THE CROSS-
021752,000350:                                                                                                  #  PRODUCT ATTITUDE ABOUT POINTVSM BY A FIXED AMOUNT SUFFICIENT TO ROTATE THE DESIRED S/C ATTITUDE OUT OF GIMBAL
021753,000351:                                                                                                  #  LOCK.  IF THE AXIS TO BE POINTED IS MORE THAN 40.6 DEGREES BUT LESS THAN 60.5 DEG FROM THE +X (OR -X) AXIS,
021754,000352:                                                                                                  #  THE ADDITIONAL ROTATION TO AVOID GIMAL LOCK IS 35 DEGREES.  IF THE AXIS IS MORE THAN 60.5 DEGEES FROM +X (OR -X)
021755,000353:                                                                                                  #  THE ADDITIONAL ROTATION IS 35 DEGREES.  THE GIMBAL ANGLES CORRESPONDING TO THIS ATTITUDE ARE THEN COMPUTED AND
021756,000354:                                                                                                  #  STORED AS 2S COMPLIMENT ANGLES IN T(MPAC) BEFORE RETURNING TO THE CALLER.
021757,000355:                                                                                                  #           WHEN POINTING THE X-AXIS, OR THE THRUST VECTOR, OR ANY VECTOR WITHIN 40.6 DEG OF THE X-AXIS, VECPOINT
021758,000356:                                                                                                  #  CANNOT CORRECT FOR A CROSS-PRODUCT ROTATION INTO GIMBAL LOCK.  IN THIS CASE A PLATFORM REALIGNMENT WOULD BE
021759,000357:                                                                                                  #  REQUIRED TO POINT THE VECTOR IN THE DESIRED DIRECTION.  AT PRESENT NO INDICATION IS GIVEN FOR THIS SITUATION
021760,000358:                                                                                                  #  EXCEPT THAT THE FINAL MIDDLE GIMBAL ANGLE IN MPAC +2 IS GREATER THAN 59 DEGREES.
021761,000359: 
021762,000360:                                                                                                  #           CALLING SEQUENCE -
021763,000361:                                                                                                  #               1) LOAD SCAXIS, POINTVSM
021764,000362:                                                                                                  #               2) CALL
021765,000363:                                                                                                  #                       VECPOINT
021766,000364: 
021767,000365:                                                                                                  #           RETURNS WITH
021768,000366: 
021769,000367:                                                                                                  #               1) DESIRED OUTER GIMBAL ANGLE IN MPAC
021770,000368:                                                                                                  #               2) DESIRED INNER GIMBAL ANGLE IN MPAC +1
021771,000369:                                                                                                  #               3) DESIRED MIDDLE GIMBAL ANGLE IN MPAC +2
021772,000370: 
021773,000371:                                                                                                  #  ERASABLES USED -
021774,000372: 
021775,000373:                                                                                                  #      1) SCAXIS           6
021776,000374:                                                                                                  #      2) POINTVSM         6
021777,000375:                                                                                                  #      3) MIS             18
021778,000376:                                                                                                  #      4) DEL             18
021779,000377:                                                                                                  #      5) COF              6
021780,000378:                                                                                                  #      6) VECQTEMP         1
021781,000379:                                                                                                  #      7) ALL OF VAC AREA 43
021782,000380: 
021783,000381:                                                                                                  #               TOTAL     99
021784,000382: 
021785,000383: 27,2000                                           SETLOC   VECPT                                 
021786,000384: 27,2000                                           BANK                                           

Page 494

021788,000386: 27,2016                                           COUNT*   $$/VECPT                              
021789,000387: 
021790,000388: 27,2016  E6,1674                                  EBANK=   BCDU                                  
021791,000389: 
021792,000390: 27,2016           40020        VECPOINT           STQ      BOV                                   #  SAVE RETURN ADDRESS
021793,000391: 27,2017           03323                                    VECQTEMP                              
021794,000392: 27,2020           56021                                    VECLEAR                               #  AND CLEAR OVFIND
021795,000393: 27,2021           47164        VECLEAR            AXC,2    RTB                                   
021796,000394: 27,2022           03244                                    MIS                                   #  READ THE PRESENT CDU ANGLES AND
021797,000395: 27,2023           44403                                    READCDUK                              #  STORE THEM IN PD25, 26, 27
021798,000396: 27,2024           34032                           STCALL   25D                                   
021799,000397: 27,2025           44410                                    CDUTODCM                              #  S/C AXES TO STABLE MEMBER AXES (MIS)
021800,000398: 27,2026           61375                           VLOAD    VXM                                   
021801,000399: 27,2027           03767                                    POINTVSM                              #  RESOLVE THE POINTING DIRECTION VF INTO
021802,000400: 27,2030           03245                                    MIS                                   #  INITIAL S/C AXES (VF = POINTVSM)
021803,000401: 27,2031           77656                           UNIT                                           
021804,000402: 27,2032           00035                           STORE    28D                                   
021805,000403:                                                                                                  #  PD 28 29 30 31 32 33
021806,000404: 27,2033           53435                           VXV      UNIT                                  #  TAKE THE CROSS PRODUCT VF X VI
021807,000405: 27,2034           03761                                    SCAXIS                                #  WHERE VI = SCAXIS
021808,000406: 27,2035           57400                           BOV      VCOMP                                 
021809,000407: 27,2036           56146                                    PICKAXIS                              
021810,000408: 27,2037           17267                           STODL    COF                                   #  CHECK MAGNITUDE
021811,000409: 27,2040           00045                                    36D                                   #  OF CROSS PRODUCT
021812,000410: 27,2041           50025                           DSU      BMN                                   #  VECTOR, IF LESS
021813,000411: 27,2042           14367                                    DPB-14                                #  THAN B-14 ASSUME
021814,000412: 27,2043           56146                                    PICKAXIS                              #  UNIT OPERATION
021815,000413: 27,2044           50375                           VLOAD    DOT                                   #           INVALID.
021816,000414: 27,2045           03761                                    SCAXIS                                
021817,000415: 27,2046           00035                                    28D                                   
021818,000416: 27,2047           65552                           SL1      ARCCOS                                
021819,000417: 27,2050           77624        COMPMATX           CALL                                           #  NOW COMPUTE THE TRANSFORMATION FROM
021820,000418: 27,2051           44527                                    DELCOMP                               #  FINAL S/C AXES TO INITIAL S/C AXES  MFI
021821,000419: 27,2052           75160                           AXC,1    AXC,2                                 
021822,000420: 27,2053           03244                                    MIS                                   #  COMPUTE THE TRANSFORMATION FROM FINAL
021823,000421: 27,2054           02234                                    KEL                                   #  S/C AXES TO STABLE MEMBER AXES
021824,000422: 27,2055           77624                           CALL                                           #  MFS = MIS MFI
021825,000423: 27,2056           44312                                    MXM3                                  #  (IN PD LIST)
021826,000424: 
021827,000425: 27,2057           51545                           DLOAD    ABS                                   
021828,000426: 27,2060           00007                                    6                                     #  MFS6 = SIN(CPSI)                      $2
021829,000427: 27,2061           50025                           DSU      BMN                                   
021830,000428: 27,2062           14354                                    SINGIMLC                              #  = SIN(59 DEGS)                        $2
021831,000429: 27,2063           56136                                    FINDGIMB                              #  /CPSI/ LESS THAN 59 DEGS
021832,000430:                                                                                                  #  I.E. DESIRED ATTITUDE NOT IN GIMBAL LOCK
021833,000431: 
021834,000432: 27,2064           51545                           DLOAD    ABS                                   #  CHECK TO SEE IF WE ARE POINTING
021835,000433: 27,2065           03761                                    SCAXIS                                #  THE THRUST AXIS
021836,000434: 27,2066           51025                           DSU      BPL                                   
021837,000435: 27,2067           14356                                    SINVEC1                               #  SIN 49.4 DEGS                         $2

Page 495

021839,000437: 27,2070           56136                                    FINDGIMB                              #  IF SO, WE ARE TRYING TO POINT IT INTO
021840,000438: 27,2071           77775                           VLOAD                                          #  GIMBAL LOCK, ABORT COULD GO HERE
021841,000439: 27,2072           77626                           STADR                                          
021842,000440: 27,2073           50516                           STOVL    MIS        +12D                       
021843,000441: 27,2074           77626                           STADR                                          #  STORE MFS (IN PD LIST) IN MIS
021844,000442: 27,2075           50524                           STOVL    MIS        +6                         
021845,000443: 27,2076           77626                           STADR                                          
021846,000444: 27,2077           50532                           STOVL    MIS                                   
021847,000445: 27,2100           03253                                    MIS        +6                         #  INNER GIMBAL AXIS IN FINAL S/C AXES
021848,000446: 27,2101           57444                           BPL      VCOMP                                 #  LOCATE THE IG AXIS DIRECTION CLOSEST TO
021849,000447: 27,2102           56103                                    IGSAMEX                               #  FINAL X S/C AXIS
021850,000448: 
021851,000449: 27,2103           50035        IGSAMEX            VXV      BMN                                   #  FIND THE SHORTEST WAY OF ROTATING THE 
021852,000450: 27,2104           03761                                    SCAXIS                                #  S/C OUT OF GIMBAL LOCK BY A ROTATION 
021853,000451: 27,2105           56112                                    U=SCAXIS                              #  ABOUT +- SCAXIS, I.E. IF  (IG (SGN MFS3)
021854,000452:                                                                                                  #  X SCAXIS . XF) LESS THAN 0, U = SCAXIS
021855,000453:                                                                                                  #  OTHERWISE U = -SCAXIS
021856,000454: 
021857,000455: 27,2106           57575                           VLOAD    VCOMP                                 
021858,000456: 27,2107           03761                                    SCAXIS                                
021859,000457: 27,2110           37267                           STCALL   COF                                   #  ROTATE ABOUT -SCAXIS
021860,000458: 27,2111           56115                                    CHEKAXIS                              
021861,000459: 27,2112           77775        U=SCAXIS           VLOAD                                          
021862,000460: 27,2113           03761                                    SCAXIS                                
021863,000461: 27,2114           03267                           STORE    COF                                   #  ROTATE ABOUT + SCAXIS
021864,000462: 27,2115           51545        CHEKAXIS           DLOAD    ABS                                   
021865,000463: 27,2116           03761                                    SCAXIS                                #  SEE IF WE ARE POINTING THE AOT
021866,000464: 27,2117           51025                           DSU      BPL                                   
021867,000465: 27,2120           14360                                    SINVEC2                               #  SIN 29.5 DEGS                         $2
021868,000466: 27,2121           56125                                    PICKANG1                              #  IF SO, ROTATE 50 DEGS ABOUT +- SCAXIS
021869,000467: 27,2122           52145                           DLOAD    GOTO                                  #  IF NOT, MUST BE POINTING THE TRANSPONDER
021870,000468: 27,2123           14364                                    VECANG2                               #  OR SOME VECTOR IN THE Y, OR Z PLANE
021871,000469: 27,2124           56127                                    COMPMFSN                              #  IN THIS CASE ROTATE 35 DEGS TO GET OUT
021872,000470:                                                                                                  #  OF GIMBAL LOCK (VECANG2  $360)
021873,000471: 27,2125           77745        PICKANG1           DLOAD                                          
021874,000472: 27,2126           14362                                    VECANG1                               #  = 50 DEGS                             $360
021875,000473: 27,2127           77624        COMPMFSN           CALL                                           
021876,000474: 27,2130           44527                                    DELCOMP                               #  COMPUTE THE ROTATION ABOUT SCAXIS TO
021877,000475: 27,2131           75160                           AXC,1    AXC,2                                 #  BRING MFS OUT OF GIMBAL LOCK
021878,000476: 27,2132           03244                                    MIS                                   
021879,000477: 27,2133           02234                                    KEL                                   
021880,000478: 27,2134           77624                           CALL                                           #  COMPUTE THE NEW TRANSFORMATION FROM
021881,000479: 27,2135           44312                                    MXM3                                  #  DESIRED S/C AXES TO STABLE MEMBER AXES
021882,000480:                                                                                                  #  WHICH WILL ALIGN VI WITH VF AND AVOID
021883,000481:                                                                                                  #  GIMBAL LOCK
021884,000482: 27,2136           45160        FINDGIMB           AXC,1    CALL                                  
021885,000483: 27,2137           00000                                    0                                     #  EXTRACT THE COMMANDED CDU ANGLES FROM
021886,000484: 27,2140           44654                                    DCMTOCDU                              #  THIS MATRIX
021887,000485: 27,2141           40234                           RTB      SETPD                                 
021888,000486: 27,2142           21524                                    V1STO2S                               #  CONVERT TO 2:S COMPLEMENT

Page 496

021890,000488: 27,2143           00001                                    0                                     
021891,000489: 27,2144           77650                           GOTO                                           
021892,000490: 27,2145           03323                                    VECQTEMP                              #  RETURN TO CALLER
021893,000491: 
021894,000492: 27,2146           50375        PICKAXIS           VLOAD    DOT                                   #  IF VF X VI = 0, FIND VF . VI
021895,000493: 27,2147           00035                                    28D                                   
021896,000494: 27,2150           03761                                    SCAXIS                                
021897,000495: 27,2151           72240                           BMN      TLOAD                                 
021898,000496: 27,2152           54326                                    ROT180                                
021899,000497: 27,2153           00032                                    25D                                   
021900,000498: 27,2154           77650                           GOTO                                           #  IF VF = VI, CDU DESIRED = PRESENT CDU
021901,000499: 27,2155           03323                                    VECQTEMP                              #  PRESENT CDU ANGLES
021902,000500: 
021903,000501: 35,2000                                           BANK     35                                    
021904,000502: 26,2000                                           SETLOC   MANUVER1                              
021905,000503: 26,2000                                           BANK                                           
021906,000504: 26,2326           47375        ROT180             VLOAD    VXV                                   #  IF VF, VI ANTIPARALLEL, 108 DEG ROTATION
021907,000505: 26,2327           03253                                    MIS        +6                         #  IS REQUIRED. Y STABLE MEMBER AXIS IN
021908,000506: 26,2330           06422                                    HIDPHALF                              #  INITIAL S/C AXES.
021909,000507: 26,2331           47256                           UNIT     VXV                                   #  FIND Y(SM) X X(I)
021910,000508: 26,2332           03761                                    SCAXIS                                #  FIND UNIT(VI X UNIT(Y(SM) X X(I)))
021911,000509: 26,2333           40056                           UNIT     BOV                                   #  I.E. PICK A VECTOR IN THE PLANE OF X(I),
021912,000510: 26,2334           54350                                    PICKX                                 #  Y(SM) PERPENDICULAR TO VI
021913,000511: 26,2335           17267                           STODL    COF                                   
021914,000512: 26,2336           00045                                    36D                                   #  CHECK MAGNITUDE
021915,000513: 26,2337           50025                           DSU      BMN                                   #  OF THIS VECTOR.
021916,000514: 26,2340           14367                                    DPB-14                                #  IF LESS THAN B-14,
021917,000515: 26,2341           54350                                    PICKX                                 #  PICK X-AXIS.
021918,000516: 26,2342           77775                           VLOAD                                          
021919,000517: 26,2343           03267                                    COF                                   
021920,000518: 26,2344           17267        XROT               STODL    COF                                   
021921,000519: 26,2345           06422                                    HIDPHALF                              
021922,000520: 26,2346           77650                           GOTO                                           
021923,000521: 26,2347           56050                                    COMPMATX                              
021924,000522: 26,2350           52175        PICKX              VLOAD    GOTO                                  #  PICK THE XAXIS IN THIS CASE
021925,000523: 26,2351           06422                                    HIDPHALF                              
021926,000524: 26,2352           54344                                    XROT                                  
021927,000525: 26,2353           15555 35172  SINGIMLC           2DEC     .4285836003                            #  = SIN(59)                             $2
021928,000526: 
021929,000527: 26,2355           14113 36326  SINVEC1            2DEC     .3796356537                            #  = SIN(49.4)                           $2
021930,000528: 
021931,000529: 26,2357           07701 35703  SINVEC2            2DEC     .2462117800                            #  = SIN(29.5)                           $2
021932,000530: 
021933,000531: 26,2361           04343 21616  VECANG1            2DEC     .1388888889                            #  = 50 DEGREES                          $360
021934,000532: 
021935,000533: 26,2363           03070 34344  VECANG2            2DEC     .09722222222                            #  = 35 DEGREES                          $360
021936,000534: 
021937,000535: 26,2365           00000        1BITDP             OCT      0                                     #  KEEP THIS BEFORE DPB(-14)        *********
021938,000536: 26,2366           00001        DPB-14             OCT      00001                                 
021939,000537: 26,2367           00000                           OCT      00000                                 
021940,000538: 

Page 497

021942,000540:                                                                                                  #  ROUTINE FOR INITIATING AUTOMATIC MANEUVER VIA KEYBOARD (V49)
021943,000541: 
021944,000542: 34,2000                                           BANK     34                                    
021945,000543: 23,2000                                           SETLOC   R62                                   
021946,000544: 23,2000                                           BANK                                           
021947,000545: 23,2065  E6,1674                                  EBANK=   BCDU                                  
021948,000546: 
021949,000547: 23,2065                                           COUNT*   $$/R62                                
021950,000548: 
021951,000549: 23,2065  23,2065               R62DISP            EQUALS   R62FLASH                              
021952,000550: 
021953,000551: 23,2065           35010        R62FLASH           CAF      V06N22                                #  FLASH V06N22 AND
021954,000552: 23,2066           04616                           TC       BANKCALL                              #  ICDU ANGLES
021955,000553: 23,2067           20351                           CADR     GOFLASH                               
021956,000554: 23,2070           15472                           TCF      ENDEXT                                #  TERMINATE
021957,000555: 23,2071           12073                           TCF      GOMOVE                                #  PROCEED
021958,000556: 23,2072           12065                           TCF      R62FLASH                              #  ENTER
021959,000557: 
021960,000558:                                                                                                  #  ASTRONAUT MAY LOAD NEW ICDUS AT THIS
021961,000559:                                                                                                  #  POINT
021962,000560: 23,2073           05504        GOMOVE             TC       UPFLAG                                #  SET FOR 3-AXIS MANEUVER
021963,000561: 23,2074           00124                           ADRES    3AXISFLG                              
021964,000562: 
021965,000563: 23,2075           04616                           TC       BANKCALL                              
021966,000564: 23,2076           54101                           CADR     R60LEM                                
021967,000565: 23,2077           15472                           TCF      ENDEXT                                #  END R62
021968,000566: 

End of include-file R60,R62.agc.  Parent file is MAIN.agc