Source Code

This is an attempt to recreate Luminary 99 Rev 2, otherwise known as LUM99R2, from Luminary 99 Rev 1 and ephemeris data from Luminary 116. The differences are confined to the last 10-12 lines of the CONTROLLED CONSTANTS. Luminary 99 Rev 1 source-code was transcribed from a printout in the MIT Museum, while Luminary 116 source code was transcribed from a printout belonging to Don Eyles. AGC developer James Kernan, the "rope mother" for the Apollo 11 Lunar Module's AGC, explains as follows: "At the last minute, Dan Lickly, our chief engineer, appeared with ephemerides updates and it took two tries to get it right. The result was that we created Lum99 Revision 1 and Lum99 Revision 2." It is suspected that the former is what's in the MIT Museum, and the latter is what we are trying to recreate here. As for which revision actually flew in Apollo 11, all of the other available surviving evidence points to Rev 1 rather than to Rev 2, so we're just not sure!

064049,000002:                                                                                                  ## Copyright:   Public domain.
064050,000003:                                                                                                  ## Filename:    SPS_BACK-UP_RCS_CONTROL.agc
064051,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
064052,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
064053,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
064054,000007:                                                                                                  ## Assembler:   yaYUL
064055,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
064056,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
064057,000010:                                                                                                  ## Pages:       1507-1510
064058,000011:                                                                                                  ## Mod history: 2009-05-27 RSB  Adapted from the corresponding 
064059,000012:                                                                                                  ##                              Luminary131 file, using page 
064060,000013:                                                                                                  ##                              images from Luminary 1A.
064061,000014:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
064062,000015:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
064063,000016:                                                                                                  ##                              and corrected the errors found.
064064,000017:                                                                                                  ##              2017-03-03 RSB  Snapshot of Luminary 99 Rev 1. 
064065,000018: 

Page 1507

