Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

035026,000002:                                                                                                  ## Copyright:   Public domain.
035027,000003:                                                                                                  ## Filename:    THROTTLE_CONTROL_ROUTINES.agc
035028,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
035029,000005:                                                                                                  ##              It is part of the source code for the original release
035030,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
035031,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
035032,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
035033,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
035034,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
035035,000011:                                                                                                  ##              that the code format has been changed to conform to the
035036,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
035037,000013:                                                                                                  ##              original YUL assembler.
035038,000014:                                                                                                  ## Reference:   pp. 797-801
035039,000015:                                                                                                  ## Assembler:   yaYUL
035040,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
035041,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
035042,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
035043,000019:                                                                                                  ##              2016-12-18 MAS  Updated from comment-proofed Luminary 99 version.
035044,000020:                                                                                                  ##              2017-01-06 RRB  Updated for Luminary 69.
035045,000021:                                                                                                  ##              2017-01-07 HG   Fix operand FLGWRD6 -> FLAGWRD6
035046,000022:                                                                                                  ##              2017-01-23 HG   Add missing sequence of statements CA  H*GHCR*T
035047,000023:                                                                                                  ##                                                                 TS  FCODD
035048,000024:                                                                                                  ##                                                                 TCF DOPIF
035049,000025:                                                                                                  ##                              Fix operator CS -> CA
035050,000026:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
035051,000027:                                                                                                  ##                              and fixed errors found.
035052,000028: 

Page 797

035054,000030: 
035055,000031: 31,2247                                           BANK     31                                    
035056,000032: 31,2000                                           SETLOC   FTHROT                                
035057,000033: 31,2000                                           BANK                                           
035058,000034: 31,2247  E7,1610                                  EBANK=   PIF                                   
035059,000035: 31,2247                                           COUNT*   $$/THROT                              
035060,000036: 
035061,000037:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
035062,000038:                                                                                                  #  HERE FC, DESIRED THRUST, AND FP, PRESENT THRUST, UNWEIGHTED, ARE COMPUTED.
035063,000039: 
035064,000040: 31,2247           31246        THROTTLE           CA       ABDELV                                #  COMPUTE PRESENT ACCELERATION IN UNITS OF
035065,000041: 31,2250           00006                           EXTEND                                         #  2(-4) M/CS/CS, SAVING SERVICER TROUBLE
035066,000042: 31,2251           72444                           MP       /AF/CNST                              
035067,000043: 31,2252           00006                 +3        EXTEND                                         
035068,000044: 31,2253           23605                           QXCH     RTNHOLD                               
035069,000045: 31,2254           02425        AFDUMP             TC       MASSMULT                              
035070,000046: 31,2255           53563                           DXCH     FP                                    #  FP = PRESENT THRUST
035071,000047: 31,2256           00006                           EXTEND                                         
035072,000048: 31,2257           31574                           DCA      /AFC/                                 
035073,000049: 31,2260           02425                           TC       MASSMULT                              
035074,000050: 31,2261           55613                           TS       FC                                    #  FC = THRUST DESIRED BY GUIDANCE
035075,000051: 31,2262           53561                           DXCH     FCODD                                 #  FCODD = WHAT IT IS GOING TO GET
035076,000052: 
035077,000053:                                                                                                  #  IF IT HAS BEEN LESS THAN 3 SECONDS SINCE THE LAST THROTTLING, AUGMENT FP USING THE FWEIGHT CALCULATED THEN.
035078,000054: 
035079,000055: 31,2263           41615                           CS       TTHROT                                #  THIS CODING ASSUMES A FLATOUT WITHIN
035080,000056: 31,2264           60025                           AD       TIME1                                 #    80 SECONDS BEFORE FIRST THROTTLE CALL
035081,000057: 31,2265           74733                           MASK     POSMAX                                
035082,000058: 31,2266           40000                           COM                                            
035083,000059: 31,2267           65002                           AD       3SECS                                 
035084,000060: 31,2270           00006                           EXTEND                                         
035085,000061: 31,2271           62275                           BZMF     WHERETO                               #  BRANCH IF (TIME1-TTHROT +1) > 3 SECONDS
035086,000062: 31,2272           00006                           EXTEND                                         
035087,000063: 31,2273           31607                           DCA      FWEIGHT                               
035088,000064: 31,2274           21563                           DAS      FP                                    
035089,000065: 
035090,000066:                                                                                                  #      THIS LOGIC DETERMINES THE THROTTLING IN THE REGION 10% - 94%.  THE MANUAL THROTTLE, NOMINALLY SET AT
035091,000067:                                                                                                  #  MINIMUM BY ASTRONAUT OR MISSION CONTROL PROGRAMS, PROVIDES THE LOWER BOUND.  A STOP IN THE THROTTLE HARDWARE
035092,000068:                                                                                                  #  PROVIDES THE UPPER.
035093,000069: 
035094,000070: 31,2275           35014        WHERETO            CA       EBANK5                                #  INITIALIZE L*WCR*T AND H*GHCR*T FROM
035095,000071: 31,2276           54003                           TS       EBANK                                 #    PAD LOADED ERASABLES IN W-MATRIX

