Source Code

These source-code files are part of a reconstructed copy of Luminary 98, a development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 98 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

033617,000002:                                                                                                  ## Copyright:   Public domain.
033618,000003:                                                                                                  ## Filename:    THROTTLE_CONTROL_ROUTINES.agc
033619,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
033620,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
033621,000006:                                                                                                  ##              development version of the flight software for the Lunar 
033622,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
033623,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
033624,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
033625,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
033626,000011:                                                                                                  ##              Luminary 98 and 99.
033627,000012:                                                                                                  ## Reference:   pp. 793-797
033628,000013:                                                                                                  ## Assembler:   yaYUL
033629,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
033630,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
033631,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
033632,000017: 

Page 793

033634,000019: 31,2216                                           BANK     31                                    
033635,000020: 31,2000                                           SETLOC   FTHROT                                
033636,000021: 31,2000                                           BANK                                           
033637,000022: 31,2216  E7,1612                                  EBANK=   PIF                                   
033638,000023: 31,2216                                           COUNT*   $$/THROT                              
033639,000024: 
033640,000025:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
033641,000026:                                                                                                  #  HERE FC, DESIRED THRUST, AND FP, PRESENT THRUST, UNWEIGHTED, ARE COMPUTED.
033642,000027: 
033643,000028: 31,2216           31246        THROTTLE           CA       ABDELV                                #  COMPUTE PRESENT ACCELERATION IN UNITS OF
033644,000029: 31,2217           00006                           EXTEND                                         #  2(-4) M/CS/CS, SAVING SERVICER TROUBLE
033645,000030: 31,2220           72417                           MP       /AF/CNST                              
033646,000031: 31,2221           00006                 +3        EXTEND                                         
033647,000032: 31,2222           23607                           QXCH     RTNHOLD                               
033648,000033: 31,2223           02400        AFDUMP             TC       MASSMULT                              
033649,000034: 31,2224           53470                           DXCH     FP                                    #  FP = PRESENT THRUST
033650,000035: 31,2225           00006                           EXTEND                                         
033651,000036: 31,2226           31464                           DCA      /AFC/                                 
033652,000037: 31,2227           02400                           TC       MASSMULT                              
033653,000038: 31,2230           55615                           TS       FC                                    #  FC = THRUST DESIRED BY GUIDANCE
033654,000039: 31,2231           53466                           DXCH     FCODD                                 #  FCODD = WHAT IT IS GOING TO GET
033655,000040: 
033656,000041:                                                                                                  #  IF IT HAS BEEN LESS THAN 3 SECONDS SINCE THE LAST THROTTLING, AUGMENT FP USING THE FWEIGHT CALCULATED THEN.
033657,000042: 
033658,000043: 31,2232           41617                           CS       TTHROT                                #  THIS CODING ASSUMES A FLATOUT WITHIN
033659,000044: 31,2233           60025                           AD       TIME1                                 #        80 SECONDS BEFORE FIRST THROTTLE CALL
033660,000045: 31,2234           74733                           MASK     POSMAX                                
033661,000046: 31,2235           40000                           COM                                            
033662,000047: 31,2236           65002                           AD       3SECS                                 
033663,000048: 31,2237           00006                           EXTEND                                         
033664,000049: 31,2240           62244                           BZMF     WHERETO                               #  BRANCH IF (TIME1-TTHROT +1) > 3 SECONDS
033665,000050: 31,2241           00006                           EXTEND                                         
033666,000051: 31,2242           31611                           DCA      FWEIGHT                               
033667,000052: 31,2243           21470                           DAS      FP                                    
033668,000053: 
033669,000054:                                                                                                  #      THIS LOGIC DETERMINES THE THROTTLING IN THE REGION 10% - 94%.  THE MANUAL THROTTLE, NOMINALLY SET AT
033670,000055:                                                                                                  #  MINIMUM BY ASTRONAUT OR MISSION CONTROL PROGRAMS, PROVIDES THE LOWER BOUND.  A STOP IN THE THROTTLE HARDWARE
033671,000056:                                                                                                  #  PROVIDES THE UPPER.
033672,000057: 
033673,000058: 31,2244           35014        WHERETO            CA       EBANK5                                #  INITIALIZE L*WCR*T AND H*GHCR*T FROM
033674,000059: 31,2245           54003                           TS       EBANK                                 #        PAD LOADED ERASABLES IN W-MATRIX