064067,000020:                                                                                                  #  PROGRAM NAME:         SPSRCS
064068,000021:                                                                                                  #  AUTHOR:               EDGAR M. OSHIKA (AC ELECTRONICS)
064069,000022:                                                                                                  #  MODIFIED:             TO RETURN TO ALL AXES VIA Q BY P. S. WEISSMAN, OCT 7, 1968
064070,000023:                                                                                                  #  MODIFIED TO IMPROVE BENDING STABILITY BY G. KALAN, FEB. 14, 1969
064071,000024: 
064072,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION:
064073,000026:                                                                                                  #        THIS PROGRAM CONTROLS THE FIRING OF ALL RCS JETS IN THE DOCKED CONFIGURATION ACCORDING TO THE FOLLOWING PHASE
064074,000027:                                                                                                  #        PLANE LOGIC.
064075,000028: 
064076,000029:                                                                                                  #        1. JET SENSE TEST (SPSRCS)
064077,000030:                                                                                                  #                IF JETS ARE FIRING NEGATIVELY, SET OLDSENSE NEGATIVE AND CONTINUE
064078,000031:                                                                                                  #                IF JETS ARE FIRING POSITIVELY, SET OLDSENSE POSITIVE AND CONTINUE
064079,000032:                                                                                                  #                IF JETS ARE NOT FIRING, SET OLDSENSE TO ZERO AND GO TO OUTER RATE LIMIT TEST
064080,000033: 
064081,000034:                                                                                                  #        2. RATE DEAD BAND TEST
064082,000035:                                                                                                  #                IF JETS ARE FIRING NEGATIVELY AND RATE IS GREATER THAN TARGET RATE, LEAVE
064083,000036:                                                                                                  #                        JETS ON AND GO TO INHIBITION LOGIC.  OTHERWISE, CONTINUE.
064084,000037:                                                                                                  #                IF JETS ARE FIRING POSITIVELY AND RATE IS   LESS  THAN TARGET RATE, LEAVE
064085,000038:                                                                                                  #                        JETS ON AND GO TO INHIBITION LOGIC.  OTHERWISE, CONTINUE.
064086,000039: 
064087,000040:                                                                                                  #        3. OUTER RATE LIMIT TEST (SPSSTART)
064088,000041:                                                                                                  #                IF MAGNITUDE OF EDOT IS GREATER THAN 1.73 DEG/SEC SET JET FIRING TIME
064089,000042:                                                                                                  #                        TO REDUCE RATE AND GO TO INHIBITION LOGIC.  OTHERWISE, CONTINUE.
064090,000043: 
064091,000044:                                                                                                  #        4. COAST ZONE TEST
064092,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-
064093,000046:                                                                                                  #                        TIVE AND CONTINUE.  OTHERWISE, SET JET FIRING TIME TO ZERO AND CONTINUE.
064094,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
064095,000048:                                                                                                  #                        AND CONTINUE.  OTHERWISE, SET JET FIRING TIME TO ZERO AND CONTINUE.
064096,000049: 
064097,000050:                                                                                                  #        5. INHIBITION LOGIC
064098,000051:                                                                                                  #                IF OLDSENSE IS NON-ZERO:
064099,000052:                                                                                                  #                        A) RETURN IF JET TIME HAS SAME SIGN AS OLDSENSE
064100,000053:                                                                                                  #                        B) SET INHIBITION COUNTER* AND RETURN IF JET TIME IS ZERO
064101,000054:                                                                                                  #                        C) SET INHIBITION COUNTER,* SET JET TIME TO ZERO AND RETURN IF SIGN
064102,000055:                                                                                                  #                           OF JET TIME IS OPPOSITE TO THAT OF OLDSENSE
064103,000056:                                                                                                  #                IF OLDSENSE IS ZERO:
064104,000057:                                                                                                  #                        A) RETURN IF INHIBITION COUNTER IS NOT POSITIVE
064105,000058:                                                                                                  #                        B) SET JET TIME TO ZERO AND RETURN IF INHIBITION COUNTER IS POSITIVE
064106,000059:                                                                                                  #                *NOTE: INHIBITION COUNTERS CAN BE SET TO 4 OR 10 FOR THE P, AND UV AXES,
064107,000060:                                                                                                  #                RESPECTIVELY, IN SPSRCS.  THEY ARE DECREMENTED BY ONE AT THE BEGINNING OF

Page 1508

