Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

034428,000002:                                                                                                  ## Copyright:   Public domain.
034429,000003:                                                                                                  ## Filename:    THROTTLE_CONTROL_ROUTINES.agc
034430,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
034431,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
034432,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
034433,000007:                                                                                                  ## Assembler:   yaYUL
034434,000008:                                                                                                  ## Contact:     HARTMUTH GUTSCHE <hgutsche@xplornet.com>.
034435,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
034436,000010:                                                                                                  ## Pages:       793-797
034437,000011:                                                                                                  ## Mod history: 2009-05-20 HG   Transcribed from page images.
034438,000012:                                                                                                  ##              2010-12-31 JL   Fixed page number comments.
034439,000013:                                                                                                  ##              2016-12-16 RSB  Proofed text comments with octopus/ProoferComments
034440,000014:                                                                                                  ##                              and corrected the errors found.
034441,000015:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
034442,000016:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
034443,000017: 
034444,000018:                                                                                                  ## This source code has been transcribed or otherwise adapted from
034445,000019:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
034446,000020:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
034447,000021:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
034448,000022:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
034449,000023:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
034450,000024:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
034451,000025:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
034452,000026:                                                                                                  ## actually created.
034453,000027:                                                                                                  ##
034454,000028:                                                                                                  ## Notations on the hardcopy document read, in part:
034455,000029:                                                                                                  ##
034456,000030:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
034457,000031:                                                                                                  ##      16:27 JULY 14, 1969 
034458,000032: 

Page 793

034460,000034: 31,2216                                           BANK     31                                    
034461,000035: 31,2000                                           SETLOC   FTHROT                                
034462,000036: 31,2000                                           BANK                                           
034463,000037: 31,2216  E7,1612                                  EBANK=   PIF                                   
034464,000038: 31,2216                                           COUNT*   $$/THROT                              
034465,000039: 
034466,000040:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
034467,000041:                                                                                                  #  HERE FC, DESIRED THRUST, AND FP, PRESENT THRUST, UNWEIGHTED, ARE COMPUTED.
034468,000042: 
034469,000043: 31,2216           31246        THROTTLE           CA       ABDELV                                #  COMPUTE PRESENT ACCELERATION IN UNITS OF
034470,000044: 31,2217           00006                           EXTEND                                         #  2(-4) M/CS/CS, SAVING SERVICER TROUBLE
034471,000045: 31,2220           72417                           MP       /AF/CNST                              
034472,000046: 31,2221           00006                 +3        EXTEND                                         
034473,000047: 31,2222           23607                           QXCH     RTNHOLD                               
034474,000048: 31,2223           02400        AFDUMP             TC       MASSMULT                              
034475,000049: 31,2224           53470                           DXCH     FP                                    #  FP = PRESENT THRUST
034476,000050: 31,2225           00006                           EXTEND                                         
034477,000051: 31,2226           31464                           DCA      /AFC/                                 
034478,000052: 31,2227           02400                           TC       MASSMULT                              
034479,000053: 31,2230           55615                           TS       FC                                    #  FC = THRUST DESIRED BY GUIDANCE
034480,000054: 31,2231           53466                           DXCH     FCODD                                 #  FCODD = WHAT IT IS GOING TO GET
034481,000055: 
034482,000056:                                                                                                  #  IF IT HAS BEEN LESS THAN 3 SECONDS SINCE THE LAST THROTTLING, AUGMENT FP USING THE FWEIGHT CALCULATED THEN.
034483,000057: 
034484,000058: 31,2232           41617                           CS       TTHROT                                #  THIS CODING ASSUMES A FLATOUT WITHIN
034485,000059: 31,2233           60025                           AD       TIME1                                 #        80 SECONDS BEFORE FIRST THROTTLE CALL
034486,000060: 31,2234           74733                           MASK     POSMAX                                
034487,000061: 31,2235           40000                           COM                                            
034488,000062: 31,2236           65002                           AD       3SECS                                 
034489,000063: 31,2237           00006                           EXTEND                                         
034490,000064: 31,2240           62244                           BZMF     WHERETO                               #  BRANCH IF (TIME1-TTHROT +1) > 3 SECONDS
034491,000065: 31,2241           00006                           EXTEND                                         
034492,000066: 31,2242           31611                           DCA      FWEIGHT                               
034493,000067: 31,2243           21470                           DAS      FP                                    
034494,000068: 
034495,000069:                                                                                                  #      THIS LOGIC DETERMINES THE THROTTLING IN THE REGION 10% - 94%.  THE MANUAL THROTTLE, NOMINALLY SET AT
034496,000070:                                                                                                  #  MINIMUM BY ASTRONAUT OR MISSION CONTROL PROGRAMS, PROVIDES THE LOWER BOUND.  A STOP IN THE THROTTLE HARDWARE
034497,000071:                                                                                                  #  PROVIDES THE UPPER.
034498,000072: 
034499,000073: 31,2244           35014        WHERETO            CA       EBANK5                                #  INITIALIZE L*WCR*T AND H*GHCR*T FROM
034500,000074: 31,2245           54003                           TS       EBANK                                 #        PAD LOADED ERASABLES IN W-MATRIX

