Source Code

These source-code files are part of a reconstructed copy of Luminary 69/2, the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation.

Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
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.

065170,000002:                                                                                                  ## Copyright:   Public domain.
065171,000003:                                                                                                  ## Filename:    SPS_BACK-UP_RCS_CONTROL.agc
065172,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
065173,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
065174,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
065175,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
065176,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
065177,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
065178,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
065179,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
065180,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
065181,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
065182,000014:                                                                                                  ## Reference:   pp. 1500-1502
065183,000015:                                                                                                  ## Assembler:   yaYUL
065184,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
065185,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
065186,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
065187,000019: 

Page 1500

065189,000021:                                                                                                  #  PROGRAM NAME:  SPSRCS
065190,000022: 
065191,000023:                                                                                                  #  AUTHOR:  EDGAR M. OSHIKA (AC ELECTRONICS)
065192,000024: 
065193,000025:                                                                                                  #  MODIFIED:  TO RETURN TO ALL AXES VIA Q BY P. S. WEISSMAN, OCT 7, 1968
065194,000026: 
065195,000027:                                                                                                  #  FUNCTIONAL DESCRIPTION:
065196,000028: 
065197,000029:                                                                                                  #  THIS PROGRAM CONTROLS THE FIRING OF ALL RCS JETS IN THE DOCKED CONFIGURATION ACCORDING TO THE FOLLOWING PHASE
065198,000030:                                                                                                  #  PLANE LOGIC.
065199,000031: 
065200,000032:                                                                                                  #  1.  OUTER RATE LIMIT (SPSRCS)
065201,000033: 
065202,000034:                                                                                                  #  IF MAGNITUDE OF EDOT IS GREATER THAN 1.73 DEG/SEC SET JET FIRING TIME, TJ, TO REDUCE RATE AND THEN RETURN TO
065203,000035:                                                                                                  #  CALLING PROGRAM (REQUESTING 4 JETS FOR P-AXIS).
065204,000036:                                                                                                  #  OTHERWISE, CONTINUE.
065205,000037: 
065206,000038:                                                                                                  #  2.  RATE DEAD BAND TEST ( JTONTEST)
065207,000039: 
065208,000040:                                                                                                  #  IF JETS ARE FIRING NEGATIVE AND RATE IS GREATER THAN -0.101 DEG/SEC, LEAVE JETS ON AND RETURN,
065209,000041:                                                                                                  #  IF JETS ARE FIRING POSITIVE AND RATE IS LESS THAN +0.101 DEG/SEC, LEAVE JETS ON AND RETURN, OTHERWISE CONTINUE.
065210,000042: 
065211,000043:                                                                                                  #  3.  COASTING TEST (SPSSTART)
065212,000044: 
065213,000045:                                                                                                  #  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-
065214,000046:                                                                                                  #  TIVE AND RETURN,
065215,000047:                                                                                                  #  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
065216,000048:                                                                                                  #  AND RETURN,
065217,000049:                                                                                                  #  OTHERWISE, SET JET TIME ZERO AND RETURN.
065218,000050: 
065219,000051:                                                                                                  #  THE MINIMUM PULSE WIDTH OF THIS CONTROLLER IS DETERMINED BY THE REPETITION  RATE AT WHICH THIS ROUTINE IS CALLED
065220,000052:                                                                                                  #  AND IS NOMINALLY 100 MS FOR ALL AXES IN DRIFTING FLIGHT.   DURING POWERED FLIGHT THE MINIMUM IS 100 MS FOR THE
065221,000053:                                                                                                  #  P AXIS AND 200 MS FOR THE CONTROL OF THE U AND V AXES.
065222,000054: 
065223,000055:                                                                                                  #  CALLING SEQUENCE:
065224,000056: 
065225,000057:                                                                                                  #           TC     SPSRCS          FROM Q,R AXES RCS AUTOPILOT
065226,000058:                                                                                                  #                      INHINT                  FROM P-AXIS RCS AUTOPILOT
065227,000059:                                                                                                  #                      TC      IBNKCALL
065228,000060:                                                                                                  #                      CADR    SPSRCS
065229,000061: 
065230,000062: 
065231,000063:                                                                                                  #  EXIT:
065232,000064: 
065233,000065:                                                                                                  #           TC     Q
065234,000066:                                                                                                  #  ALARM/ABORT MODE:    NONE
065235,000067: 
065236,000068:                                                                                                  #  SUBROUTINES CALLED:    NONE
065237,000069: 
065238,000070:                                                                                                  #  INPUT:      E, EDOT
065239,000071: 

Page 1501