064109,000062:                                                                                                  #                EACH DAP PASS.
064110,000063: 
064111,000064:                                                                                                  #        THE MINIMUM PULSE WIDTH OF THIS CONTROLLER IS DETERMINED BY THE REPETITION RATE AT WHICH THIS ROUTINE IS CALLED
064112,000065:                                                                                                  #        AND IS NOMINALLY 100 MS FOR ALL AXES IN DRIFTING FLIGHT.  DURING POWERED FLIGHT THE MINIMUM IS 100 MS FOR THE
064113,000066:                                                                                                  #        P AXIS AND 200 MS FOR THE CONTROL OF THE U AND V AXES.
064114,000067: 
064115,000068:                                                                                                  #  CALLING SEQUENCE:
064116,000069:                                                                                                  #                INHINT
064117,000070:                                                                                                  #                TC      IBNKCALL
064118,000071:                                                                                                  #                CADR    SPSRCS
064119,000072: 
064120,000073:                                                                                                  #  EXIT:
064121,000074:                                                                                                  #                TC      Q
064122,000075: 
064123,000076:                                                                                                  #  ALARM/ABORT MODE:     NONE
064124,000077: 
064125,000078:                                                                                                  #  SUBROUTINES CALLED:   NONE
064126,000079: 
064127,000080:                                                                                                  #  INPUT:                E, EDOT
064128,000081:                                                                                                  #                        TJP, TJV, TJU           TJ MUST NOT BE NEGATIVE ZERO
064129,000082: 
064130,000083:                                                                                                  #  OUTPUT:               TJP, TJV, TJU
064131,000084: 
064132,000085: 21,3646                                           BANK     21                                    
064133,000086: 21,2000                                           SETLOC   DAPS4                                 
064134,000087: 21,2000                                           BANK                                           
064135,000088: 
064136,000089: 21,3646                                           COUNT*   $$/DAPBU                              
064137,000090: 
064138,000091: 21,3646  E6,1525                                  EBANK=   TJU                                   
064139,000092: 21,3646           00632        RATELIM2           OCT      00632                                 #  1.125 DEG/SEC
064140,000093: 21,3647           34736        POSTHRST           CA       HALF                                  
064141,000094: 
064142,000095: 21,3650           51505                           NDX      AXISCTR                               
064143,000096: 21,3651           55525                           TS       TJU                                   
064144,000097: 21,3652           11745                           CCS      OLDSENSE                              
064145,000098: 21,3653           13673                           TCF      POSCHECK                              #  JETS FIRING POSITIVELY
064146,000099: 21,3654           13676                           TCF      CTRCHECK                              #  JETS OFF.  CHECK INHIBITION CTR
064147,000100: 21,3655           51505        NEGCHECK           INDEX    AXISCTR                               #  JETS FIRING NEGATIVELY
064148,000101: 21,3656           41525                           CS       TJU                                   
064149,000102: 21,3657           10000                           CCS      A                                     
064150,000103: 21,3660           00002                           TC       Q                                     #  RETURN
064151,000104: 21,3661           13663                           TCF      +2                                    
064152,000105: 21,3662           13663                           TCF      +1                                    #  JETS COMMANDED OFF.  SET CTR AND RETURN
064153,000106: 21,3663           51505        SETCTR             INDEX    AXISCTR                               #  JET FIRING REVERSAL COMMANDED.  SET CTR,
064154,000107: 21,3664           33705                           CA       UTIME                                 #  SET JET TIME TO ZERO, AND RETURN

Page 1509

064156,000109: 21,3665           51505                           INDEX    AXISCTR                               
064157,000110: 21,3666           55770                           TS       UJETCTR                               
064158,000111: 21,3667           34755        ZAPTJ              CA       ZERO                                  
064159,000112: 21,3670           51505                           INDEX    AXISCTR                               
064160,000113: 21,3671           55525                           TS       TJU                                   
064161,000114: 21,3672           00002                           TC       Q                                     
064162,000115: 21,3673           51505        POSCHECK           INDEX    AXISCTR                               
064163,000116: 21,3674           31525                           CA       TJU                                   
064164,000117: 21,3675           13657                           TCF      NEGCHECK   +2                         
064165,000118: 21,3676           51505        CTRCHECK           INDEX    AXISCTR                               #  CHECK JET INHIBITION COUNTER
064166,000119: 21,3677           11770                           CCS      UJETCTR                               
064167,000120: 21,3700           13702                           TCF      +2                                    
064168,000121: 21,3701           00002                           TC       Q                                     #  CTR IS NOT POSITIVE.  RETURN
064169,000122: 21,3702           13667                           TCF      ZAPTJ                                 #  CTR IS POSITIVE.  INHIBIT FIRINGS
064170,000123: 21,3703           00002                           TC       Q                                     #  CTR IS NOT POSITIVE.  RETURN
064171,000124: 21,3704           00004                           OCT      00004                                 
064172,000125: 21,3705           00012        UTIME              OCT      00012                                 
064173,000126: 21,3706           00012                           OCT      00012                                 
064174,000127: 21,3707  E6,1745               OLDSENSE           EQUALS   DAPTREG1                              
064175,000128: 21,3707           44753        NEGFIRE            CS       ONE                                   #  JETS FIRING NEGATIVELY
064176,000129: 21,3710           55745                           TS       OLDSENSE                              
064177,000130: 21,3711           31427                           CA       EDOT                                  
064178,000131: 21,3712           13716                           TCF      +4                                    
064179,000132: 21,3713           34753        PLUSFIRE           CA       ONE                                   
064180,000133: 21,3714           55745                           TS       OLDSENSE                              
064181,000134: 21,3715           41427                           CS       EDOT                                  #  RATE DEAD BAND TEST
064182,000135: 21,3716           22000                           LXCH     A                                     
064183,000136: 21,3717           40111                           CS       DAPBOOLS                              #  IF DRIFTBIT = 1, USE ZERO TARGET RATE
064184,000137: 21,3720           74744                           MASK     DRIFTBIT                              #  IF DRIFTBIT = 0, USE 0.10 RATE TARGET
064185,000138: 21,3721           10000                           CCS      A                                     
064186,000139: 21,3722           34767                           CA       RATEDB1                               
064187,000140: 21,3723           60001                           AD       L                                     
064188,000141: 21,3724           00006                           EXTEND                                         
064189,000142: 21,3725           63735                           BZMF     SPSSTART                              
064190,000143: 21,3726           13652                           TCF      POSTHRST   +3                         
064191,000144: 
064192,000145: 21,3727           51505        SPSRCS             INDEX    AXISCTR                               #  JET SENSE TEST
064193,000146: 21,3730           11525                           CCS      TJU                                   
064194,000147: 21,3731           13713                           TCF      PLUSFIRE                              #  JETS FIRING POSITIVELY
064195,000148: 21,3732           13734                           TCF      +2                                    
064196,000149: 21,3733           13707                           TCF      NEGFIRE                               #  JETS FIRING NEGATIVELY
064197,000150: 21,3734           55745                           TS       OLDSENSE                              #  JETS OFF
064198,000151: 21,3735           31427        SPSSTART           CA       EDOT                                  #  OUTER RATE LIMIT TEST
064199,000152: 21,3736           00006                           EXTEND                                         
064200,000153: 21,3737           74766                           MP       RATELIM1                              
064201,000154: 21,3740           10000                           CCS      A                                     
064202,000155: 21,3741           13760                           TCF      NEGTHRST                              #  OUTER RATE LIMIT EXCEEDED
064203,000156: 21,3742           13744                           TCF      +2                                    
064204,000157: 21,3743           13647                           TCF      POSTHRST                              #  OUTER RATE LIMIT EXCEEDED
064205,000158: 21,3744           31427                           CA       EDOT                                  #  COAST ZONE TEST

