Source Code

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

The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). 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 173 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.

033817,000002:                                                                                                  ## Copyright:   Public domain.
033818,000003:                                                                                                  ## Filename:    THROTTLE_CONTROL_ROUTINES.agc
033819,000004:                                                                                                  ## Purpose:     A section of Luminary revision 173.
033820,000005:                                                                                                  ##              It is part of the reconstructed source code for the second
033821,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
033822,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
033823,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
033824,000009:                                                                                                  ##              Luminary 178, as well as Luminary memo 167 (revision 1).
033825,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
033826,000011:                                                                                                  ##              exactly match those specified for Luminary 173 in NASA
033827,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
033828,000013:                                                                                                  ##              that the reconstruction is correct.
033829,000014:                                                                                                  ## Reference:   pp. 779-783
033830,000015:                                                                                                  ## Assembler:   yaYUL
033831,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
033832,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
033833,000018:                                                                                                  ## Mod history: 2019-09-18 MAS  Created from Luminary 178.
033834,000019: 

Page 789

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

Page 790

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

Page 791

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

Page 792

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

Page 793

034035,000220:                                                                                                  #  MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
034036,000221: 
034037,000222: 31,2344           00006        MASSMULT           EXTEND                                         
034038,000223: 31,2345           22130                           QXCH     BUF                                   
034039,000224: 31,2346           52155                           DXCH     MPAC                                  
034040,000225: 31,2347           07106                           TC       DMP                                   
034041,000226: 31,2350           01243                           ADRES    MASS                                  
034042,000227: 31,2351           07106                           TC       DMP                                   #  LEAVES PROPERLY SCALED FORCE IM MPAC
034043,000228: 31,2352           02005                           ADRES    SCALEFAC                              
034044,000229: 31,2353           07262                           TC       TPAGREE                               
034045,000230: 31,2354           30154                           CA       MPAC                                  
034046,000231: 31,2355           00006                           EXTEND                                         
034047,000232: 31,2356           12361                           BZF      +3                                    
034048,000233: 31,2357           34733                           CAF      POSMAX                                
034049,000234: 31,2360           00130                           TC       BUF                                   
034050,000235: 31,2361           52156                           DXCH     MPAC       +1                         
034051,000236: 31,2362           00130                           TC       BUF                                   
034052,000237: 
034053,000238: 
034054,000239:                                                                                                  #  CONSTANTS:-
034055,000240: 
034056,000241: 31,2363     4737               FEXTRA             =        BIT13                                 #         FEXT +5.13309020 E+4
034057,000242: 
034058,000243: 31,2363           04143        /AF/CNST           DEC      .13107                                
034059,000244: 
034060,000245: 31,2364           17777        OCT17777           OCT      17777                                 
034061,000246: 31,2365           35074        4FMAXNOM           DEC      14908      B-14                       #  EQUIVALENT TO 10,500 LBS.
034062,000247:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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