Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

033725,000002:                                                                                                  ## Copyright:   Public domain.
033726,000003:                                                                                                  ## Filename:    THROTTLE_CONTROL_ROUTINES.agc
033727,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
033728,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
033729,000006:                                                                                                  ##              although several more revisions would follow. It has been
033730,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
033731,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
033732,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
033733,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
033734,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
033735,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
033736,000013:                                                                                                  ##              rather than the original YUL assembler.
033737,000014:                                                                                                  ## Reference:   pp. 788-792
033738,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
033739,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
033740,000017:                                                                                                  ## Mod history: 05/24/03 RSB.   Began transcribing.
033741,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
033742,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
033743,000020:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
033744,000021:                                                                                                  ##                              numbers in 1701.pdf.
033745,000022:                                                                                                  ##              2017-02-25 RSB  Proofed comment text using octopus/ProoferComments.
033746,000023:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
033747,000024:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
033748,000025:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
033749,000026: 

Page 788

033751,000028: 31,2144                                           BANK     31                                    
033752,000029: 31,2000                                           SETLOC   FTHROT                                
033753,000030: 31,2000                                           BANK                                           
033754,000031: 31,2144  E7,1612                                  EBANK=   PIF                                   
033755,000032: 31,2144                                           COUNT*   $$/THROT                              
033756,000033: 
033757,000034:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
033758,000035:                                                                                                  #  HERE FC, DESIRED THRUST, AND FP, PRESENT THRUST, UNWEIGHTED, ARE COMPUTED.
033759,000036: 
033760,000037: 31,2144           31245        THROTTLE           CA       ABDELV                                #  COMPUTE PRESENT ACCELERATION IN UNITS OF
033761,000038: 31,2145           00006                           EXTEND                                         #  2(-4) M/CS/CS, SAVING SERVICER TROUBLE
033762,000039: 31,2146           72356                           MP       /AF/CNST                              
033763,000040: 31,2147           00006                 +3        EXTEND                                         
033764,000041: 31,2150           23607                           QXCH     RTNHOLD                               
033765,000042: 31,2151           02337        AFDUMP             TC       MASSMULT                              
033766,000043: 31,2152           53470                           DXCH     FP                                    #  FP = PRESENT THRUST
033767,000044: 31,2153           00006                           EXTEND                                         
033768,000045: 31,2154           31464                           DCA      /AFC/                                 
033769,000046: 31,2155           02337                           TC       MASSMULT                              
033770,000047: 31,2156           55615                           TS       FC                                    #  FC = THRUST DESIRED BY GUIDANCE
033771,000048: 31,2157           53466                           DXCH     FCODD                                 #  FCODD = WHAT IT IS GOING TO GET
033772,000049: 
033773,000050:                                                                                                  #  COMPUTE DESIRED THRUST FOR DISPLAY AS A PERCENTAGE OF 10,500 POUNDS
033774,000051: 
033775,000052: 31,2160           32360                           CAF      4FMAXNOM                              #  MOVE 4FMAXNOM TO ERASABLE FOR DV BELOW
033776,000053: 31,2161           54002                           TS       Q                                     
033777,000054: 31,2162           31615                           CA       FC                                    
033778,000055: 31,2163           72357                           MASK     OCT17777                              #  FOR SAFETY
033779,000056: 31,2164           00006                           EXTEND                                         
033780,000057: 31,2165           10002                           DV       Q                                     
033781,000058: 31,2166           00006                           EXTEND                                         
033782,000059: 31,2167           75003                           MP       4SECS                                 
033783,000060: 31,2170           55750                           TS       THRDISP                               #  FOR DISPLAY IN N92
033784,000061: 
033785,000062:                                                                                                  #  IF IT HAS BEEN LESS THAN 3 SECONDS SINCE THE LAST THROTTLING, AUGMENT FP USING THE FWEIGHT CALCULATED THEN.
033786,000063: 
033787,000064: 31,2171           41617                           CS       TTHROT                                #  THIS CODING ASSUMES A FLATOUT WITHIN
033788,000065: 31,2172           60025                           AD       TIME1                                 #        80 SECONDS BEFORE FIRST THROTTLE CALL
033789,000066: 31,2173           74733                           MASK     POSMAX                                
033790,000067: 31,2174           40000                           COM                                            
033791,000068: 31,2175           65002                           AD       3SECS                                 
033792,000069: 31,2176           00006                           EXTEND                                         
033793,000070: 31,2177           62203                           BZMF     WHERETO                               #  BRANCH IF (TIME1-TTHROT +1) > 3 SECONDS