Page 794

033676,000061: 31,2246  E5,1506                                  EBANK=   LOWCRIT                               
033677,000062: 31,2246           00006                           EXTEND                                         
033678,000063: 31,2247           31507                           DCA      LOWCRIT                               
033679,000064: 31,2250           52131                           DXCH     L*WCR*T                               
033680,000065: 31,2251           35016                           CA       EBANK7                                
033681,000066: 31,2252           54003                           TS       EBANK                                 
033682,000067: 31,2253  E7,1612                                  EBANK=   PIF                                   
033683,000068: 31,2253           44755                           CS       ZERO                                  #  INITIALIZE PIFPSET
033684,000069: 31,2254           55606                           TS       PIFPSET                               
033685,000070: 31,2255           40131                           CS       H*GHCR*T                              
033686,000071: 31,2256           61620                           AD       FCOLD                                 
033687,000072: 31,2257           00006                           EXTEND                                         
033688,000073: 31,2260           62272                           BZMF     LOWFCOLD                              #  BRANCH IF FCOLD < OR = HIGHCRIT
033689,000074: 31,2261           40130                           CS       L*WCR*T                               
033690,000075: 31,2262           61465                           AD       FCODD                                 
033691,000076: 31,2263           00006                           EXTEND                                         
033692,000077: 31,2264           62267                           BZMF     FCOMPSET                              #  BRANCH IF FC < OR = LOWCRIT
033693,000078: 31,2265           31467                           CA       FP                                    #  SEE NOTE 1
033694,000079: 31,2266           12277                           TCF      FLATOUT1                              
033695,000080: 
033696,000081: 31,2267           42002        FCOMPSET           CS       FMAXODD                               #  SEE NOTE 2
033697,000082: 31,2270           61467                           AD       FP                                    
033698,000083: 31,2271           12301                           TCF      FLATOUT2                              
033699,000084: 
033700,000085: 31,2272           40131        LOWFCOLD           CS       H*GHCR*T                              
033701,000086: 31,2273           61465                           AD       FCODD                                 
033702,000087: 31,2274           00006                           EXTEND                                         
033703,000088: 31,2275           62302                           BZMF     DOPIF                                 #  BRANCH IF FC < OR = HIGHCRIT
033704,000089: 
033705,000090: 31,2276           32003                           CA       FMAXPOS                               #  NO:  THROTTLE-UP
033706,000091: 31,2277           53466        FLATOUT1           DXCH     FCODD                                 
033707,000092: 31,2300           34737                           CA       FEXTRA                                
033708,000093: 31,2301           55606        FLATOUT2           TS       PIFPSET                               
033709,000094: 
033710,000095:                                                                                                  #  NOTE 1        FC IS SET EQUAL TO FP SO PIF WILL BE ZERO.  THIS IS DESIRABLE
033711,000096:                                                                                                  #                AS THERE IS ACTUALLY NO THROTTLE CHANGE.
033712,000097: 
033713,000098:                                                                                                  #  NOTE2         HERE, SINCE WE ARE ABOUT TO RETURN TO THE THROTTLEABLE REGION
033714,000099:                                                                                                  #                (BELOW 55%) THE QUANTITY -(FMAXODD-FP) IS COMPUTED AND PUT
033715,000100:                                                                                                  #                INTO PIFPSET TO COMPENSATE FOR THE DIFFERENCE BETWEEN THE
033716,000101:                                                                                                  #                NUMBER OF BITS CORRESPONDING TO FULL THROTTLE (FMAXODD) AND THE
033717,000102:                                                                                                  #                NUMBER CORRESPONDING TO ACTUAL THRUST (FP).  THUS THE TOTAL
033718,000103:                                                                                                  #                THROTTLE COMMAND PIF = FC - FP - (FMAXODD - FP) = FC - FMAXODD.
033719,000104: 
033720,000105: 31,2302           03740        DOPIF              TC       FASTCHNG                              
033721,000106: 31,2303           00006                           EXTEND                                         
033722,000107: 31,2304           31466                           DCA      FCODD                                 
033723,000108: 31,2305           55620                           TS       FCOLD                                 
033724,000109: 31,2306           53613                           DXCH     PIF                                   
033725,000110: 31,2307           00006                           EXTEND                                         