Page 798

035097,000073: 31,2277  E5,1476                                  EBANK=   LOWCRIT                               
035098,000074: 31,2277           00006                           EXTEND                                         
035099,000075: 31,2300           31477                           DCA      LOWCRIT                               
035100,000076: 31,2301           52131                           DXCH     L*WCR*T                               
035101,000077: 31,2302           35016                           CA       EBANK7                                
035102,000078: 31,2303           54003                           TS       EBANK                                 
035103,000079: 31,2304  E7,1610                                  EBANK=   PIF                                   
035104,000080: 31,2304           44755                           CS       ZERO                                  #  INITIALIZE PIFPSET
035105,000081: 31,2305           55604                           TS       PIFPSET                               
035106,000082: 31,2306           40131                           CS       H*GHCR*T                              
035107,000083: 31,2307           61616                           AD       FCOLD                                 
035108,000084: 31,2310           00006                           EXTEND                                         
035109,000085: 31,2311           62323                           BZMF     LOWFCOLD                              #  BRANCH IF FCOLD < OR = HIGHCRIT
035110,000086: 31,2312           40130                           CS       L*WCR*T                               
035111,000087: 31,2313           61560                           AD       FCODD                                 
035112,000088: 31,2314           00006                           EXTEND                                         
035113,000089: 31,2315           62320                           BZMF     FCOMPSET                              #  BRANCH IF FC < OR = LOWCRIT
035114,000090: 31,2316           31562                           CA       FP                                    #  SEE NOTE 1
035115,000091: 31,2317           12337                           TCF      FLATOUT1                              
035116,000092: 
035117,000093: 31,2320           42002        FCOMPSET           CS       FMAXODD                               #  SEE NOTE 2
035118,000094: 31,2321           61562                           AD       FP                                    
035119,000095: 31,2322           12341                           TCF      FLATOUT2                              
035120,000096: 
035121,000097: 31,2323           40131        LOWFCOLD           CS       H*GHCR*T                              
035122,000098: 31,2324           61560                           AD       FCODD                                 
035123,000099: 31,2325           00006                           EXTEND                                         
035124,000100: 31,2326           62342                           BZMF     DOPIF                                 #  BRANCH IF FC < OR = HIGHCRIT
035125,000101: 
035126,000102: 31,2327           30102                           CA       FLAGWRD6                              #  IS POUTFLAG SET?
035127,000103: 31,2330           74745                           MASK     POUTBIT                               
035128,000104: 31,2331           00006                           EXTEND                                         
035129,000105: 31,2332           12336                           BZF      FLATOUT1   -1                         
035130,000106: 
035131,000107: 31,2333           30131                           CA       H*GHCR*T                              #  YES:  THROTTLE-UP ONLY TO HIGHCRIT
035132,000108: 31,2334           55560                           TS       FCODD                                 
035133,000109: 31,2335           12342                           TCF      DOPIF                                 
035134,000110: 
035135,000111: 31,2336           32003                           CA       FMAXPOS                               #  NO:  THROTTLE-UP
035136,000112: 31,2337           53561        FLATOUT1           DXCH     FCODD                                 
035137,000113: 31,2340           34737                           CA       FEXTRA                                
035138,000114: 31,2341           55604        FLATOUT2           TS       PIFPSET                               
035139,000115: 
035140,000116:                                                                                                  #  NOTE 1        FC IS SET EQUAL TO FP SO PIF WILL BE ZERO.  THIS IS DESIRABLE
035141,000117:                                                                                                  #                AS THERE IS ACTUALLY NO THROTTLE CHANGE.
035142,000118: 
035143,000119:                                                                                                  #  NOTE2         HERE, SINCE WE ARE ABOUT TO RETURN TO THE THROTTLEABLE REGION
035144,000120:                                                                                                  #                (BELOW 55%) THE QUANTITY -(FMAXODD-FP) IS COMPUTED AND PUT
035145,000121:                                                                                                  #                INTO PIFPSET TO COMPENSATE FOR THE DIFFERENCE BETWEEN THE
035146,000122:                                                                                                  #                NUMBER OF BITS CORRESPONDING TO FULL THROTTLE (FMAXODD) AND THE