Page 789

033795,000072: 31,2200           00006                           EXTEND                                         
033796,000073: 31,2201           31611                           DCA      FWEIGHT                               
033797,000074: 31,2202           21470                           DAS      FP                                    
033798,000075: 
033799,000076:                                                                                                  #  THIS LOGIC DETERMINES THE THROTTLING IN THE REGION 10% - 94%.  THE MANUAL THROTTLE, NOMINALLY SET AT
033800,000077:                                                                                                  #  MINIMUM BY ASTRONAUT OR MISSION CONTROL PROGRAMS, PROVIDES THE LOWER BOUND.  A STOP IN THE THROTTLE HARDWARE
033801,000078:                                                                                                  #  PROVIDES THE UPPER.
033802,000079: 
033803,000080: 31,2203           35014        WHERETO            CA       EBANK5                                #  INITIALIZE L*WCR*T AND H*GHCR*T FROM
033804,000081: 31,2204           54003                           TS       EBANK                                 #        PAD LOADED ERASABLES IN W-MATRIX
033805,000082: 31,2205  E5,1506                                  EBANK=   LOWCRIT                               
033806,000083: 31,2205           00006                           EXTEND                                         
033807,000084: 31,2206           31507                           DCA      LOWCRIT                               
033808,000085: 31,2207           52131                           DXCH     L*WCR*T                               
033809,000086: 31,2210           35016                           CA       EBANK7                                
033810,000087: 31,2211           54003                           TS       EBANK                                 
033811,000088: 31,2212  E7,1612                                  EBANK=   PIF                                   
033812,000089: 31,2212           44755                           CS       ZERO                                  #  INITIALIZE PIFPSET
033813,000090: 31,2213           55606                           TS       PIFPSET                               
033814,000091: 31,2214           40131                           CS       H*GHCR*T                              
033815,000092: 31,2215           61620                           AD       FCOLD                                 
033816,000093: 31,2216           00006                           EXTEND                                         
033817,000094: 31,2217           62231                           BZMF     LOWFCOLD                              #  BRANCH IF FCOLD < OR = HIGHCRIT
033818,000095: 31,2220           40130                           CS       L*WCR*T                               
033819,000096: 31,2221           61465                           AD       FCODD                                 
033820,000097: 31,2222           00006                           EXTEND                                         
033821,000098: 31,2223           62226                           BZMF     FCOMPSET                              #  BRANCH IF FC < OR = LOWCRIT
033822,000099: 31,2224           31467                           CA       FP                                    #  SEE NOTE 1
033823,000100: 31,2225           12236                           TCF      FLATOUT1                              
033824,000101: 
033825,000102: 31,2226           42002        FCOMPSET           CS       FMAXODD                               #  SEE NOTE 2
033826,000103: 31,2227           61467                           AD       FP                                    
033827,000104: 31,2230           12240                           TCF      FLATOUT2                              
033828,000105: 
033829,000106: 31,2231           40131        LOWFCOLD           CS       H*GHCR*T                              
033830,000107: 31,2232           61465                           AD       FCODD                                 
033831,000108: 31,2233           00006                           EXTEND                                         
033832,000109: 31,2234           62241                           BZMF     DOPIF                                 #  BRANCH IF FC < OR = HIGHCRIT
033833,000110: 
033834,000111: 31,2235           32003                           CA       FMAXPOS                               #  NO:  THROTTLE-UP
033835,000112: 31,2236           53466        FLATOUT1           DXCH     FCODD                                 
033836,000113: 31,2237           34737                           CA       FEXTRA                                
033837,000114: 31,2240           55606        FLATOUT2           TS       PIFPSET                               
033838,000115: 
033839,000116:                                                                                                  #  NOTE 1        FC IS SET EQUAL TO FP SO PIF WILL BE ZERO.  THIS IS DESIRABLE
033840,000117:                                                                                                  #                AS THERE IS ACTUALLY NO THROTTLE CHANGE.
033841,000118: 
033842,000119:                                                                                                  #  NOTE2         HERE, SINCE WE ARE ABOUT TO RETURN TO THE THROTTLEABLE REGION

Page 790

