Source Code
These source-code files are part of a reconstructed copy of Luminary 97, the
second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer
(AGC) software. It was created to fix two incorrect ephemeris constants in
Luminary 96, as described by anomaly report LNY-59.
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 memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. 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 97 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. |
033870,000002: ## Copyright: Public domain.
033871,000003: ## Filename: THROTTLE_CONTROL_ROUTINES.agc
033872,000004: ## Purpose: A section of Luminary revision 97.
033873,000005: ## It is part of the reconstructed source code for the
033874,000006: ## second release of the flight software for the Lunar
033875,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
033876,000008: ## It was created to fix two incorrect ephemeris constants in
033877,000009: ## Luminary 96, as described by anomaly report LNY-59.
033878,000010: ## The code has been recreated from a copy of Luminary 99
033879,000011: ## revision 001, using asterisks indicating changed lines in
033880,000012: ## the listing and Luminary Memos #83 and #85, which list
033881,000013: ## changes between Luminary 97 and 98, and 98 and 99. The
033882,000014: ## code has been adapted such that the resulting bugger words
033883,000015: ## exactly match those specified for Luminary 97 in NASA drawing
033884,000016: ## 2021152D, which gives relatively high confidence that the
033885,000017: ## reconstruction is correct.
033886,000018: ## Reference: pp. 793-797
033887,000019: ## Assembler: yaYUL
033888,000020: ## Contact: Ron Burkey <info@sandroid.org>.
033889,000021: ## Website: www.ibiblio.org/apollo/index.html
033890,000022: ## Mod history: 2019-07-28 MAS Created from Luminary 99.
033891,000023:
Page 793 |
033893,000025: 31,2216 BANK 31
033894,000026: 31,2000 SETLOC FTHROT
033895,000027: 31,2000 BANK
033896,000028: 31,2216 E7,1612 EBANK= PIF
033897,000029: 31,2216 COUNT* $$/THROT
033898,000030:
033899,000031: # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
033900,000032: # HERE FC, DESIRED THRUST, AND FP, PRESENT THRUST, UNWEIGHTED, ARE COMPUTED.
033901,000033:
033902,000034: 31,2216 31246 THROTTLE CA ABDELV # COMPUTE PRESENT ACCELERATION IN UNITS OF
033903,000035: 31,2217 00006 EXTEND # 2(-4) M/CS/CS, SAVING SERVICER TROUBLE
033904,000036: 31,2220 72417 MP /AF/CNST
033905,000037: 31,2221 00006 +3 EXTEND
033906,000038: 31,2222 23607 QXCH RTNHOLD
033907,000039: 31,2223 02400 AFDUMP TC MASSMULT
033908,000040: 31,2224 53470 DXCH FP # FP = PRESENT THRUST
033909,000041: 31,2225 00006 EXTEND
033910,000042: 31,2226 31464 DCA /AFC/
033911,000043: 31,2227 02400 TC MASSMULT
033912,000044: 31,2230 55615 TS FC # FC = THRUST DESIRED BY GUIDANCE
033913,000045: 31,2231 53466 DXCH FCODD # FCODD = WHAT IT IS GOING TO GET
033914,000046:
033915,000047: # IF IT HAS BEEN LESS THAN 3 SECONDS SINCE THE LAST THROTTLING, AUGMENT FP USING THE FWEIGHT CALCULATED THEN.
033916,000048:
033917,000049: 31,2232 41617 CS TTHROT # THIS CODING ASSUMES A FLATOUT WITHIN
033918,000050: 31,2233 60025 AD TIME1 # 80 SECONDS BEFORE FIRST THROTTLE CALL
033919,000051: 31,2234 74733 MASK POSMAX
033920,000052: 31,2235 40000 COM
033921,000053: 31,2236 65002 AD 3SECS
033922,000054: 31,2237 00006 EXTEND
033923,000055: 31,2240 62244 BZMF WHERETO # BRANCH IF (TIME1-TTHROT +1) > 3 SECONDS
033924,000056: 31,2241 00006 EXTEND
033925,000057: 31,2242 31611 DCA FWEIGHT
033926,000058: 31,2243 21470 DAS FP
033927,000059:
033928,000060: # THIS LOGIC DETERMINES THE THROTTLING IN THE REGION 10% - 94%. THE MANUAL THROTTLE, NOMINALLY SET AT
033929,000061: # MINIMUM BY ASTRONAUT OR MISSION CONTROL PROGRAMS, PROVIDES THE LOWER BOUND. A STOP IN THE THROTTLE HARDWARE
033930,000062: # PROVIDES THE UPPER.
033931,000063:
033932,000064: 31,2244 35014 WHERETO CA EBANK5 # INITIALIZE L*WCR*T AND H*GHCR*T FROM
033933,000065: 31,2245 54003 TS EBANK # PAD LOADED ERASABLES IN W-MATRIX
Page 794 |
033935,000067: 31,2246 E5,1506 EBANK= LOWCRIT
033936,000068: 31,2246 00006 EXTEND
033937,000069: 31,2247 31507 DCA LOWCRIT
033938,000070: 31,2250 52131 DXCH L*WCR*T
033939,000071: 31,2251 35016 CA EBANK7
033940,000072: 31,2252 54003 TS EBANK
033941,000073: 31,2253 E7,1612 EBANK= PIF
033942,000074: 31,2253 44755 CS ZERO # INITIALIZE PIFPSET
033943,000075: 31,2254 55606 TS PIFPSET
033944,000076: 31,2255 40131 CS H*GHCR*T
033945,000077: 31,2256 61620 AD FCOLD
033946,000078: 31,2257 00006 EXTEND
033947,000079: 31,2260 62272 BZMF LOWFCOLD # BRANCH IF FCOLD < OR = HIGHCRIT
033948,000080: 31,2261 40130 CS L*WCR*T
033949,000081: 31,2262 61465 AD FCODD
033950,000082: 31,2263 00006 EXTEND
033951,000083: 31,2264 62267 BZMF FCOMPSET # BRANCH IF FC < OR = LOWCRIT
033952,000084: 31,2265 31467 CA FP # SEE NOTE 1
033953,000085: 31,2266 12277 TCF FLATOUT1
033954,000086:
033955,000087: 31,2267 42002 FCOMPSET CS FMAXODD # SEE NOTE 2
033956,000088: 31,2270 61467 AD FP
033957,000089: 31,2271 12301 TCF FLATOUT2
033958,000090:
033959,000091: 31,2272 40131 LOWFCOLD CS H*GHCR*T
033960,000092: 31,2273 61465 AD FCODD
033961,000093: 31,2274 00006 EXTEND
033962,000094: 31,2275 62302 BZMF DOPIF # BRANCH IF FC < OR = HIGHCRIT
033963,000095:
033964,000096: 31,2276 32003 CA FMAXPOS # NO: THROTTLE-UP
033965,000097: 31,2277 53466 FLATOUT1 DXCH FCODD
033966,000098: 31,2300 34737 CA FEXTRA
033967,000099: 31,2301 55606 FLATOUT2 TS PIFPSET
033968,000100:
033969,000101: # NOTE 1 FC IS SET EQUAL TO FP SO PIF WILL BE ZERO. THIS IS DESIRABLE
033970,000102: # AS THERE IS ACTUALLY NO THROTTLE CHANGE.
033971,000103:
033972,000104: # NOTE2 HERE, SINCE WE ARE ABOUT TO RETURN TO THE THROTTLEABLE REGION
033973,000105: # (BELOW 55%) THE QUANTITY -(FMAXODD-FP) IS COMPUTED AND PUT
033974,000106: # INTO PIFPSET TO COMPENSATE FOR THE DIFFERENCE BETWEEN THE
033975,000107: # NUMBER OF BITS CORRESPONDING TO FULL THROTTLE (FMAXODD) AND THE
033976,000108: # NUMBER CORRESPONDING TO ACTUAL THRUST (FP). THUS THE TOTAL
033977,000109: # THROTTLE COMMAND PIF = FC - FP - (FMAXODD - FP) = FC - FMAXODD.
033978,000110:
033979,000111: 31,2302 03740 DOPIF TC FASTCHNG
033980,000112: 31,2303 00006 EXTEND
033981,000113: 31,2304 31466 DCA FCODD
033982,000114: 31,2305 55620 TS FCOLD
033983,000115: 31,2306 53613 DXCH PIF
033984,000116: 31,2307 00006 EXTEND
Page 795 |
033986,000118: 31,2310 41470 DCS FP
033987,000119: 31,2311 21613 DAS PIF # PIF = FC - FP, NEVER EQUALS +0
033988,000120:
033989,000121: 31,2312 31612 DOIT CA PIF
033990,000122: 31,2313 61606 AD PIFPSET # ADD IN PIFPSET, WITHOUT CHANGING PIF
033991,000123: 31,2314 55614 TS PSEUDO55
033992,000124: 31,2315 54055 TS THRUST
033993,000125: 31,2316 34750 CAF BIT4
033994,000126: 31,2317 00006 EXTEND
033995,000127: 31,2320 05014 WOR CHAN14
033996,000128: 31,2321 30025 CA TIME1
033997,000129: 31,2322 55617 TS TTHROT
033998,000130:
033999,000131: # SINCE /AF/ IS NOT AN INSTANTANEOUS ACCELERATION, BUT RATHER AN "AVERAGE" OF THE ACCELERATION LEVELS DURING
034000,000132: # THE PRECEEDING PIPA INTERVAL, AND SINCE FP IS COMPUTED DIRECTLY FROM /AF/, FP IN ORDER TO CORRESPOND TO THE
034001,000133: # ACTUAL THRUST LEVEL AT THE END OF THE INTERVAL MUST BE WEIGHTED BY
034002,000134:
034003,000135: # PIF(PPROCESS + TL) PIF /PIF/
034004,000136: # FWEIGHT = ------------------ + -------------
034005,000137: # PGUID 2 PGUID FRATE
034006,000138:
034007,000139: # WHERE PPROCESS IS THE TIME BETWEEN PIPA READING AND THE START OF THROTTLING, PGUID IS THE GUIDANCE PERIOD, AND
034008,000140: # FRATE IS THE THROTTLING RATE (32 UNITS PER CENTISECOND). PGUID IS EITHER 1 OR 2 SECONDS. THE "TL" IN THE
034009,000141: # FIRST TERM REPRESENTS THE ENGINE'S RESPONSE LAG. HERE FWEIGHT IS COMPUTED FOR USE NEXT PASS.
034010,000142:
034011,000143: 31,2323 31762 CA THISTPIP +1 # INITIALIZE FWEIGHT COMP AS IF FOR P66
034012,000144: 31,2324 54130 TS BUF
034013,000145:
034014,000146: 31,2325 41011 CS MODREG # ARE WE IN FACT IN P66?
034015,000147: 31,2326 62501 AD DEC66
034016,000148: 31,2327 00006 EXTEND
034017,000149: 31,2330 12335 BZF FWCOMP # YES
034018,000150:
034019,000151: 31,2331 31235 CA PIPTIME +1 # NO: INITIALIZE FOR TWO SECOND PERIOD
034020,000152: 31,2332 54130 TS BUF
034021,000153: 31,2333 35003 CAF 4SECS
034022,000154: 31,2334 12336 TCF FWCOMP +1
034023,000155:
034024,000156: 31,2335 35000 FWCOMP CAF 2SECS
034025,000157: 31,2336 54002 +1 TS Q
034026,000158: 31,2337 00006 EXTEND
034027,000159: 31,2340 74746 MP BIT6
034028,000160: 31,2341 22131 LXCH BUF +1
034029,000161: 31,2342 40130 CS BUF # TIME OF LAST PIPA READING.
034030,000162: 31,2343 60025 AD TIME1
034031,000163: 31,2344 62004 AD THROTLAG # COMPENSATE FOR ENGINE RESPONSE LAG
034032,000164: 31,2345 74357 MASK LOW8 # MAKE SURE SMALL AND POSITIVE
034033,000165: 31,2346 22007 ZL
034034,000166: 31,2347 00006 EXTEND
Page 796 |
034036,000168: 31,2350 10002 DV Q
034037,000169: 31,2351 00006 EXTEND
034038,000170: 31,2352 71612 MP PIF
034039,000171: 31,2353 60000 DOUBLE
034040,000172: 31,2354 53611 DXCH FWEIGHT
034041,000173: 31,2355 11612 CCS PIF
034042,000174: 31,2356 64753 AD ONE
034043,000175: 31,2357 12361 TCF +2
034044,000176: 31,2360 64753 AD ONE
034045,000177: 31,2361 00006 EXTEND
034046,000178: 31,2362 71612 MP PIF
034047,000179: 31,2363 00006 EXTEND
034048,000180: 31,2364 10131 DV BUF +1
034049,000181: 31,2365 22007 ZL
034050,000182: 31,2366 21611 DAS FWEIGHT
034051,000183:
034052,000184: 31,2367 01607 THDUMP TC RTNHOLD
034053,000185:
034054,000186: # FLATOUT THROTTLES UP THE DESCENT ENGINE, AND IS CALLED AS A BASIC SUBROUTINE.
034055,000187:
034056,000188: 31,2370 34737 FLATOUT CAF BIT13 # 4096 PULSES
034057,000189: 31,2371 55606 WHATOUT TS PIFPSET # USE PIFPSET SO FWEIGHT WILL BE ZERO
034058,000190: 31,2372 44755 CS ZERO
034059,000191: 31,2373 55620 TS FCOLD
034060,000192: 31,2374 55612 TS PIF
034061,000193: 31,2375 00006 EXTEND
034062,000194: 31,2376 23607 QXCH RTNHOLD
034063,000195: 31,2377 12312 TCF DOIT
034064,000196:
034065,000197: # MASSMULT SCALES ACCELERATION, ARRIVING IN A AND L IN UNITS OF 2(-4) M/CS/CS, TO FORCE IN PULSE UNITS.
034066,000198:
034067,000199: 31,2400 00006 MASSMULT EXTEND
034068,000200: 31,2401 22130 QXCH BUF
034069,000201: 31,2402 52155 DXCH MPAC
034070,000202: 31,2403 07103 TC DMP
034071,000203: 31,2404 01244 ADRES MASS
034072,000204: 31,2405 07103 TC DMP # LEAVES PROPERLY SCALED FORCE IM MPAC
034073,000205: 31,2406 02005 ADRES SCALEFAC
034074,000206: 31,2407 07257 TC TPAGREE
034075,000207: 31,2410 30154 CA MPAC
034076,000208: 31,2411 00006 EXTEND
034077,000209: 31,2412 12415 BZF +3
034078,000210: 31,2413 34733 CAF POSMAX
034079,000211: 31,2414 00130 TC BUF
034080,000212: 31,2415 52156 DXCH MPAC +1
034081,000213: 31,2416 00130 TC BUF
Page 797 |
034083,000215: # CONSTANTS:-
034084,000216:
034085,000217: 31,2417 4737 FEXTRA = BIT13 # FEXT +5.13309020 E+4
034086,000218:
034087,000219: 31,2417 04143 /AF/CNST DEC .13107
034088,000220:
034089,000221: # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
End of include-file THROTTLE_CONTROL_ROUTINES.agc. Parent file is MAIN.agc