Page 795

033727,000112: 31,2310           41470                           DCS      FP                                    
033728,000113: 31,2311           21613                           DAS      PIF                                   #  PIF = FC - FP, NEVER EQUALS +0
033729,000114: 
033730,000115: 31,2312           31612        DOIT               CA       PIF                                   
033731,000116: 31,2313           61606                           AD       PIFPSET                               #  ADD IN PIFPSET, WITHOUT CHANGING PIF
033732,000117: 31,2314           55614                           TS       PSEUDO55                              
033733,000118: 31,2315           54055                           TS       THRUST                                
033734,000119: 31,2316           34750                           CAF      BIT4                                  
033735,000120: 31,2317           00006                           EXTEND                                         
033736,000121: 31,2320           05014                           WOR      CHAN14                                
033737,000122: 31,2321           30025                           CA       TIME1                                 
033738,000123: 31,2322           55617                           TS       TTHROT                                
033739,000124: 
033740,000125:                                                                                                  #  SINCE /AF/ IS NOT AN INSTANTANEOUS ACCELERATION, BUT RATHER AN "AVERAGE" OF THE ACCELERATION LEVELS DURING
033741,000126:                                                                                                  #  THE PRECEEDING PIPA INTERVAL, AND SINCE FP IS COMPUTED DIRECTLY FROM /AF/, FP IN ORDER TO CORRESPOND TO THE
033742,000127:                                                                                                  #  ACTUAL THRUST LEVEL AT THE END OF THE INTERVAL MUST BE WEIGHTED BY
033743,000128: 
033744,000129:                                                                                                  #                  PIF(PPROCESS + TL)     PIF /PIF/
033745,000130:                                                                                                  #        FWEIGHT = ------------------ + -------------
033746,000131:                                                                                                  #                       PGUID           2 PGUID FRATE
033747,000132: 
033748,000133:                                                                                                  #  WHERE PPROCESS IS THE TIME BETWEEN PIPA READING AND THE START OF THROTTLING, PGUID IS THE GUIDANCE PERIOD, AND
033749,000134:                                                                                                  #  FRATE IS THE THROTTLING RATE (32 UNITS PER CENTISECOND).  PGUID IS EITHER 1 OR 2 SECONDS.  THE "TL" IN THE
033750,000135:                                                                                                  #  FIRST TERM REPRESENTS THE ENGINE'S RESPONSE LAG.  HERE FWEIGHT IS COMPUTED FOR USE NEXT PASS.
033751,000136: 
033752,000137: 31,2323           31762                           CA       THISTPIP   +1                         #  INITIALIZE FWEIGHT COMP AS IF FOR P66
033753,000138: 31,2324           54130                           TS       BUF                                   
033754,000139: 
033755,000140: 31,2325           41011                           CS       MODREG                                #  ARE WE IN FACT IN P66?
033756,000141: 31,2326           62501                           AD       DEC66                                 
033757,000142: 31,2327           00006                           EXTEND                                         
033758,000143: 31,2330           12335                           BZF      FWCOMP                                #  YES
033759,000144: 
033760,000145: 31,2331           31235                           CA       PIPTIME    +1                         #  NO:  INITIALIZE FOR TWO SECOND PERIOD
033761,000146: 31,2332           54130                           TS       BUF                                   
033762,000147: 31,2333           35003                           CAF      4SECS                                 
033763,000148: 31,2334           12336                           TCF      FWCOMP     +1                         
033764,000149: 
033765,000150: 31,2335           35000        FWCOMP             CAF      2SECS                                 
033766,000151: 31,2336           54002                 +1        TS       Q                                     
033767,000152: 31,2337           00006                           EXTEND                                         
033768,000153: 31,2340           74746                           MP       BIT6                                  
033769,000154: 31,2341           22131                           LXCH     BUF        +1                         
033770,000155: 31,2342           40130                           CS       BUF                                   #  TIME OF LAST PIPA READING.
033771,000156: 31,2343           60025                           AD       TIME1                                 
033772,000157: 31,2344           62004                           AD       THROTLAG                              #  COMPENSATE FOR ENGINE RESPONSE LAG
033773,000158: 31,2345           74357                           MASK     LOW8                                  #  MAKE SURE SMALL AND POSITIVE
033774,000159: 31,2346           22007                           ZL                                             
033775,000160: 31,2347           00006                           EXTEND                                         