Page 794

034502,000076: 31,2246  E5,1506                                  EBANK=   LOWCRIT                               
034503,000077: 31,2246           00006                           EXTEND                                         
034504,000078: 31,2247           31507                           DCA      LOWCRIT                               
034505,000079: 31,2250           52131                           DXCH     L*WCR*T                               
034506,000080: 31,2251           35016                           CA       EBANK7                                
034507,000081: 31,2252           54003                           TS       EBANK                                 
034508,000082: 31,2253  E7,1612                                  EBANK=   PIF                                   
034509,000083: 31,2253           44755                           CS       ZERO                                  #  INITIALIZE PIFPSET
034510,000084: 31,2254           55606                           TS       PIFPSET                               
034511,000085: 31,2255           40131                           CS       H*GHCR*T                              
034512,000086: 31,2256           61620                           AD       FCOLD                                 
034513,000087: 31,2257           00006                           EXTEND                                         
034514,000088: 31,2260           62272                           BZMF     LOWFCOLD                              #  BRANCH IF FCOLD < OR = HIGHCRIT
034515,000089: 31,2261           40130                           CS       L*WCR*T                               
034516,000090: 31,2262           61465                           AD       FCODD                                 
034517,000091: 31,2263           00006                           EXTEND                                         
034518,000092: 31,2264           62267                           BZMF     FCOMPSET                              #  BRANCH IF FC < OR = LOWCRIT
034519,000093: 31,2265           31467                           CA       FP                                    #  SEE NOTE 1
034520,000094: 31,2266           12277                           TCF      FLATOUT1                              
034521,000095: 
034522,000096: 31,2267           42002        FCOMPSET           CS       FMAXODD                               #  SEE NOTE 2
034523,000097: 31,2270           61467                           AD       FP                                    
034524,000098: 31,2271           12301                           TCF      FLATOUT2                              
034525,000099: 
034526,000100: 31,2272           40131        LOWFCOLD           CS       H*GHCR*T                              
034527,000101: 31,2273           61465                           AD       FCODD                                 
034528,000102: 31,2274           00006                           EXTEND                                         
034529,000103: 31,2275           62302                           BZMF     DOPIF                                 #  BRANCH IF FC < OR = HIGHCRIT
034530,000104: 
034531,000105: 31,2276           32003                           CA       FMAXPOS                               #  NO:  THROTTLE-UP
034532,000106: 31,2277           53466        FLATOUT1           DXCH     FCODD                                 
034533,000107: 31,2300           34737                           CA       FEXTRA                                
034534,000108: 31,2301           55606        FLATOUT2           TS       PIFPSET                               
034535,000109: 
034536,000110:                                                                                                  #  NOTE 1        FC IS SET EQUAL TO FP SO PIF WILL BE ZERO.  THIS IS DESIRABLE
034537,000111:                                                                                                  #                AS THERE IS ACTUALLY NO THROTTLE CHANGE.
034538,000112: 
034539,000113:                                                                                                  #  NOTE2         HERE, SINCE WE ARE ABOUT TO RETURN TO THE THROTTLEABLE REGION
034540,000114:                                                                                                  #                (BELOW 55%) THE QUANTITY -(FMAXODD-FP) IS COMPUTED AND PUT
034541,000115:                                                                                                  #                INTO PIFPSET TO COMPENSATE FOR THE DIFFERENCE BETWEEN THE
034542,000116:                                                                                                  #                NUMBER OF BITS CORRESPONDING TO FULL THROTTLE (FMAXODD) AND THE
034543,000117:                                                                                                  #                NUMBER CORRESPONDING TO ACTUAL THRUST (FP).  THUS THE TOTAL
034544,000118:                                                                                                  #                THROTTLE COMMAND PIF = FC - FP - (FMAXODD - FP) = FC - FMAXODD.
034545,000119: 
034546,000120: 31,2302           03740        DOPIF              TC       FASTCHNG                              
034547,000121: 31,2303           00006                           EXTEND                                         
034548,000122: 31,2304           31466                           DCA      FCODD                                 
034549,000123: 31,2305           55620                           TS       FCOLD                                 
034550,000124: 31,2306           53613                           DXCH     PIF                                   
034551,000125: 31,2307           00006                           EXTEND                                         