Page 799

035148,000124:                                                                                                  #                NUMBER CORRESPONDING TO ACTUAL THRUST (FP).  THUS THE TOTAL
035149,000125:                                                                                                  #                THROTTLE COMMAND PIF = FC - FP - (FMAXODD - FP) = FC - FMAXODD.
035150,000126: 
035151,000127: 31,2342           03721        DOPIF              TC       FASTCHNG                              #  RESTART PROTECTION
035152,000128: 31,2343           00006                           EXTEND                                         
035153,000129: 31,2344           31561                           DCA      FCODD                                 
035154,000130: 31,2345           55616                           TS       FCOLD                                 
035155,000131: 31,2346           53611                           DXCH     PIF                                   
035156,000132: 31,2347           00006                           EXTEND                                         
035157,000133: 31,2350           41563                           DCS      FP                                    
035158,000134: 31,2351           21611                           DAS      PIF                                   #  PIF = FC - FP, NEVER EQUALS +0
035159,000135: 
035160,000136: 31,2352           31610        DOIT               CA       PIF                                   
035161,000137: 31,2353           61604                           AD       PIFPSET                               #  ADD IN PIFPSET, WITHOUT CHANGING PIF
035162,000138: 31,2354           55612                           TS       PSEUDO55                              
035163,000139: 31,2355           54055                           TS       THRUST                                
035164,000140: 31,2356           34750                           CAF      BIT4                                  
035165,000141: 31,2357           00006                           EXTEND                                         
035166,000142: 31,2360           05014                           WOR      CHAN14                                
035167,000143: 31,2361           30025                           CA       TIME1                                 
035168,000144: 31,2362           55615                           TS       TTHROT                                
035169,000145: 
035170,000146:                                                                                                  #  SINCE /AF/ IS NOT AN INSTANTANEOUS ACCELERATION, BUT RATHER AN "AVERAGE" OF THE ACCELERATION LEVELS DURING
035171,000147:                                                                                                  #  THE PRECEEDING PIPA INTERVAL, AND SINCE FP IS COMPUTED DIRECTLY FROM /AF/, FP IN ORDER TO CORRESPOND TO THE
035172,000148:                                                                                                  #  ACTUAL THRUST LEVEL AT THE END OF THE INTERVAL MUST BE WEIGHTED BY
035173,000149: 
035174,000150:                                                                                                  #                  PIF(PPROCESS + TL)     PIF /PIF/
035175,000151:                                                                                                  #        FWEIGHT = ------------------ + -------------
035176,000152:                                                                                                  #                       PGUID           2 PGUID FRATE
035177,000153: 
035178,000154:                                                                                                  #  WHERE PPROCESS IS THE TIME BETWEEN PIPA READING AND THE START OF THROTTLING, PGUID IS THE GUIDANCE PERIOD, AND
035179,000155:                                                                                                  #  FRATE IS THE THROTTLING RATE (32 UNITS PER CENTISECOND).  PGUID IS ASSUMED TO BE 2 SECONDS.  THE "TL" IN THE
035180,000156:                                                                                                  #  FIRST TERM REPRESENTS THE ENGINE'S RESPONSE LAG.  HERE FWEIGHT IS COMPUTED FOR USE NEXT PASS.
035181,000157: 
035182,000158: 31,2363           35003                           CA       4SECS                                 
035183,000159: 31,2364           54002                           TS       Q                                     
035184,000160: 31,2365           41235                           CS       PIPTIME    +1                         #  TIME OF LAST PIPA READING
035185,000161: 31,2366           60025                           AD       TIME1                                 
035186,000162: 31,2367           62004                           AD       THROTLAG                              #  COMPENSATE FOR ENGINE RESPONSE LAG
035187,000163: 31,2370           74357                           MASK     LOW8                                  #  MAKE SURE SMALL AND POSITIVE
035188,000164: 31,2371           22007                           ZL                                             
035189,000165: 31,2372           00006                           EXTEND                                         
035190,000166: 31,2373           10002                           DV       Q                                     
035191,000167: 31,2374           00006                           EXTEND                                         
035192,000168: 31,2375           71610                           MP       PIF                                   
035193,000169: 31,2376           60000                           DOUBLE                                         
035194,000170: 31,2377           53607                           DXCH     FWEIGHT                               
035195,000171: 31,2400           37715                           CA       2.PG.FRT                              
035196,000172: 31,2401           54002                           TS       Q                                     