033844,000121:                                                                                                  #                (BELOW 55%) THE QUANTITY -(FMAXODD-FP) IS COMPUTED AND PUT
033845,000122:                                                                                                  #                INTO PIFPSET TO COMPENSATE FOR THE DIFFERENCE BETWEEN THE
033846,000123:                                                                                                  #                NUMBER OF BITS CORRESPONDING TO FULL THROTTLE (FMAXODD) AND THE
033847,000124:                                                                                                  #                NUMBER CORRESPONDING TO ACTUAL THRUST (FP).  THUS THE TOTAL
033848,000125:                                                                                                  #                THROTTLE COMMAND PIF = FC - FP - (FMAXODD - FP) = FC - FMAXODD.
033849,000126: 
033850,000127: 31,2241           03677        DOPIF              TC       FASTCHNG                              
033851,000128: 31,2242           00006                           EXTEND                                         
033852,000129: 31,2243           31466                           DCA      FCODD                                 
033853,000130: 31,2244           55620                           TS       FCOLD                                 
033854,000131: 31,2245           53613                           DXCH     PIF                                   
033855,000132: 31,2246           00006                           EXTEND                                         
033856,000133: 31,2247           41470                           DCS      FP                                    
033857,000134: 31,2250           21613                           DAS      PIF                                   #  PIF = FC - FP, NEVER EQUALS +0
033858,000135: 
033859,000136: 31,2251           31612        DOIT               CA       PIF                                   
033860,000137: 31,2252           61606                           AD       PIFPSET                               #  ADD IN PIFPSET, WITHOUT CHANGING PIF
033861,000138: 31,2253           55614                           TS       PSEUDO55                              
033862,000139: 31,2254           54055                           TS       THRUST                                
033863,000140: 31,2255           34750                           CAF      BIT4                                  
033864,000141: 31,2256           00006                           EXTEND                                         
033865,000142: 31,2257           05014                           WOR      CHAN14                                
033866,000143: 31,2260           30025                           CA       TIME1                                 
033867,000144: 31,2261           55617                           TS       TTHROT                                
033868,000145: 
033869,000146:                                                                                                  #  SINCE /AF/ IS NOT AN INSTANTANEOUS ACCELERATION, BUT RATHER AN "AVERAGE" OF THE ACCELERATION LEVELS DURING
033870,000147:                                                                                                  #  THE PRECEEDING PIPA INTERVAL, AND SINCE FP IS COMPUTED DIRECTLY FROM /AF/, FP IN ORDER TO CORRESPOND TO THE
033871,000148:                                                                                                  #  ACTUAL THRUST LEVEL AT THE END OF THE INTERVAL MUST BE WEIGHTED BY
033872,000149:                                                                                                  #                  PIF(PPROCESS + TL)     PIF /PIF/
033873,000150:                                                                                                  #        FWEIGHT = ------------------ + -------------
033874,000151:                                                                                                  #                       PGUID           2 PGUID FRATE
033875,000152:                                                                                                  #  WHERE PPROCESS IS THE TIME BETWEEN PIPA READING AND THE START OF THROTTLING, PGUID IS THE GUIDANCE PERIOD, AND
033876,000153:                                                                                                  #  FRATE IS THE THROTTLING RATE (32 UNITS PER CENTISECOND).  PGUID IS EITHER 1 OR 2 SECONDS.  THE "TL" IN THE
033877,000154:                                                                                                  #  FIRST TERM REPRESENTS THE ENGINE'S RESPONSE LAG.  HERE FWEIGHT IS COMPUTED FOR USE NEXT PASS.
033878,000155: 
033879,000156: 31,2262           31762                           CA       THISTPIP   +1                         #  INITIALIZE FWEIGHT COMP AS IF FOR P66
033880,000157: 31,2263           54130                           TS       BUF                                   
033881,000158: 
033882,000159: 31,2264           41010                           CS       MODREG                                #  ARE WE IN FACT IN P66?
033883,000160: 31,2265           62452                           AD       DEC66                                 
033884,000161: 31,2266           00006                           EXTEND                                         
033885,000162: 31,2267           12274                           BZF      FWCOMP                                #  YES
033886,000163: 
033887,000164: 31,2270           31234                           CA       PIPTIME    +1                         #  NO:  INITIALIZE FOR TWO SECOND PERIOD
033888,000165: 31,2271           54130                           TS       BUF                                   
033889,000166: 31,2272           35003                           CAF      4SECS                                 
033890,000167: 31,2273           12275                           TCF      FWCOMP     +1                         

Page 791