Page 795

034553,000127: 31,2310           41470                           DCS      FP                                    
034554,000128: 31,2311           21613                           DAS      PIF                                   #  PIF = FC - FP, NEVER EQUALS +0
034555,000129: 
034556,000130: 31,2312           31612        DOIT               CA       PIF                                   
034557,000131: 31,2313           61606                           AD       PIFPSET                               #  ADD IN PIFPSET, WITHOUT CHANGING PIF
034558,000132: 31,2314           55614                           TS       PSEUDO55                              
034559,000133: 31,2315           54055                           TS       THRUST                                
034560,000134: 31,2316           34750                           CAF      BIT4                                  
034561,000135: 31,2317           00006                           EXTEND                                         
034562,000136: 31,2320           05014                           WOR      CHAN14                                
034563,000137: 31,2321           30025                           CA       TIME1                                 
034564,000138: 31,2322           55617                           TS       TTHROT                                
034565,000139: 
034566,000140:                                                                                                  #  SINCE /AF/ IS NOT AN INSTANTANEOUS ACCELERATION, BUT RATHER AN "AVERAGE" OF THE ACCELERATION LEVELS DURING
034567,000141:                                                                                                  #  THE PRECEEDING PIPA INTERVAL, AND SINCE FP IS COMPUTED DIRECTLY FROM /AF/, FP IN ORDER TO CORRESPOND TO THE
034568,000142:                                                                                                  #  ACTUAL THRUST LEVEL AT THE END OF THE INTERVAL MUST BE WEIGHTED BY
034569,000143: 
034570,000144:                                                                                                  #                  PIF(PPROCESS + TL)     PIF /PIF/
034571,000145:                                                                                                  #        FWEIGHT = ------------------ + -------------
034572,000146:                                                                                                  #                       PGUID           2 PGUID FRATE
034573,000147: 
034574,000148:                                                                                                  #  WHERE PPROCESS IS THE TIME BETWEEN PIPA READING AND THE START OF THROTTLING, PGUID IS THE GUIDANCE PERIOD, AND
034575,000149:                                                                                                  #  FRATE IS THE THROTTLING RATE (32 UNITS PER CENTISECOND).  PGUID IS EITHER 1 OR 2 SECONDS.  THE "TL" IN THE
034576,000150:                                                                                                  #  FIRST TERM REPRESENTS THE ENGINE'S RESPONSE LAG.  HERE FWEIGHT IS COMPUTED FOR USE NEXT PASS.
034577,000151: 
034578,000152: 31,2323           31762                           CA       THISTPIP   +1                         #  INITIALIZE FWEIGHT COMP AS IF FOR P66
034579,000153: 31,2324           54130                           TS       BUF                                   
034580,000154: 
034581,000155: 31,2325           41011                           CS       MODREG                                #  ARE WE IN FACT IN P66?
034582,000156: 31,2326           62501                           AD       DEC66                                 
034583,000157: 31,2327           00006                           EXTEND                                         
034584,000158: 31,2330           12335                           BZF      FWCOMP                                #  YES
034585,000159: 
034586,000160: 31,2331           31235                           CA       PIPTIME    +1                         #  NO:  INITIALIZE FOR TWO SECOND PERIOD
034587,000161: 31,2332           54130                           TS       BUF                                   
034588,000162: 31,2333           35003                           CAF      4SECS                                 
034589,000163: 31,2334           12336                           TCF      FWCOMP     +1                         
034590,000164: 
034591,000165: 31,2335           35000        FWCOMP             CAF      2SECS                                 
034592,000166: 31,2336           54002                 +1        TS       Q                                     
034593,000167: 31,2337           00006                           EXTEND                                         
034594,000168: 31,2340           74746                           MP       BIT6                                  
034595,000169: 31,2341           22131                           LXCH     BUF        +1                         
034596,000170: 31,2342           40130                           CS       BUF                                   #  TIME OF LAST PIPA READING.
034597,000171: 31,2343           60025                           AD       TIME1                                 
034598,000172: 31,2344           62004                           AD       THROTLAG                              #  COMPENSATE FOR ENGINE RESPONSE LAG
034599,000173: 31,2345           74357                           MASK     LOW8                                  #  MAKE SURE SMALL AND POSITIVE
034600,000174: 31,2346           22007                           ZL                                             
034601,000175: 31,2347           00006                           EXTEND                                         

