Source Code
These source-code files are part of a reconstructed copy of Luminary 98, a
development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 98 listing. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. |
063697,000002: ## Copyright: Public domain.
063698,000003: ## Filename: SPS_BACK-UP_RCS_CONTROL.agc
063699,000004: ## Purpose: A section of Luminary revision 98.
063700,000005: ## It is part of the reconstructed source code for the a
063701,000006: ## development version of the flight software for the Lunar
063702,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
063703,000008: ## The code has been recreated from a copy of Luminary 99
063704,000009: ## revision 001, using asterisks indicating changed lines in
063705,000010: ## the listing and Luminary Memo #85, which lists changes between
063706,000011: ## Luminary 98 and 99.
063707,000012: ## Reference: pp. 1507-1510
063708,000013: ## Assembler: yaYUL
063709,000014: ## Contact: Ron Burkey <info@sandroid.org>.
063710,000015: ## Website: www.ibiblio.org/apollo/index.html
063711,000016: ## Mod history: 2019-07-28 MAS Created from Luminary 99.
063712,000017:
Page 1507 |
063714,000019: # PROGRAM NAME: SPSRCS
063715,000020: # AUTHOR: EDGAR M. OSHIKA (AC ELECTRONICS)
063716,000021: # MODIFIED: TO RETURN TO ALL AXES VIA Q BY P. S. WEISSMAN, OCT 7, 1968
063717,000022: # MODIFIED TO IMPROVE BENDING STABILITY BY G. KALAN, FEB. 14, 1969
063718,000023:
063719,000024: # FUNCTIONAL DESCRIPTION:
063720,000025: # THIS PROGRAM CONTROLS THE FIRING OF ALL RCS JETS IN THE DOCKED CONFIGURATION ACCORDING TO THE FOLLOWING PHASE
063721,000026: # PLANE LOGIC.
063722,000027:
063723,000028: # 1. JET SENSE TEST (SPSRCS)
063724,000029: # IF JETS ARE FIRING NEGATIVELY, SET OLDSENSE NEGATIVE AND CONTINUE
063725,000030: # IF JETS ARE FIRING POSITIVELY, SET OLDSENSE POSITIVE AND CONTINUE
063726,000031: # IF JETS ARE NOT FIRING, SET OLDSENSE TO ZERO AND GO TO OUTER RATE LIMIT TEST
063727,000032:
063728,000033: # 2. RATE DEAD BAND TEST
063729,000034: # IF JETS ARE FIRING NEGATIVELY AND RATE IS GREATER THAN TARGET RATE, LEAVE
063730,000035: # JETS ON AND GO TO INHIBITION LOGIC. OTHERWISE, CONTINUE.
063731,000036: # IF JETS ARE FIRING POSITIVELY AND RATE IS LESS THAN TARGET RATE, LEAVE
063732,000037: # JETS ON AND GO TO INHIBITION LOGIC. OTHERWISE, CONTINUE.
063733,000038:
063734,000039: # 3. OUTER RATE LIMIT TEST (SPSSTART)
063735,000040: # IF MAGNITUDE OF EDOT IS GREATER THAN 1.73 DEG/SEC SET JET FIRING TIME
063736,000041: # TO REDUCE RATE AND GO TO INHIBITION LOGIC. OTHERWISE, CONTINUE.
063737,000042:
063738,000043: # 4. COAST ZONE TEST
063739,000044: # IF STATE (E,EDOT) IS BELOW LINE E + 4 X EDOT > -1.4 DEG AND EDOT IS LESS THAN 1.30 DEG/SEC SET JET TIME POSI-
063740,000045: # TIVE AND CONTINUE. OTHERWISE, SET JET FIRING TIME TO ZERO AND CONTINUE.
063741,000046: # IF STATE IS ABOVE LINE E + 4 X EDOT > +1.4 DEG AND EDOT IS GREATER THAN -1.30 DEG/SEC, SET JET TIME NEGATIVE
063742,000047: # AND CONTINUE. OTHERWISE, SET JET FIRING TIME TO ZERO AND CONTINUE.
063743,000048:
063744,000049: # 5. INHIBITION LOGIC
063745,000050: # IF OLDSENSE IS NON-ZERO:
063746,000051: # A) RETURN IF JET TIME HAS SAME SIGN AS OLDSENSE
063747,000052: # B) SET INHIBITION COUNTER* AND RETURN IF JET TIME IS ZERO
063748,000053: # C) SET INHIBITION COUNTER,* SET JET TIME TO ZERO AND RETURN IF SIGN
063749,000054: # OF JET TIME IS OPPOSITE TO THAT OF OLDSENSE
063750,000055: # IF OLDSENSE IS ZERO:
063751,000056: # A) RETURN IF INHIBITION COUNTER IS NOT POSITIVE
063752,000057: # B) SET JET TIME TO ZERO AND RETURN IF INHIBITION COUNTER IS POSITIVE
063753,000058: # *NOTE: INHIBITION COUNTERS CAN BE SET TO 4 OR 10 FOR THE P, AND UV AXES,
063754,000059: # RESPECTIVELY, IN SPSRCS. THEY ARE DECREMENTED BY ONE AT THE BEGINNING OF
Page 1508 |
063756,000061: # EACH DAP PASS.
063757,000062:
063758,000063: # THE MINIMUM PULSE WIDTH OF THIS CONTROLLER IS DETERMINED BY THE REPETITION RATE AT WHICH THIS ROUTINE IS CALLED
063759,000064: # AND IS NOMINALLY 100 MS FOR ALL AXES IN DRIFTING FLIGHT. DURING POWERED FLIGHT THE MINIMUM IS 100 MS FOR THE
063760,000065: # P AXIS AND 200 MS FOR THE CONTROL OF THE U AND V AXES.
063761,000066:
063762,000067: # CALLING SEQUENCE:
063763,000068: # INHINT
063764,000069: # TC IBNKCALL
063765,000070: # CADR SPSRCS
063766,000071:
063767,000072: # EXIT:
063768,000073: # TC Q
063769,000074:
063770,000075: # ALARM/ABORT MODE: NONE
063771,000076:
063772,000077: # SUBROUTINES CALLED: NONE
063773,000078:
063774,000079: # INPUT: E, EDOT
063775,000080: # TJP, TJV, TJU TJ MUST NOT BE NEGATIVE ZERO
063776,000081:
063777,000082: # OUTPUT: TJP, TJV, TJU
063778,000083:
063779,000084: 21,3646 BANK 21
063780,000085: 21,2000 SETLOC DAPS4
063781,000086: 21,2000 BANK
063782,000087:
063783,000088: 21,3646 COUNT* $$/DAPBU
063784,000089:
063785,000090: 21,3646 E6,1525 EBANK= TJU
063786,000091: 21,3646 00632 RATELIM2 OCT 00632 # 1.125 DEG/SEC
063787,000092: 21,3647 34736 POSTHRST CA HALF
063788,000093:
063789,000094: 21,3650 51505 NDX AXISCTR
063790,000095: 21,3651 55525 TS TJU
063791,000096: 21,3652 11745 CCS OLDSENSE
063792,000097: 21,3653 13673 TCF POSCHECK # JETS FIRING POSITIVELY
063793,000098: 21,3654 13676 TCF CTRCHECK # JETS OFF. CHECK INHIBITION CTR
063794,000099: 21,3655 51505 NEGCHECK INDEX AXISCTR # JETS FIRING NEGATIVELY
063795,000100: 21,3656 41525 CS TJU
063796,000101: 21,3657 10000 CCS A
063797,000102: 21,3660 00002 TC Q # RETURN
063798,000103: 21,3661 13663 TCF +2
063799,000104: 21,3662 13663 TCF +1 # JETS COMMANDED OFF. SET CTR AND RETURN
063800,000105: 21,3663 51505 SETCTR INDEX AXISCTR # JET FIRING REVERSAL COMMANDED. SET CTR,
063801,000106: 21,3664 33705 CA UTIME # SET JET TIME TO ZERO, AND RETURN
Page 1509 |
063803,000108: 21,3665 51505 INDEX AXISCTR
063804,000109: 21,3666 55770 TS UJETCTR
063805,000110: 21,3667 34755 ZAPTJ CA ZERO
063806,000111: 21,3670 51505 INDEX AXISCTR
063807,000112: 21,3671 55525 TS TJU
063808,000113: 21,3672 00002 TC Q
063809,000114: 21,3673 51505 POSCHECK INDEX AXISCTR
063810,000115: 21,3674 31525 CA TJU
063811,000116: 21,3675 13657 TCF NEGCHECK +2
063812,000117: 21,3676 51505 CTRCHECK INDEX AXISCTR # CHECK JET INHIBITION COUNTER
063813,000118: 21,3677 11770 CCS UJETCTR
063814,000119: 21,3700 13702 TCF +2
063815,000120: 21,3701 00002 TC Q # CTR IS NOT POSITIVE. RETURN
063816,000121: 21,3702 13667 TCF ZAPTJ # CTR IS POSITIVE. INHIBIT FIRINGS
063817,000122: 21,3703 00002 TC Q # CTR IS NOT POSITIVE. RETURN
063818,000123: 21,3704 00004 OCT 00004
063819,000124: 21,3705 00012 UTIME OCT 00012
063820,000125: 21,3706 00012 OCT 00012
063821,000126: 21,3707 E6,1745 OLDSENSE EQUALS DAPTREG1
063822,000127: 21,3707 44753 NEGFIRE CS ONE # JETS FIRING NEGATIVELY
063823,000128: 21,3710 55745 TS OLDSENSE
063824,000129: 21,3711 31427 CA EDOT
063825,000130: 21,3712 13716 TCF +4
063826,000131: 21,3713 34753 PLUSFIRE CA ONE
063827,000132: 21,3714 55745 TS OLDSENSE
063828,000133: 21,3715 41427 CS EDOT # RATE DEAD BAND TEST
063829,000134: 21,3716 22000 LXCH A
063830,000135: 21,3717 40111 CS DAPBOOLS # IF DRIFTBIT = 1, USE ZERO TARGET RATE
063831,000136: 21,3720 74744 MASK DRIFTBIT # IF DRIFTBIT = 0, USE 0.10 RATE TARGET
063832,000137: 21,3721 10000 CCS A
063833,000138: 21,3722 34767 CA RATEDB1
063834,000139: 21,3723 60001 AD L
063835,000140: 21,3724 00006 EXTEND
063836,000141: 21,3725 63735 BZMF SPSSTART
063837,000142: 21,3726 13652 TCF POSTHRST +3
063838,000143:
063839,000144: 21,3727 51505 SPSRCS INDEX AXISCTR # JET SENSE TEST
063840,000145: 21,3730 11525 CCS TJU
063841,000146: 21,3731 13713 TCF PLUSFIRE # JETS FIRING POSITIVELY
063842,000147: 21,3732 13734 TCF +2
063843,000148: 21,3733 13707 TCF NEGFIRE # JETS FIRING NEGATIVELY
063844,000149: 21,3734 55745 TS OLDSENSE # JETS OFF
063845,000150: 21,3735 31427 SPSSTART CA EDOT # OUTER RATE LIMIT TEST
063846,000151: 21,3736 00006 EXTEND
063847,000152: 21,3737 74766 MP RATELIM1
063848,000153: 21,3740 10000 CCS A
063849,000154: 21,3741 13760 TCF NEGTHRST # OUTER RATE LIMIT EXCEEDED
063850,000155: 21,3742 13744 TCF +2
063851,000156: 21,3743 13647 TCF POSTHRST # OUTER RATE LIMIT EXCEEDED
063852,000157: 21,3744 31427 CA EDOT # COAST ZONE TEST
Page 1510 |
063854,000159: 21,3745 61752 AD E
063855,000160: 21,3746 00006 EXTEND
063856,000161: 21,3747 71411 MP DKDB # PAD LOADED DEADBAND. FRESHSTART: 1.4 DEG
063857,000162: 21,3750 00006 EXTEND
063858,000163: 21,3751 13766 BZF TJZERO
063859,000164:
063860,000165: 21,3752 00006 EXTEND
063861,000166: 21,3753 63762 BZMF +7
063862,000167: 21,3754 31427 CA EDOT
063863,000168: 21,3755 63646 AD RATELIM2
063864,000169: 21,3756 00006 EXTEND
063865,000170: 21,3757 63766 BZMF TJZERO
063866,000171: 21,3760 44736 NEGTHRST CS HALF
063867,000172: 21,3761 13650 TCF POSTHRST +1
063868,000173: 21,3762 43646 +7 CS RATELIM2
063869,000174: 21,3763 61427 AD EDOT
063870,000175: 21,3764 00006 EXTEND
063871,000176: 21,3765 63647 BZMF POSTHRST
063872,000177: 21,3766 34755 TJZERO CA ZERO
063873,000178: 21,3767 13650 TCF POSTHRST +1
063874,000179:
063875,000180: 21,3770 4766 RATELIM1 = CALLCODE # = 00032, CORRESPONDING TO 1.73 DEG/SEC
063876,000181: 21,3770 4767 RATEDB1 = TBUILDFX # = 00045, CORRESPONDS TO 0.101 DEG/SEC
063877,000182:
End of include-file SPS_BACK-UP_RCS_CONTROL.agc. Parent file is MAIN.agc