Page 796

033777,000162: 31,2350           10002                           DV       Q                                     
033778,000163: 31,2351           00006                           EXTEND                                         
033779,000164: 31,2352           71612                           MP       PIF                                   
033780,000165: 31,2353           60000                           DOUBLE                                         
033781,000166: 31,2354           53611                           DXCH     FWEIGHT                               
033782,000167: 31,2355           11612                           CCS      PIF                                   
033783,000168: 31,2356           64753                           AD       ONE                                   
033784,000169: 31,2357           12361                           TCF      +2                                    
033785,000170: 31,2360           64753                           AD       ONE                                   
033786,000171: 31,2361           00006                           EXTEND                                         
033787,000172: 31,2362           71612                           MP       PIF                                   
033788,000173: 31,2363           00006                           EXTEND                                         
033789,000174: 31,2364           10131                           DV       BUF        +1                         
033790,000175: 31,2365           22007                           ZL                                             
033791,000176: 31,2366           21611                           DAS      FWEIGHT                               
033792,000177: 
033793,000178: 31,2367           01607        THDUMP             TC       RTNHOLD                               
033794,000179: 
033795,000180:                                                                                                  #  FLATOUT THROTTLES UP THE DESCENT ENGINE, AND IS CALLED AS A BASIC SUBROUTINE.
033796,000181: 
033797,000182: 31,2370           34737        FLATOUT            CAF      BIT13                                 #  4096 PULSES
033798,000183: 31,2371           55606        WHATOUT            TS       PIFPSET                               #  USE PIFPSET SO FWEIGHT WILL BE ZERO
033799,000184: 31,2372           44755                           CS       ZERO                                  
033800,000185: 31,2373           55620                           TS       FCOLD                                 
033801,000186: 31,2374           55612                           TS       PIF                                   
033802,000187: 31,2375           00006                           EXTEND                                         
033803,000188: 31,2376           23607                           QXCH     RTNHOLD                               
033804,000189: 31,2377           12312                           TCF      DOIT                                  
033805,000190: 
033806,000191:                                                                                                  #  MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
033807,000192: 
033808,000193: 31,2400           00006        MASSMULT           EXTEND                                         
033809,000194: 31,2401           22130                           QXCH     BUF                                   
033810,000195: 31,2402           52155                           DXCH     MPAC                                  
033811,000196: 31,2403           07103                           TC       DMP                                   
033812,000197: 31,2404           01244                           ADRES    MASS                                  
033813,000198: 31,2405           07103                           TC       DMP                                   #  LEAVES PROPERLY SCALED FORCE IM MPAC
033814,000199: 31,2406           02005                           ADRES    SCALEFAC                              
033815,000200: 31,2407           07257                           TC       TPAGREE                               
033816,000201: 31,2410           30154                           CA       MPAC                                  
033817,000202: 31,2411           00006                           EXTEND                                         
033818,000203: 31,2412           12415                           BZF      +3                                    
033819,000204: 31,2413           34733                           CAF      POSMAX                                
033820,000205: 31,2414           00130                           TC       BUF                                   
033821,000206: 31,2415           52156                           DXCH     MPAC       +1                         
033822,000207: 31,2416           00130                           TC       BUF                                   

Page 797

033824,000209:                                                                                                  #  CONSTANTS:-
033825,000210: 
033826,000211: 31,2417     4737               FEXTRA             =        BIT13                                 #  FEXT +5.13309020 E+4
033827,000212: 
033828,000213: 31,2417           04143        /AF/CNST           DEC      .13107                                
033829,000214: 
033830,000215:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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