Page 796

034603,000177: 31,2350           10002                           DV       Q                                     
034604,000178: 31,2351           00006                           EXTEND                                         
034605,000179: 31,2352           71612                           MP       PIF                                   
034606,000180: 31,2353           60000                           DOUBLE                                         
034607,000181: 31,2354           53611                           DXCH     FWEIGHT                               
034608,000182: 31,2355           11612                           CCS      PIF                                   
034609,000183: 31,2356           64753                           AD       ONE                                   
034610,000184: 31,2357           12361                           TCF      +2                                    
034611,000185: 31,2360           64753                           AD       ONE                                   
034612,000186: 31,2361           00006                           EXTEND                                         
034613,000187: 31,2362           71612                           MP       PIF                                   
034614,000188: 31,2363           00006                           EXTEND                                         
034615,000189: 31,2364           10131                           DV       BUF        +1                         
034616,000190: 31,2365           22007                           ZL                                             
034617,000191: 31,2366           21611                           DAS      FWEIGHT                               
034618,000192: 
034619,000193: 31,2367           01607        THDUMP             TC       RTNHOLD                               
034620,000194: 
034621,000195:                                                                                                  #  FLATOUT THROTTLES UP THE DESCENT ENGINE, AND IS CALLED AS A BASIC SUBROUTINE.
034622,000196: 
034623,000197: 31,2370           34737        FLATOUT            CAF      BIT13                                 #  4096 PULSES
034624,000198: 31,2371           55606        WHATOUT            TS       PIFPSET                               #  USE PIFPSET SO FWEIGHT WILL BE ZERO
034625,000199: 31,2372           44755                           CS       ZERO                                  
034626,000200: 31,2373           55620                           TS       FCOLD                                 
034627,000201: 31,2374           55612                           TS       PIF                                   
034628,000202: 31,2375           00006                           EXTEND                                         
034629,000203: 31,2376           23607                           QXCH     RTNHOLD                               
034630,000204: 31,2377           12312                           TCF      DOIT                                  
034631,000205: 
034632,000206:                                                                                                  #  MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
034633,000207: 
034634,000208: 31,2400           00006        MASSMULT           EXTEND                                         
034635,000209: 31,2401           22130                           QXCH     BUF                                   
034636,000210: 31,2402           52155                           DXCH     MPAC                                  
034637,000211: 31,2403           07103                           TC       DMP                                   
034638,000212: 31,2404           01244                           ADRES    MASS                                  
034639,000213: 31,2405           07103                           TC       DMP                                   #  LEAVES PROPERLY SCALED FORCE IM MPAC
034640,000214: 31,2406           02005                           ADRES    SCALEFAC                              
034641,000215: 31,2407           07257                           TC       TPAGREE                               
034642,000216: 31,2410           30154                           CA       MPAC                                  
034643,000217: 31,2411           00006                           EXTEND                                         
034644,000218: 31,2412           12415                           BZF      +3                                    
034645,000219: 31,2413           34733                           CAF      POSMAX                                
034646,000220: 31,2414           00130                           TC       BUF                                   
034647,000221: 31,2415           52156                           DXCH     MPAC       +1                         
034648,000222: 31,2416           00130                           TC       BUF                                   

Page 797

034650,000224:                                                                                                  #  CONSTANTS:-
034651,000225: 
034652,000226: 31,2417     4737               FEXTRA             =        BIT13                                 #  FEXT +5.13309020 E+4
034653,000227: 
034654,000228: 31,2417           04143        /AF/CNST           DEC      .13107                                
034655,000229: 
034656,000230:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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