Source Code

These source-code files are part of a reconstructed copy of Luminary 163, the first (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 163 listing would be different.

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.

033797,000002:                                                                                                  ## Copyright:   Public domain.
033798,000003:                                                                                                  ## Filename:    THROTTLE_CONTROL_ROUTINES.agc
033799,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
033800,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
033801,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
033802,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
033803,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
033804,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
033805,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
033806,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
033807,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
033808,000013:                                                                                                  ##              that the reconstruction is correct.
033809,000014:                                                                                                  ## Reference:   pp. 779-783
033810,000015:                                                                                                  ## Assembler:   yaYUL
033811,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
033812,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
033813,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
033814,000019: 

Page 789

033816,000021: 31,2144                                           BANK     31                                    
033817,000022: 
033818,000023: 31,2000                                           SETLOC   FTHROT                                
033819,000024: 
033820,000025: 31,2000                                           BANK                                           
033821,000026: 
033822,000027: 31,2144  E7,1612                                  EBANK=   PIF                                   
033823,000028: 
033824,000029: 31,2144                                           COUNT*   $$/THROT                              
033825,000030:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
033826,000031:                                                                                                  #  HERE FC, DESIRED THRUST, AND FP, PRESENT THRUST, UNWEIGHTED, ARE COMPUTED.
033827,000032: 
033828,000033: 31,2144           31245        THROTTLE           CA       ABDELV                                #  COMPUTE PRESENT ACCELERATION IN UNITS OF
033829,000034: 31,2145           00006                           EXTEND                                         #   2(-4) M/CS/CS, SAVING SERVICER TROUBLE
033830,000035: 31,2146           72363                           MP       /AF/CNST                              
033831,000036: 31,2147           00006                 +3        EXTEND                                         
033832,000037: 31,2150           23607                           QXCH     RTNHOLD                               
033833,000038: 31,2151           02344        AFDUMP             TC       MASSMULT                              
033834,000039: 31,2152           53470                           DXCH     FP                                    #  FP = PRESENT THRUST
033835,000040: 31,2153           00006                           EXTEND                                         
033836,000041: 31,2154           31464                           DCA      /AFC/                                 
033837,000042: 31,2155           02344                           TC       MASSMULT                              
033838,000043: 31,2156           00004                           INHINT                                         #  PREVENT A DOWNRUPT
033839,000044: 31,2157           55615                           TS       FC                                    #  FC = THRUST DESIRED BY GUIDANCE
033840,000045: 31,2160           53466                           DXCH     FCODD                                 #  FCODD = WHAT IT IS GOING TO GET
033841,000046: 
033842,000047: 
033843,000048: 31,2161           00006                           EXTEND                                         
033844,000049: 31,2162           31234                           DCA      PIPTIME                               
033845,000050: 31,2163           53753                           DXCH     GTCTIME                               #  DOWNLINK TIME AGREEMENT
033846,000051: 31,2164           00003                           RELINT                                         
033847,000052: 
033848,000053:                                                                                                  #  COMPUTE DESIRED THRUST FOR DISPLAY AS A PERCENTAGE OF 10,500 POUNDS
033849,000054: 
033850,000055: 31,2165           32365                           CAF      4FMAXNOM                              #  MOVE 4FMAXNOM TO ERASABLE FOR DV BELOW
033851,000056: 31,2166           54002                           TS       Q                                     
033852,000057: 31,2167           31615                           CA       FC                                    
033853,000058: 31,2170           72364                           MASK     OCT17777                              #  FOR SAFETY
033854,000059: 31,2171           00006                           EXTEND                                         
033855,000060: 31,2172           10002                           DV       Q                                     
033856,000061: 31,2173           00006                           EXTEND                                         
033857,000062: 31,2174           75003                           MP       4SECS                                 
033858,000063: 31,2175           55750                           TS       THRDISP                               #  FOR DISPLAY IN  N92
033859,000064: 
033860,000065:                                                                                                  #  IF IT HAS BEEN LESS THAN 3 SECONDS SINCE THE LAST THROTTLING, AUGMENT FP USING THE FWEIGHT CALCULATED THEN.
033861,000066: 
033862,000067: 31,2176           41617                           CS       TTHROT                                #  THIS CODING ASSUMES A FLATOUT WITHIN

Page 790

033864,000069: 31,2177           60025                           AD       TIME1                                 #    80 SECONDS BEFORE FIRST THROTTLE CALL
033865,000070: 31,2200           74733                           MASK     POSMAX                                
033866,000071: 31,2201           40000                           COM                                            
033867,000072: 31,2202           65002                           AD       3SECS                                 
033868,000073: 31,2203           00006                           EXTEND                                         
033869,000074: 31,2204           62210                           BZMF     WHERETO                               #  BRANCH IF (TIME1-TTHROT +1) > 3 SECONDS
033870,000075: 31,2205           00006                           EXTEND                                         
033871,000076: 31,2206           31611                           DCA      FWEIGHT                               
033872,000077: 31,2207           21470                           DAS      FP                                    
033873,000078: 
033874,000079: 
033875,000080:                                                                                                  #      THIS LOGIC DETERMINES THE THROTTLING IN THE REGION 10% - 94%.   THE MANUAL THROTTLE, NOMINALLY SET AT
033876,000081:                                                                                                  #  MINIMUM BY ASTRONAUT OR MISSION CONTROL PROGRAMS, PROVIDES THE LOWER BOUND.   A STOP IN THE THROTTLE HARDWARE
033877,000082:                                                                                                  #  PROVIDES THE UPPER.
033878,000083: 
033879,000084: 31,2210           35014        WHERETO            CA       EBANK5                                #  INITIALIZE L*WCR*T AND H*GHCR*T FROM
033880,000085: 31,2211           54003                           TS       EBANK                                 #   PAD LOADED ERASABLES IN W-MATRIX
033881,000086: 31,2212  E5,1472                                  EBANK=   LOWCRIT                               
033882,000087: 31,2212           00006                           EXTEND                                         
033883,000088: 31,2213           31473                           DCA      LOWCRIT                               
033884,000089: 31,2214           52131                           DXCH     L*WCR*T                               
033885,000090: 31,2215           35016                           CA       EBANK7                                
033886,000091: 31,2216           54003                           TS       EBANK                                 
033887,000092: 31,2217  E7,1612                                  EBANK=   PIF                                   
033888,000093: 31,2217           44755                           CS       ZERO                                  #  INITIALIZE PIFPSET
033889,000094: 31,2220           55606                           TS       PIFPSET                               
033890,000095: 31,2221           40131                           CS       H*GHCR*T                              
033891,000096: 31,2222           61620                           AD       FCOLD                                 
033892,000097: 31,2223           00006                           EXTEND                                         
033893,000098: 31,2224           62236                           BZMF     LOWFCOLD                              #  BRANCH IF FCOLD < OR = HIGHCRIT
033894,000099: 31,2225           40130                           CS       L*WCR*T                               
033895,000100: 31,2226           61465                           AD       FCODD                                 
033896,000101: 31,2227           00006                           EXTEND                                         
033897,000102: 31,2230           62233                           BZMF     FCOMPSET                              #  BRANCH IF FC < OR = LOWCRIT
033898,000103: 31,2231           31467                           CA       FP                                    #  SEE NOTE 1
033899,000104: 31,2232           12243                           TCF      FLATOUT1                              
033900,000105: 
033901,000106: 31,2233           42002        FCOMPSET           CS       FMAXODD                               #  SEE NOTE 2
033902,000107: 31,2234           61467                           AD       FP                                    
033903,000108: 31,2235           12245                           TCF      FLATOUT2                              
033904,000109: 
033905,000110: 31,2236           40131        LOWFCOLD           CS       H*GHCR*T                              
033906,000111: 31,2237           61465                           AD       FCODD                                 
033907,000112: 31,2240           00006                           EXTEND                                         
033908,000113: 31,2241           62246                           BZMF     DOPIF                                 #  BRANCH IF FC < OR = HIGHCRIT
033909,000114: 
033910,000115: 31,2242           32003                           CA       FMAXPOS                               #  NO:   THROTTLE-UP
033911,000116: 31,2243           53466        FLATOUT1           DXCH     FCODD                                 
033912,000117: 31,2244           34737                           CA       FEXTRA                                

Page 791

033914,000119: 31,2245           55606        FLATOUT2           TS       PIFPSET                               
033915,000120: 
033916,000121:                                                                                                  #  NOTE 1   FC IS SET EQUAL TO FP SO PIF WILL BE ZERO.   THIS IS DESIRABLE
033917,000122:                                                                                                  #           AS THERE IS ACTUALLY NO THROTTLE CHANGE.
033918,000123: 
033919,000124:                                                                                                  #  NOTE 2   HERE, SINCE WE ARE ABOUT TO RETURN TO THE THROTTLEABLE REGION
033920,000125:                                                                                                  #           (BELOW 55%) THE QUANTITY -(FMAXODD - FP) IS COMPUTED AND PUT
033921,000126:                                                                                                  #           INTO PIFPSET TO COMPENSATE FOR THE DIFFERENCE BETWEEN THE
033922,000127:                                                                                                  #           NUMBER OF BITS CORRESPONDING TO FULL THROTTLE (FMAXODD) AND THE
033923,000128:                                                                                                  #           NUMBER CORRESPONDING TO ACTUAL THRUST (FP).   THUS THE TOTAL
033924,000129:                                                                                                  #           THROTTLE COMMAND PIF = FC - FP -(FMAXODD - FP) = FC - FMAXODD.
033925,000130: 
033926,000131: 31,2246           03747        DOPIF              TC       FASTCHNG                              
033927,000132: 31,2247           00006                           EXTEND                                         
033928,000133: 31,2250           31466                           DCA      FCODD                                 
033929,000134: 31,2251           55620                           TS       FCOLD                                 
033930,000135: 31,2252           53613                           DXCH     PIF                                   
033931,000136: 31,2253           00006                           EXTEND                                         
033932,000137: 31,2254           41470                           DCS      FP                                    
033933,000138: 31,2255           21613                           DAS      PIF                                   #  PIF = FC - FP, NEVER EQUALS +0
033934,000139: 
033935,000140: 
033936,000141: 31,2256           31612        DOIT               CA       PIF                                   
033937,000142: 31,2257           61606                           AD       PIFPSET                               #  ADD IN PIFPSET, WITHOUT CHANGING PIF
033938,000143: 31,2260           55614                           TS       PSEUDO55                              
033939,000144: 31,2261           54055                           TS       THRUST                                
033940,000145: 31,2262           34750                           CAF      BIT4                                  
033941,000146: 31,2263           00006                           EXTEND                                         
033942,000147: 31,2264           05014                           WOR      CHAN14                                
033943,000148: 31,2265           30025                           CA       TIME1                                 
033944,000149: 31,2266           55617                           TS       TTHROT                                
033945,000150: 
033946,000151:                                                                                                  #      SINCE /AF/ IS NOT AN INSTANTANEOUS ACCELERATION, BUT RATHER AN "AVERAGE" OF THE ACCELERATION LEVELS DURING
033947,000152:                                                                                                  #  THE PRECEEDING PIPA INTERVAL, AND SINCE FP IS COMPUTED DIRECTLY FROM /AF/, FP IN ORDER TO CORRESPOND TO THE
033948,000153:                                                                                                  #  ACTUAL THRUST LEVEL AT THE END OF THE INTERVAL MUST BE WEIGHTED BY
033949,000154: 
033950,000155:                                                                                                  #                                    PIF(PPROCESS + TL)     PIF /PIF/
033951,000156:                                                                                                  #                          FWEIGHT = ------------------ + -------------
033952,000157:                                                                                                  #                                          PGUID          2 PGUID FRATE
033953,000158: 
033954,000159:                                                                                                  #  WHERE PPROCESS IS THE TIME BETWEEN PIPA READING AND THE START OF THROTTLING, PGUID IS THE GUIDANCE PERIOD, AND
033955,000160:                                                                                                  #  FRATE IS THE THROTTLING RATE (32 UNITS PER CENTISECOND).  PGUID IS EITHER 1 OR 2 SECONDS. THE "TL" IN THE
033956,000161:                                                                                                  #  FIRST TERM REPRESENTS THE ENGINE'S RESPONSE LAG.   HERE FWEIGHT IS COMPUTED FOR USE NEXT PASS.
033957,000162: 
033958,000163: 31,2267           31762                           CA       THISTPIP   +1                         #  INITIALIZE FWEIGHT COMP AS IF FOR P66
033959,000164: 31,2270           54130                           TS       BUF                                   
033960,000165: 
033961,000166: 31,2271           41010                           CS       MODREG                                #  ARE WE IN FACT IN P66?
033962,000167: 31,2272           62454                           AD       DEC66                                 
033963,000168: 31,2273           00006                           EXTEND                                         

Page 792

033965,000170: 31,2274           12301                           BZF      FWCOMP                                #  YES
033966,000171: 
033967,000172: 31,2275           31234                           CA       PIPTIME    +1                         #  NO:   INITIALIZE FOR TWO SECOND PERIOD
033968,000173: 31,2276           54130                           TS       BUF                                   
033969,000174: 31,2277           35003                           CAF      4SECS                                 
033970,000175: 31,2300           12302                           TCF      FWCOMP     +1                         
033971,000176: 
033972,000177: 31,2301           35000        FWCOMP             CAF      2SECS                                 
033973,000178: 31,2302           54002                 +1        TS       Q                                     
033974,000179: 31,2303           00006                           EXTEND                                         
033975,000180: 31,2304           74746                           MP       BIT6                                  
033976,000181: 31,2305           22131                           LXCH     BUF        +1                         
033977,000182: 31,2306           40130                           CS       BUF                                   #  TIME OF LAST PIPA READING.
033978,000183: 31,2307           60025                           AD       TIME1                                 
033979,000184: 31,2310           62004                           AD       THROTLAG                              #  COMPENSATE FOR ENGINE RESPONSE LAG
033980,000185: 31,2311           74357                           MASK     LOW8                                  #  MAKE SURE SMALL AND POSITIVE
033981,000186: 31,2312           22007                           ZL                                             
033982,000187: 31,2313           00006                           EXTEND                                         
033983,000188: 31,2314           10002                           DV       Q                                     
033984,000189: 31,2315           00006                           EXTEND                                         
033985,000190: 31,2316           71612                           MP       PIF                                   
033986,000191: 31,2317           60000                           DOUBLE                                         
033987,000192: 31,2320           53611                           DXCH     FWEIGHT                               
033988,000193: 31,2321           11612                           CCS      PIF                                   
033989,000194: 31,2322           64753                           AD       ONE                                   
033990,000195: 31,2323           12325                           TCF      +2                                    
033991,000196: 31,2324           64753                           AD       ONE                                   
033992,000197: 31,2325           00006                           EXTEND                                         
033993,000198: 31,2326           71612                           MP       PIF                                   
033994,000199: 31,2327           00006                           EXTEND                                         
033995,000200: 31,2330           10131                           DV       BUF        +1                         
033996,000201: 31,2331           22007                           ZL                                             
033997,000202: 31,2332           21611                           DAS      FWEIGHT                               
033998,000203: 
033999,000204: 
034000,000205: 31,2333           01607        THDUMP             TC       RTNHOLD                               
034001,000206: 
034002,000207: 
034003,000208:                                                                                                  #  FLATOUT THROTTLES UP THE DESCENT ENGINE, AND IS CALLED AS A BASIC SUBROUTINE.
034004,000209: 
034005,000210: 31,2334           34737        FLATOUT            CAF      BIT13                                 #  4096 PULSES
034006,000211: 31,2335           55606        WHATOUT            TS       PIFPSET                               #  USE PIFPSET SO FWEIGHT WILL BE ZERO
034007,000212: 31,2336           44755                           CS       ZERO                                  
034008,000213: 31,2337           55620                           TS       FCOLD                                 
034009,000214: 31,2340           55612                           TS       PIF                                   
034010,000215: 31,2341           00006                           EXTEND                                         
034011,000216: 31,2342           23607                           QXCH     RTNHOLD                               
034012,000217: 31,2343           12256                           TCF      DOIT                                  
034013,000218: 

Page 793

034015,000220:                                                                                                  #  MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
034016,000221: 
034017,000222: 31,2344           00006        MASSMULT           EXTEND                                         
034018,000223: 31,2345           22130                           QXCH     BUF                                   
034019,000224: 31,2346           52155                           DXCH     MPAC                                  
034020,000225: 31,2347           07106                           TC       DMP                                   
034021,000226: 31,2350           01243                           ADRES    MASS                                  
034022,000227: 31,2351           07106                           TC       DMP                                   #  LEAVES PROPERLY SCALED FORCE IM MPAC
034023,000228: 31,2352           02005                           ADRES    SCALEFAC                              
034024,000229: 31,2353           07262                           TC       TPAGREE                               
034025,000230: 31,2354           30154                           CA       MPAC                                  
034026,000231: 31,2355           00006                           EXTEND                                         
034027,000232: 31,2356           12361                           BZF      +3                                    
034028,000233: 31,2357           34733                           CAF      POSMAX                                
034029,000234: 31,2360           00130                           TC       BUF                                   
034030,000235: 31,2361           52156                           DXCH     MPAC       +1                         
034031,000236: 31,2362           00130                           TC       BUF                                   
034032,000237: 
034033,000238: 
034034,000239:                                                                                                  #  CONSTANTS:-
034035,000240: 
034036,000241: 31,2363     4737               FEXTRA             =        BIT13                                 #         FEXT +5.13309020 E+4
034037,000242: 
034038,000243: 31,2363           04143        /AF/CNST           DEC      .13107                                
034039,000244: 
034040,000245: 31,2364           17777        OCT17777           OCT      17777                                 
034041,000246: 31,2365           35074        4FMAXNOM           DEC      14908      B-14                       #  EQUIVALENT TO 10,500 LBS.
034042,000247:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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