Page 800

035198,000174: 31,2402           11610                           CCS      PIF                                   
035199,000175: 31,2403           64753                           AD       ONE                                   
035200,000176: 31,2404           12406                           TCF      +2                                    
035201,000177: 31,2405           64753                           AD       ONE                                   
035202,000178: 31,2406           00006                           EXTEND                                         
035203,000179: 31,2407           71610                           MP       PIF                                   
035204,000180: 31,2410           00006                           EXTEND                                         
035205,000181: 31,2411           10002                           DV       Q                                     
035206,000182: 31,2412           22007                           ZL                                             
035207,000183: 31,2413           21607                           DAS      FWEIGHT                               
035208,000184: 
035209,000185: 31,2414           01605        THDUMP             TC       RTNHOLD                               
035210,000186: 
035211,000187:                                                                                                  #  FLATOUT THROTTLES UP THE DESCENT ENGINE, AND IS CALLED AS A BASIC SUBROUTINE.
035212,000188: 
035213,000189: 31,2415           34737        FLATOUT            CAF      BIT13                                 #  4096 PULSES
035214,000190: 31,2416           55604        WHATOUT            TS       PIFPSET                               #  USE PIFPSET SO FWEIGHT WILL BE ZERO
035215,000191: 31,2417           44755                           CS       ZERO                                  
035216,000192: 31,2420           55616                           TS       FCOLD                                 
035217,000193: 31,2421           55610                           TS       PIF                                   
035218,000194: 31,2422           00006                           EXTEND                                         
035219,000195: 31,2423           23605                           QXCH     RTNHOLD                               
035220,000196: 31,2424           12352                           TCF      DOIT                                  
035221,000197: 
035222,000198:                                                                                                  #  MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
035223,000199: 
035224,000200: 31,2425           00006        MASSMULT           EXTEND                                         
035225,000201: 31,2426           22130                           QXCH     BUF                                   
035226,000202: 31,2427           00006                           EXTEND                                         
035227,000203: 31,2430           71244                           MP       MASS                                  #  LEAVES ODDLY SCALED FORCE IN A AND L
035228,000204: 31,2431           52155                           DXCH     MPAC                                  
035229,000205: 31,2432           07102                           TC       DMP                                   #  LEAVES PROPERLY SCALED FORCE IM MPAC
035230,000206: 31,2433           02005                           ADRES    SCALEFAC                              
035231,000207: 31,2434           07256                           TC       TPAGREE                               
035232,000208: 31,2435           30154                           CA       MPAC                                  
035233,000209: 31,2436           00006                           EXTEND                                         
035234,000210: 31,2437           12442                           BZF      +3                                    
035235,000211: 31,2440           34733                           CAF      POSMAX                                
035236,000212: 31,2441           00130                           TC       BUF                                   
035237,000213: 31,2442           52156                           DXCH     MPAC       +1                         
035238,000214: 31,2443           00130                           TC       BUF                                   
035239,000215: 
035240,000216:                                                                                                  #  CONSTANTS:-
035241,000217: 
035242,000218: 31,2444     4737               FEXTRA             =        BIT13                                 

Page 801

035244,000220: 31,2444     7715               2.PG.FRT           =        PRIO31                                #  DECIMAL 12800
035245,000221: 31,2444           04143        /AF/CNST           DEC      .13107                                
035246,000222: 
035247,000223:                                                                                                  #  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

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