Page 1510

064207,000160: 21,3745           61752                           AD       E                                     
064208,000161: 21,3746           00006                           EXTEND                                         
064209,000162: 21,3747           71411                           MP       DKDB                                  #  PAD LOADED DEADBAND.  FRESHSTART: 1.4 DEG
064210,000163: 21,3750           00006                           EXTEND                                         
064211,000164: 21,3751           13766                           BZF      TJZERO                                
064212,000165: 
064213,000166: 21,3752           00006                           EXTEND                                         
064214,000167: 21,3753           63762                           BZMF     +7                                    
064215,000168: 21,3754           31427                           CA       EDOT                                  
064216,000169: 21,3755           63646                           AD       RATELIM2                              
064217,000170: 21,3756           00006                           EXTEND                                         
064218,000171: 21,3757           63766                           BZMF     TJZERO                                
064219,000172: 21,3760           44736        NEGTHRST           CS       HALF                                  
064220,000173: 21,3761           13650                           TCF      POSTHRST   +1                         
064221,000174: 21,3762           43646                 +7        CS       RATELIM2                              
064222,000175: 21,3763           61427                           AD       EDOT                                  
064223,000176: 21,3764           00006                           EXTEND                                         
064224,000177: 21,3765           63647                           BZMF     POSTHRST                              
064225,000178: 21,3766           34755        TJZERO             CA       ZERO                                  
064226,000179: 21,3767           13650                           TCF      POSTHRST   +1                         
064227,000180: 
064228,000181: 21,3770     4766               RATELIM1           =        CALLCODE                              #  = 00032, CORRESPONDING TO 1.73 DEG/SEC
064229,000182: 21,3770     4767               RATEDB1            =        TBUILDFX                              #  = 00045, CORRESPONDS TO 0.101 DEG/SEC
064230,000183: 

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