065241,000073:                                                                                                  #             TJP, TJV, TJU           TJ MUST NOT BE NEGATIVE ZERO
065242,000074: 
065243,000075:                                                                                                  #  OUTPUT:    TJP, TJV, TJU
065244,000076:                                                                                                  #             NUMBERT = 6,            WHEN RATE LIMITING P AXIS.
065245,000077: 
065246,000078: 
065247,000079: 17,3700                                           BANK     17                                    
065248,000080: 17,2000                                           SETLOC   DAPS2                                 
065249,000081: 17,2000                                           BANK                                           
065250,000082: 
065251,000083: 17,3700                                           COUNT*   $$/DAPBU                              
065252,000084: 
065253,000085: 17,3700  E6,1525                                  EBANK=   TJU                                   
065254,000086: 17,3700           31425        SPSRCS             CA       EDOT                                  
065255,000087: 17,3701           00006                           EXTEND                                         
065256,000088: 17,3702           74766                           MP       RATELIM1                              #  OUTER RATE LIMIT = 1.73 DEG/SEC
065257,000089: 17,3703           00006                           EXTEND                                         
065258,000090: 17,3704           13717                           BZF      JTONTEST                              
065259,000091: 
065260,000092: 17,3705           54001                           TS       L                                     
065261,000093: 17,3706           36241                           CA       SIX                                   
065262,000094: 17,3707           55741                           TS       NUMBERT                               
065263,000095: 17,3710           10001                           CCS      L                                     
065264,000096: 17,3711           13753                           TCF      NEGTHRST                              
065265,000097: 17,3712           05677                           TC       CCSHOLE                               #  **TEMP ** FILL WITH A CONSTANT
065266,000098: 17,3713  17,3664               RATELIM2           =        .1AT4                                 #  = OCT 00632,  1.125 DEG/SEC
065267,000099: 17,3713           34736        POSTHRST           CA       HALF                                  
065268,000100: 
065269,000101: 17,3714           51476                           NDX      AXISCTR                               
065270,000102: 17,3715           55525                           TS       TJU                                   
065271,000103: 17,3716           00002                           TC       Q                                     
065272,000104: 
065273,000105: 17,3717           51476        JTONTEST           NDX      AXISCTR                               
065274,000106: 17,3720           11525                           CCS      TJU                                   
065275,000107: 17,3721           13725                           TCF      +4                                    
065276,000108: 17,3722           13737                           TCF      SPSSTART                              
065277,000109: 17,3723           31425                           CA       EDOT                                  
065278,000110: 17,3724           13726                           TCF      +2                                    
065279,000111: 
065280,000112: 17,3725           41425                 +4        CS       EDOT                                  
065281,000113: 17,3726           22000                           LXCH     A                                     
065282,000114: 17,3727           40111                           CS       DAPBOOLS                              #  IF DRIFTBIT = 1, USE ZERO TARGET RATE
065283,000115: 17,3730           74744                           MASK     DRIFTBIT                              #  IF DRIFTBIT = 0, USE 0.10 RATE TARGET
065284,000116: 17,3731           10000                           CCS      A                                     
065285,000117: 17,3732           34767                           CA       RATEDB1                               
065286,000118: 17,3733           60001                           AD       L                                     
065287,000119: 17,3734           00006                           EXTEND                                         
065288,000120: 17,3735           63737                           BZMF     +2                                    
065289,000121: 17,3736           13716                           TCF      POSTHRST   +3                         
065290,000122: 

Page 1502

065292,000124: 17,3737           31425        SPSSTART           CA       EDOT                                  
065293,000125: 17,3740           61750                           AD       E                                     
065294,000126: 17,3741           00006                           EXTEND                                         
065295,000127: 17,3742           71411                           MP       DKDB                                  #  PAD LOADED DEADBAND. FRESHSTART: 1.4 DEG
065296,000128: 17,3743           00006                           EXTEND                                         
065297,000129: 17,3744           13761                           BZF      TJZERO                                
065298,000130: 
065299,000131: 17,3745           00006                           EXTEND                                         
065300,000132: 17,3746           63755                           BZMF     +7                                    
065301,000133: 17,3747           31425                           CA       EDOT                                  
065302,000134: 17,3750           63664                           AD       RATELIM2                              
065303,000135: 17,3751           00006                           EXTEND                                         
065304,000136: 17,3752           63761                           BZMF     TJZERO                                
065305,000137: 17,3753           44736        NEGTHRST           CS       HALF                                  
065306,000138: 17,3754           13714                           TCF      POSTHRST   +1                         
065307,000139: 17,3755           43664                 +7        CS       RATELIM2                              
065308,000140: 17,3756           61425                           AD       EDOT                                  
065309,000141: 17,3757           00006                           EXTEND                                         
065310,000142: 17,3760           63713                           BZMF     POSTHRST                              
065311,000143: 17,3761           34755        TJZERO             CA       ZERO                                  
065312,000144: 17,3762           13714                           TCF      POSTHRST   +1                         
065313,000145: 
065314,000146: 
065315,000147: 17,3763     4766               RATELIM1           =        CALLCODE                              #  = 00032, CORRESPONDING TO 1.73 DEG/SEC
065316,000148: 17,3763     4767               RATEDB1            =        TBUILDFX                              #   = 00045, CORRESPONDS TO 0.101 DEG/SEC

End of include-file SPS_BACK-UP_RCS_CONTROL.agc.  Parent file is MAIN.agc