033892,000169: 
033893,000170: 31,2274           35000        FWCOMP             CAF      2SECS                                 
033894,000171: 31,2275           54002                 +1        TS       Q                                     
033895,000172: 31,2276           00006                           EXTEND                                         
033896,000173: 31,2277           74746                           MP       BIT6                                  
033897,000174: 31,2300           22131                           LXCH     BUF        +1                         
033898,000175: 31,2301           40130                           CS       BUF                                   #  TIME OF LAST PIPA READING.
033899,000176: 31,2302           60025                           AD       TIME1                                 
033900,000177: 31,2303           62004                           AD       THROTLAG                              #  COMPENSATE FOR ENGINE RESPONSE LAG
033901,000178: 31,2304           74357                           MASK     LOW8                                  #  MAKE SURE SMALL AND POSITIVE
033902,000179: 31,2305           22007                           ZL                                             
033903,000180: 31,2306           00006                           EXTEND                                         
033904,000181: 31,2307           10002                           DV       Q                                     
033905,000182: 31,2310           00006                           EXTEND                                         
033906,000183: 31,2311           71612                           MP       PIF                                   
033907,000184: 31,2312           60000                           DOUBLE                                         
033908,000185: 31,2313           53611                           DXCH     FWEIGHT                               
033909,000186: 31,2314           11612                           CCS      PIF                                   
033910,000187: 31,2315           64753                           AD       ONE                                   
033911,000188: 31,2316           12320                           TCF      +2                                    
033912,000189: 31,2317           64753                           AD       ONE                                   
033913,000190: 31,2320           00006                           EXTEND                                         
033914,000191: 31,2321           71612                           MP       PIF                                   
033915,000192: 31,2322           00006                           EXTEND                                         
033916,000193: 31,2323           10131                           DV       BUF        +1                         
033917,000194: 31,2324           22007                           ZL                                             
033918,000195: 31,2325           21611                           DAS      FWEIGHT                               
033919,000196: 
033920,000197: 31,2326           01607        THDUMP             TC       RTNHOLD                               
033921,000198: 
033922,000199:                                                                                                  #  FLATOUT THROTTLES UP THE DESCENT ENGINE, AND IS CALLED AS A BASIC SUBROUTINE.
033923,000200: 
033924,000201: 31,2327           34737        FLATOUT            CAF      BIT13                                 #  4096 PULSES
033925,000202: 31,2330           55606        WHATOUT            TS       PIFPSET                               #  USE PIFPSET SO FWEIGHT WILL BE ZERO
033926,000203: 31,2331           44755                           CS       ZERO                                  
033927,000204: 31,2332           55620                           TS       FCOLD                                 
033928,000205: 31,2333           55612                           TS       PIF                                   
033929,000206: 31,2334           00006                           EXTEND                                         
033930,000207: 31,2335           23607                           QXCH     RTNHOLD                               
033931,000208: 31,2336           12251                           TCF      DOIT                                  
033932,000209: 
033933,000210:                                                                                                  #  MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
033934,000211: 
033935,000212: 31,2337           00006        MASSMULT           EXTEND                                         
033936,000213: 31,2340           22130                           QXCH     BUF                                   
033937,000214: 31,2341           52155                           DXCH     MPAC                                  
033938,000215: 31,2342           07106                           TC       DMP                                   
033939,000216: 31,2343           01243                           ADRES    MASS                                  

Page 792

033941,000218: 31,2344           07106                           TC       DMP                                   #  LEAVES PROPERLY SCALED FORCE IM MPAC
033942,000219: 31,2345           02005                           ADRES    SCALEFAC                              
033943,000220: 31,2346           07262                           TC       TPAGREE                               
033944,000221: 31,2347           30154                           CA       MPAC                                  
033945,000222: 31,2350           00006                           EXTEND                                         
033946,000223: 31,2351           12354                           BZF      +3                                    
033947,000224: 31,2352           34733                           CAF      POSMAX                                
033948,000225: 31,2353           00130                           TC       BUF                                   
033949,000226: 31,2354           52156                           DXCH     MPAC       +1                         
033950,000227: 31,2355           00130                           TC       BUF                                   
033951,000228: 
033952,000229:                                                                                                  #  CONSTANTS:-
033953,000230: 
033954,000231: 31,2356     4737               FEXTRA             =        BIT13                                 #  FEXT +5.13309020 E+4
033955,000232: 
033956,000233: 31,2356           04143        /AF/CNST           DEC      .13107                                
033957,000234: 
033958,000235: 31,2357           17777        OCT17777           OCT      17777                                 
033959,000236: 31,2360           35074        4FMAXNOM           DEC      14908      B-14                       #  EQUIVALENT TO 10,500 LBS.
033960,000237: 
033961,000238:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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