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
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

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

Page 793

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

Page 794

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

Page 795

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

Page 796

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

Page 797

034662,000224:                                                                                                  #  CONSTANTS:-
034663,000225: 
034664,000226: 31,2417     4737               FEXTRA             =        BIT13                                 #  FEXT +5.13309020 E+4
034665,000227: 
034666,000228: 31,2417           04143        /AF/CNST           DEC      .13107                                
034667,000229: 
034668,000230:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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