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!

059387,000002:                                                                                                  ## Copyright:   Public domain.
059388,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
059389,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
059390,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
059391,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
059392,000007:                                                                                                  ## Assembler:   yaYUL
059393,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059394,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
059395,000010:                                                                                                  ## Pages:       1410-1420
059396,000011:                                                                                                  ## Mod history: 2009-05-10 SN  (Sergio Navarro).  Started adapting
059397,000012:                                                                                                  ##                              from the Luminary131/ file of the same
059398,000013:                                                                                                  ##                              name, using Luminary099 page images.
059399,000014:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
059400,000015:                                                                                                  ##                              and corrected the errors found.
059401,000016:                                                                                                  ##              2017-01-28 RSB  Comment-text fixes identified for Luminary 69.
059402,000017:                                                                                                  ##              2017-03-03 RSB  Snapshot of Luminary 99 Rev 1. 
059403,000018:                                                                                                  ##              2017-03-15 RSB  5-way comment-text proofing using Luminary 
059404,000019:                                                                                                  ##                              69/99/116/131/210 ... no problems found.
059405,000020: 

Page 1410

059407,000022:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.  THE DAPIDLER PROGRAM IS DONE 10 TIMES
059408,000023:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
059409,000024:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
059410,000025: 
059411,000026: 16,2000                                           BANK     16                                    
059412,000027: 16,2000                                           SETLOC   DAPS1                                 
059413,000028: 16,2000                                           BANK                                           
059414,000029: 
059415,000030: 16,2000  E6,1537                                  EBANK=   AOSQ                                  
059416,000031: 
059417,000032: 16,2000                                           COUNT*   $$/DAPID                              
059418,000033: 
059419,000034: 16,2000           00006        CHEKBITS           EXTEND                                         
059420,000035: 16,2001           00031                           READ     CHAN31                                #  IF BOTH BIT13 AND BIT14 ARE ONE, THEN
059421,000036: 16,2002           40000                           COM                                            #  THE MODE SELECT SWITCH IS IN THE OFF
059422,000037: 16,2003           74355                           MASK     BIT13-14                              #  POSITION, AND SO THE DAP SHOULD BE OFF,
059423,000038: 16,2004           00006                           EXTEND                                         #  WITH NO ATTITUDE ERROR DISPLAY.
059424,000039: 16,2005           12157                           BZF      MOREIDLE                              
059425,000040: 
059426,000041: 16,2006           41303                           CS       IMODES33                              
059427,000042: 16,2007           74746                           MASK     BIT6                                  
059428,000043: 16,2010           10000                           CCS      A                                     
059429,000044: 16,2011           12206                           TCF      JUMPDSP                               
059430,000045: 16,2012           41273                           CS       RCSFLAGS                              #  IMU NOT USABLE.  SET UP INITIALIZATION
059431,000046: 16,2013           74751                           MASK     BIT3                                  #  FLAG FOR ATT ERROR DISPLAY ROUTINE.
059432,000047: 16,2014           27273                           ADS      RCSFLAGS                              
059433,000048: 16,2015           12163                           TCF      SHUTDOWN                              
059434,000049: 
059435,000050: 16,2016           34742        CHEKMORE           CAF      BIT10                                 #  BIT 10 OF 30 IS PGNCS CONTROL OF S/C
059436,000051: 16,2017           00006                           EXTEND                                         
059437,000052: 16,2020           02030                           RAND     CHAN30                                #  BITS IN 30 ARE INVERTED
059438,000053: 16,2021           10000                           CCS      A                                     
059439,000054: 16,2022           12157                           TCF      MOREIDLE                              
059440,000055: 
059441,000056: 16,2023           00002                           RETURN                                         
059442,000057: 

Page 1411

059444,000059:                                                                                                  #  DAPIDLER ENTRY.
059445,000060: 
059446,000061: 16,2024           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
059447,000062: 16,2025           00006                           EXTEND                                         
059448,000063: 16,2026           22012                           QXCH     QRUPT                                 
059449,000064: 
059450,000065: 16,2027           31273                           CA       RCSFLAGS                              
059451,000066: 16,2030           74737                           MASK     BIT13                                 
059452,000067: 16,2031           10000                           CCS      A                                     #  CHECK IF 1/ACCJOB HAS BEEN SET UP SINCE
059453,000068: 16,2032           12041                           TCF      CHECKUP                               #  THE LAST FRESH START OR RESTART.
059454,000069: 16,2033           34737                           CA       BIT13                                 
059455,000070: 16,2034           27273                           ADS      RCSFLAGS                              #  BIT 13 IS 1.
059456,000071: 16,2035           37715                           CAF      PRIO27                                
059457,000072: 16,2036           05072                           TC       NOVAC                                 #  SET UP JOB TO DO A LITTLE INITIALIZATION
059458,000073: 16,2037  E6,1537                                  EBANK=   AOSQ                                  #        AND EXECUTE 1/ACCS.
059459,000074: 16,2037           02447 40106                     2CADR    1/ACCSET                              #  (WILL BRANCH TO MOREIDLE ON ACCSOKAY)
059460,000075: 
059461,000076: 16,2041           02000        CHECKUP            TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON AND
059462,000077:                                                                                                  #        DO ERROR DISPLAY.
059463,000078: 
059464,000079: 16,2042           30111                           CAE      DAPBOOLS                              #  IF 1/ACCS HAS NOT BEEN COMPLETED, IDLE.
059465,000080: 16,2043           74751                           MASK     ACCSOKAY                              #        NOTE:   ONLY FRESH START AND RESTART
059466,000081: 16,2044           00006                           EXTEND                                         #                KNOCK THIS BIT DOWN.
059467,000082: 16,2045           12157                           BZF      MOREIDLE                              
059468,000083: 
059469,000084: 16,2046           04674        STARTDAP           TC       IBNKCALL                              #  ZERO ATTITUDE ERROR AND DESIRED RATES.
059470,000085: 16,2047           40153                           FCADR    ZATTEROR                              
059471,000086: 16,2050           34755                           CAF      ZERO                                  #  ********** INITIALIZE: **********
059472,000087: 16,2051           55524                           TS       TJP                                   
059473,000088: 16,2052           55525                           TS       TJU                                   
059474,000089: 16,2053           55526                           TS       TJV                                   
059475,000090: 16,2054           55421                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
059476,000091: 16,2055           55422                           TS       OMEGAQ                                
059477,000092: 16,2056           55423                           TS       OMEGAR                                
059478,000093: 16,2057           55430                           TS       TRAPEDP                               
059479,000094: 16,2060           55431                           TS       TRAPEDQ                               
059480,000095: 16,2061           55432                           TS       TRAPEDR                               
059481,000096: 16,2062           55537                           TS       AOSQ                                  #  OFFSET ACCELERATION ESTIMATES.
059482,000097: 16,2063           55540                           TS       AOSQ       +1                         
059483,000098: 16,2064           55541                           TS       AOSR                                  
059484,000099: 16,2065           55542                           TS       AOSR       +1                         
059485,000100: 16,2066           55424                           TS       ALPHAQ                                #  COPIES OF OFFSET ESTIMATES FOR DOWNLIST.
059486,000101: 16,2067           55425                           TS       ALPHAR                                
059487,000102: 16,2070           55501                           TS       NEGUQ                                 
059488,000103: 16,2071           55503                           TS       NEGUR                                 
059489,000104: 16,2072           55545                           TS       AOSQTERM                              #  QRAXIS RATE DERIVATION TERMS AND KALMAN
059490,000105: 16,2073           55546                           TS       AOSRTERM                              #  FILTER INITIALIZATION TERMS.
059491,000106: 16,2074           55510                           TS       QACCDOT                               #  DESCENT ACCELERATION DERIVATIVE EST.
059492,000107: 16,2075           55512                           TS       RACCDOT                               

Page 1412

059494,000109: 16,2076           55502                           TS       ALLOWGTS                              #  AOSTASK FLAG FOR QRAXIS RCS CONTROL USE.
059495,000110: 16,2077           55631                           TS       COTROLER                              #  DO TRYGTS ON FIRST PASS (WILL GO TO RCS)
059496,000111: 16,2100           55633                           TS       INGTS                                 #  RECOGNIZE FIRST GTS PASS AS SUCH.
059497,000112: 16,2101           55632                           TS       QGIMTIMR                              #  STOP GIMBAL DRIVES.  (PROBABLY WOULD BE
059498,000113: 16,2102           55634                           TS       RGIMTIMR                              #        GOOD ENOUGH JUST TO INACTIVATE TIMERS)
059499,000114: 16,2103           55460                           TS       OLDPMIN                               #  MINIMUM IMPULSE MODE ERASABLES
059500,000115: 16,2104           55461                           TS       OLDQRMIN                              
059501,000116: 16,2105           55767                           TS       PJETCTR                               #  INITIALIZE DOCKED JET INHIBITION
059502,000117: 16,2106           55770                           TS       UJETCTR                               #  COUNTERS
059503,000118: 16,2107           55771                           TS       VJETCTR                               
059504,000119: 16,2110     4747               CALLGMBL           EQUALS   BIT5                                  #  RCSFLAGS INITIALIZATION.
059505,000120: 16,2110           42202                           CS       MANFLAG                               
059506,000121: 16,2111           71273                           MASK     RCSFLAGS                              #  NEGUQ(R) HAVE BEEN GENERATED.
059507,000122: 16,2112           55273                           TS       RCSFLAGS                              
059508,000123: 
059509,000124:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
059510,000125: 
059511,000126: 16,2113           00006                           EXTEND                                         
059512,000127: 16,2114           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
059513,000128: 16,2115           53441                           DXCH     OLDXFORP                              
059514,000129: 16,2116           30034                           CA       CDUZ                                  
059515,000130: 16,2117           55442                           TS       OLDZFORQ                              
059516,000131: 16,2120           41273                           CS       RCSFLAGS                              
059517,000132: 16,2121           74740                           MASK     BIT12                                 
059518,000133: 16,2122           27273                           ADS      RCSFLAGS                              #  BIT 12 SET TO 1.
059519,000134: 16,2123           34751                           CA       FOUR                                  
059520,000135: 16,2124           55535                           TS       SKIPU                                 
059521,000136: 16,2125           55536                           TS       SKIPV                                 
059522,000137: 16,2126           34733                           CA       POSMAX                                
059523,000138: 16,2127           54031                           TS       TIME6                                 
059524,000139: 16,2130           55466                           TS       T6NEXT                                
059525,000140: 16,2131           55470                           TS       T6FURTHA                              
059526,000141: 16,2132           34755                           CA       ZERO                                  
059527,000142: 16,2133           55467                           TS       T6NEXT     +1                         
059528,000143: 16,2134           55471                           TS       T6FURTHA   +1                         
059529,000144: 16,2135           55465                           TS       NXT6ADR                               
059530,000145: 16,2136           55472                           TS       NEXTP                                 
059531,000146: 16,2137           55473                           TS       NEXTU                                 
059532,000147: 16,2140           55474                           TS       NEXTV                                 
059533,000148: 16,2141           44363                           CS       TEN                                   
059534,000149: 16,2142           55757                           TS       DAPZRUPT                              #  JASK NOT IN PROGRESS, INITIALIZE NEG.
059535,000150: 16,2143           34752                           CA       TWO                                   
059536,000151: 16,2144           55433                           TS       NPTRAPS                               
059537,000152: 16,2145           55434                           TS       NQTRAPS                               
059538,000153: 16,2146           55435                           TS       NRTRAPS                               
059539,000154: 16,2147           00006                           EXTEND                                         
059540,000155: 16,2150           32205                           DCA      PAXADIDL                              
059541,000156: 16,2151           53275                           DXCH     T5ADR                                 
059542,000157: 16,2152           37727        SETTIME5           CAF      MS100                                 
059543,000158: 16,2153           54030                           TS       TIME5                                 

Page 1413

059545,000160: 16,2154           15270                           TCF      RESUME                                
059546,000161: 16,2155  E6,1537                                  EBANK=   AOSQ                                  
059547,000162: 16,2155           02024 34106  IDLERADR           2CADR    DAPIDLER                              
059548,000163: 
059549,000164: 16,2157           04674        MOREIDLE           TC       IBNKCALL                              #  CALCULATE Q,R-AXES ATTITUDE ERRORS.
059550,000165: 16,2160           36626                           CADR     QERRCALC                              
059551,000166: 
059552,000167: 16,2161           04674                           TC       IBNKCALL                              
059553,000168: 16,2162           35446                           CADR     CALCPERR                              #  CALCULATE P AXIS ATTITUDE ERRORS.
059554,000169: 
059555,000170: 16,2163           00006        SHUTDOWN           EXTEND                                         
059556,000171: 16,2164           32156                           DCA      IDLERADR                              
059557,000172: 16,2165           53275                           DXCH     T5ADR                                 
059558,000173: 
059559,000174: 16,2166           34755                           CAF      ZERO                                  #  KILL ANY POSSIBLE JET REQUESTS
059560,000175: 16,2167           55472                           TS       NEXTP                                 
059561,000176: 16,2170           55473                           TS       NEXTU                                 
059562,000177: 16,2171           55474                           TS       NEXTV                                 
059563,000178: 16,2172           00006                           EXTEND                                         #  COMMAND JETS OFF.
059564,000179: 16,2173           01005                           WRITE    CHAN5                                 
059565,000180: 16,2174           00006                           EXTEND                                         
059566,000181: 16,2175           01006                           WRITE    CHAN6                                 
059567,000182: 16,2176           42203                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
059568,000183: 16,2177           00006                           EXTEND                                         
059569,000184: 16,2200           03012                           WAND     CHAN12                                
059570,000185: 16,2201           12152                           TCF      SETTIME5                              #  RETURN IN 100 MSEC.
059571,000186: 
059572,000187: 16,2202           03021        MANFLAG            OCT      03021                                 
059573,000188: 16,2203           07400        BGIM23             OCTAL    07400                                 
059574,000189: 16,2204  E6,1421                                  EBANK=   OMEGAP                                
059575,000190: 16,2204           02213 34106  PAXADIDL           2CADR    PAXIS                                 
059576,000191: 
059577,000192: 16,2206     7727               MS100              =        OCT37766                              
059578,000193: 16,2206     0061               COSMG              =        ITEMP1                                
059579,000194: 16,2206           00006        JUMPDSP            EXTEND                                         #  TRANSFER TO BANK 20
059580,000195: 16,2207           32212                           DCA      DSPCADR                               #  FOR ATTITUDE ERROR DISPLAYS
059581,000196: 16,2210           52006                           DTCB                                           
059582,000197: 
059583,000198: 16,2211  E6,1761                                  EBANK=   AK                                    
059584,000199: 16,2211           02226 40106  DSPCADR            2CADR    ALTDSPLY                              
059585,000200: 

Page 1414

059587,000202: 20,2226                                           BANK     20                                    
059588,000203: 20,2000                                           SETLOC   DAPS3                                 
059589,000204: 20,2000                                           BANK                                           
059590,000205: 20,2226                                           COUNT*   $$/NEEDL                              
059591,000206: 
059592,000207:                                                                                                  #  PROGRAM:      ALTDSPLY
059593,000208:                                                                                                  #  MOD 0.        6 DEC 1967
059594,000209:                                                                                                  #  AUTHOR:       CRAIG WORK, DON KEENE, MIT IL
059595,000210:                                                                                                  #  MOD 3 BY DON KEENE AUG 1, 1968 MOVED PROGRAM TO BANK 20
059596,000211: 
059597,000212:                                                                                                  #  PROGRAM DESCRIPTION:
059598,000213:                                                                                                  #        ALTDSPLY REVERSES THE DSPLYALT BIT OF RCSFLAGS EACH TIME IT IS CALLED, WHICH IS PRESUMABLY EVERY 100 MS.
059599,000214:                                                                                                  #        IF THE REVERSED BIT IS ONE, NEEDLER IS CALLED TO DISPLAY ATTITUDE ERRORS.  IF THE BIT IS ZERO, THE ATTITUDE ERR-
059600,000215:                                                                                                  #        ORS ARE CALCULATED AS 1) DAP FOLLOWING ERRORS, IF NEEDLFLG = 0, AND 2) TOTAL ATTITUDE ERRORS FOR NEEDLFLG = 1.
059601,000216: 
059602,000217: 
059603,000218:                                                                                                  #  WARNING:      ALTDSPLY MAY ONLY BE CALLED WITH INTERRUPT INHIBITED.
059604,000219: 
059605,000220:                                                                                                  #  WARNING:      EBANK MUST BE SET TO 6 WHEN USING THIS ROUTINE.
059606,000221: 
059607,000222:                                                                                                  #  INPUT:        RCSFLAGS AND    1) IF NEEDLFLG = 0, INPUT PERROR, QERROR, RERROR.
059608,000223:                                                                                                  #                                2) IF NEEDLFLG = 1, INPUT CPHI,CTHETA,CPSI,CDUX,CDUY,CDUZ,M11,M21,M32,M22,M32.  (GPMATRIX)
059609,000224: 
059610,000225: 
059611,000226:                                                                                                  #  OUTPUTS:      RCSFLAGS WITH DSPLYALT REVERSED, AK, AK1, AK2, + NEEDLER OUTPUTS.
059612,000227: 
059613,000228:                                                                                                  #  ENTRY:        TCF     ALTDSPLY
059614,000229: 
059615,000230:                                                                                                  #  EXIT:         TCF     CHEKMORE
059616,000231: 
059617,000232:                                                                                                  #  ALARM OR ABORT EXITS: NONE
059618,000233: 
059619,000234:                                                                                                  #  SUBPROGRAMS CALLED:  NEEDLER, OVERSUB2
059620,000235: 
059621,000236:                                                                                                  #  DEBRIS:       A, L, AND NEEDLER DEBRIS.
059622,000237: 
059623,000238: 20,2226           31273        ALTDSPLY           CA       RCSFLAGS                              #  INVERT THE DISPLAY ALTERNATION BIT.
059624,000239: 20,2227           54001                           TS       L                                     
059625,000240: 20,2230           34750                           CA       DSPLYALT                              
059626,000241: 20,2231           00006                           EXTEND                                         
059627,000242: 20,2232           06001                           RXOR     LCHAN                                 
059628,000243: 20,2233           55273                           TS       RCSFLAGS                              
059629,000244: 
059630,000245: 20,2234           74750                           MASK     DSPLYALT                              
059631,000246: 20,2235           10000                           CCS      A                                     #  IS ALTERNATION FLAG ZERO?
059632,000247: 20,2236           12322                           TCF      NEEDLER                               
059633,000248: 
059634,000249: 20,2237           30074                           CAE      FLAGWRD0                              #  NEEDLFLG WILL INDICATE TOTAL OR DAP AT-

Page 1415

059636,000251: 20,2240           74750                           MASK     NEEDLBIT                              #  TITUDE ERROR DISPLAY REQUEST.
059637,000252: 20,2241           10000                           CCS      A                                     
059638,000253: 20,2242           12252                           TCF      DSPLYTOT                              #  TOTAL ERROR IS NEEDED IN AK, AK +1, AK +2
059639,000254: 
059640,000255: 20,2243           41450                           CS       QERROR                                #  YES.  DISPLAY ATT ERRORS ON THE ,-BALL.
059641,000256: 20,2244           55762                           TS       AK         +1                         #  ERROR COMPLEMENTS ARE INPUT TO NEEDLER.
059642,000257: 20,2245           41452                           CS       RERROR                                
059643,000258: 20,2246           55763                           TS       AK         +2                         
059644,000259: 20,2247           41464                           CS       PERROR                                
059645,000260: 20,2250           57761                           XCH      AK                                    
059646,000261: 
059647,000262: 20,2251           12442                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
059648,000263: 
059649,000264:                                                                                                  #  CALCULATE GIMBAL ANGLE TOTAL ERRORS, RESOLVE INTO PILOT AXES, STORE TOTAL ERRORS FOR NEEDLER.  Q-AXIS FIRST.
059650,000265: 
059651,000266: 20,2252           00006        DSPLYTOT           EXTEND                                         
059652,000267: 20,2253           22061                           QXCH     ITEMP1                                #  SAVE Q FOR CHEKBITS RETURN.
059653,000268: 
059654,000269: 20,2254           30322                           CA       CTHETA                                #  DESIRED ATTITUDE, Y-AXIS, 2'S COMP.
059655,000270: 20,2255           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
059656,000271: 20,2256           20033                           MSU      CDUY                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
059657,000272: 20,2257           55761                           TS       AK                                    #  SAVE FOR R-ERROR CALCULATION.
059658,000273: 20,2260           00006                           EXTEND                                         
059659,000274: 20,2261           71415                           MP       M21                                   #  (CHTETA-CDUY)*M21 SCALED AT PI RADIANS.
059660,000275: 20,2262           57762                           XCH      AK         +1                         #  STORE FIRST TERM OF Q ERROR.
059661,000276: 20,2263           30323                           CA       CPSI                                  #  DESIRED ATTITUDE, Z-AXIS, 2'S COMP.
059662,000277: 20,2264           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
059663,000278: 20,2265           20034                           MSU      CDUZ                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
059664,000279: 20,2266           55763                           TS       AK         +2                         #  SAVE Z-AXIS TERM FOR R ERROR CALCULATION
059665,000280: 20,2267           00006                           EXTEND                                         
059666,000281: 20,2270           71417                           MP       M22                                   #  (CPSI-CDUZ)*M22, SCALED AT PI RADIANS.
059667,000282: 20,2271           61762                           AD       AK         +1                         #  Q ERROR COMPLETE         , AT PI RAD.
059668,000283: 20,2272           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
059669,000284: 20,2273           55762                           TS       AK         +1                         
059670,000285: 
059671,000286:                                                                                                  #  R ERROR CALCULATION NEXT.
059672,000287: 
059673,000288: 20,2274           31761                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q-AXIS CALC.
059674,000289: 20,2275           00006                           EXTEND                                         
059675,000290: 20,2276           71416                           MP       M31                                   #  (CTHETA-CDUY)*M31, SCALED AT PI RADIANS.
059676,000291: 20,2277           57763                           XCH      AK         +2                         #  FIRST TERM OF R ERROR.
059677,000292:                                                                                                  #  Z-AXIS DIFFERENCE, STORED BY A CALC. IS
059678,000293: 20,2300           00006                           EXTEND                                         #  RECOVERED BY THE EXCHANGE.
059679,000294: 20,2301           71420                           MP       M32                                   #  (CPSI-CDUZ)*M32, SCALED AT PI RADIANS.
059680,000295: 20,2302           61763                           AD       AK         +2                         #  R ERROR COMPLETE         , AT PI RAD.
059681,000296: 20,2303           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
059682,000297: 20,2304           55763                           TS       AK         +2                         
059683,000298: 
059684,000299:                                                                                                  #  NOW CALCULATE P ERROR.  (NOTE THAT M13 = 1, SCALED AT 1, SO THE MULTIPLICATION IS BY-PASSED.)

Page 1416

059686,000301: 20,2305           31761                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q AXIS CALC.
059687,000302: 20,2306           00006                           EXTEND                                         
059688,000303: 20,2307           71414                           MP       M11                                   #  (CTHETA-CDUY)*M11 SCALED AT PI RADIANS.
059689,000304: 20,2310           57761                           XCH      AK                                    #  FIRST TERM OF P ERROR IN AK, AT PI RAD.
059690,000305: 20,2311           30321                           CAE      CPHI                                  #  DESIRED ATTITUDE, X-AXIS, 2'S COMP.
059691,000306: 20,2312           00006                           EXTEND                                         #  SUBTRACT CURRENT X ATTITUDE.
059692,000307: 20,2313           20032                           MSU      CDUX                                  #  X-AXIS DIFFERENCE, 1'S COMP, AT PI RAD.
059693,000308: 
059694,000309:                                                                                                  #  M13 = 1, SO BYPASS THE MULTIPLICATION.
059695,000310:                                                                                                  #                EXTEND
059696,000311:                                                                                                  #                MP      M13             (CPHI-CDUX)*M13 SCALED AT PI RADIANS.
059697,000312: 
059698,000313: 20,2314           61761                           AD       AK                                    #  P ERROR COMPLETE      , SCALED AT PI RAD
059699,000314: 20,2315           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
059700,000315: 20,2316           55761                           TS       AK                                    
059701,000316: 
059702,000317: 20,2317           00006                           EXTEND                                         
059703,000318: 20,2320           22061                           QXCH     ITEMP1                                #  RESTORE Q FOR CHEKBITS RETURN.
059704,000319: 
059705,000320: 20,2321           12442                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
059706,000321: 

Page 1417

059708,000323:                                                                                                  #  FDAI ATTITUDE ERROR DISPLAY SUBROUTINE
059709,000324: 
059710,000325:                                                                                                  #  PROGRAM DESCRIPTION:          D. KEENE        5/24/67
059711,000326:                                                                                                  #  MOD 1 BY CRAIG WORK, 12 DEC 67
059712,000327:                                                                                                  #  MOD 2 BY CRAIG WORK, 6 APRIL 68 CONVERTS ATTITUDE ERROR DISPLAY SCALING FROM 16 7/8 DEG. TO 42 3/16 DEGREES.
059713,000328: 
059714,000329:                                                                                                  #  THIS SUBROUTINE IS USED TO DISPLAY ATTITUDE ERRORS ON THE FDAI VIA THE DIGITAL TO ANALOG CONVERTERS (DACS)
059715,000330:                                                                                                  #  IN THE CDUS.  CARE IS TAKEN TO METER OUT THE APPROPRIATE NUMBER OF PULSES TO THE IMU ERROR COUNTERS AND PREVENT
059716,000331:                                                                                                  #  OVERFLOW, TO CONTROL THE RELAY SEQUENCING, AND TO AVOID INTERFERENCE WITH THE COARSE ALIGN LOOP WHICH ALSO USES
059717,000332:                                                                                                  #  THE DACS.
059718,000333: 
059719,000334:                                                                                                  #  CALLING SEQUENCE:
059720,000335:                                                                                                  #        DURING THE INITIALIZATION SECTION OF THE USER'S PROGRAM, BIT3 OF RCSFLAGS SHOULD BE SET TO INITIATE THE
059721,000336:                                                                                                  #        TURN-ON SEQUENCE WITHIN THE NEEDLES PROGRAM:
059722,000337:                                                                                                  #                CS      RCSFLAGS        IN EBANK6
059723,000338:                                                                                                  #                MASK    BIT3
059724,000339:                                                                                                  #                ADS     RCSFLAGS
059725,000340:                                                                                                  #        THEREAFTER, THE ATTITUDE ERRORS GENERATED BY THE USER SHOULD BE TRANSFERED TO THE FOLLOWING LOCATIONS IN EBANK6:
059726,000341:                                                                                                  #                AK      SCALED 180 DEGREES      NOTE:   THESE LOCATIONS ARE SUBJECT
059727,000342:                                                                                                  #                AK1     SCALED 180 DEGREES              TO CHANGE
059728,000343:                                                                                                  #                AK2     SCALED 180 DEGREES
059729,000344:                                                                                                  #        FULL SCALED DEFLECTION OF THE NEEDLES CORRESPONDS TO 5 1/16 DEGREES, WHILE 384 BITS IN THE IMU ERROR COUNTER
059730,000345:                                                                                                  #        CORRESPONDS TO 42 3/16 DEGREES.  (DAC MAXIMUM CAPACITY IS 384 BITS.)  46 BITS EFFECTIVELY PIN THE NEEDLES.
059731,000346: 
059732,000347:                                                                                                  #        A CALL TO NEEDLER WILL THEN UPDATE THE DISPLAY:
059733,000348:                                                                                                  #                INHINT
059734,000349:                                                                                                  #                TC      IBNKCALL        NOTE:  EBANK SHOULD BE SET TO E6
059735,000350:                                                                                                  #                CADR    NEEDLER
059736,000351:                                                                                                  #                RELINT
059737,000352:                                                                                                  #        THIS PROCESS SHOULD BE REPEATED EACH TIME THE ERRORS ARE UPDATED.  AT LEAST 3 PASSES THRU THE PROGRAM ARE
059738,000353:                                                                                                  #        REQUIRED BEFORE ANYTHING IS ACTUALLY DISPLAYED ON THE ERROR METERS.
059739,000354:                                                                                                  #        NOTE:  EACH CALL TO NEEDLER MUST BE SEPARATED BY AT LEAST 50 MS TO ASSURE PROPER RELAY SEQUENCING.
059740,000355: 
059741,000356:                                                                                                  #  ERASABLE USED:
059742,000357:                                                                                                  #        AK              CDUXCMD
059743,000358:                                                                                                  #        AK1             CDUYCMD
059744,000359:                                                                                                  #        AK2             CDUZCMD
059745,000360:                                                                                                  #        EDRIVEX         A,L,Q
059746,000361:                                                                                                  #        EDRIVEY         T5TEMP
059747,000362:                                                                                                  #        EDRIVEZ         DINDX

Page 1418

059749,000364: 
059750,000365:                                                                                                  #  SWITCHES:             RCSFLAGS  BITS 3,2
059751,000366: 
059752,000367:                                                                                                  #  I/O CHANNELS:         CHAN12  BIT 4 (COARSE ALIGN - READ ONLY)
059753,000368:                                                                                                  #                        CHAN12  BIT 6 (IMU ERROR COUNTER ENABLE)
059754,000369:                                                                                                  #                        CHAN14  BIT 13,14,15 (DAC ACTIVITY)
059755,000370: 
059756,000371:                                                                                                  #  SIGN CONVENTION<      AK = THETAC - THETA
059757,000372:                                                                                                  #                        WHERE   THETAC = COMMAND ANGLE
059758,000373:                                                                                                  #                                THETA = PRESENT ANGLE
059759,000374: 
059760,000375: 20,2322           31273        NEEDLER            CA       RCSFLAGS                              
059761,000376: 20,2323           76242                           MASK     SIX                                   
059762,000377: 20,2324           00006                           EXTEND                                         
059763,000378: 20,2325           12362                           BZF      NEEDLES3                              
059764,000379: 20,2326           74751                           MASK     BIT3                                  
059765,000380: 20,2327           00006                           EXTEND                                         
059766,000381: 20,2330           12353                           BZF      NEEDLER2                              #  BIT3 = 0, BIT2 = 1
059767,000382: 
059768,000383: 20,2331           44746                           CS       BIT6                                  #  FIRST PASS BIT3 = 1
059769,000384: 20,2332           00006                           EXTEND                                         #  DISABLE IMU ERROR COUNTER TO ZERO DACS
059770,000385: 20,2333           03012                           WAND     CHAN12                                #  MUST WAIT AT LEAST 60 MS BEFORE
059771,000386: 20,2334           44755        NEEDLE11           CS       ZERO                                  #  ENABLING COUNTERS.
059772,000387: 20,2335           55761                           TS       AK                                    #  ZERO THE INPUTS ON FIRST PASS
059773,000388: 20,2336           55762                           TS       AK1                                   
059774,000389: 20,2337           55763                           TS       AK2                                   
059775,000390: 20,2340           55764                           TS       EDRIVEX                               #  ZERO THE DISPLAY REGISTERS
059776,000391: 20,2341           55765                           TS       EDRIVEY                               
059777,000392: 20,2342           55766                           TS       EDRIVEZ                               
059778,000393: 20,2343           54050                           TS       CDUXCMD                               #  ZERO THE OUT COUNTERS
059779,000394: 20,2344           54051                           TS       CDUYCMD                               
059780,000395: 20,2345           54052                           TS       CDUZCMD                               
059781,000396: 20,2346           46242                           CS       SIX                                   #  RESET RCSFLAGS FOR PASS2
059782,000397: 20,2347           71273                           MASK     RCSFLAGS                              
059783,000398: 20,2350           64752                           AD       BIT2                                  
059784,000399: 20,2351           55273                           TS       RCSFLAGS                              
059785,000400: 20,2352           12442                           TCF      RETNMORE                              
059786,000401: 
059787,000402: 20,2353           34746        NEEDLER2           CAF      BIT6                                  #  ENABLE IMU ERROR COUNTERS
059788,000403: 20,2354           00006                           EXTEND                                         
059789,000404: 20,2355           05012                           WOR      CHAN12                                
059790,000405: 20,2356           46242                           CS       SIX                                   #  RESET RCSFLAGS TO DISPLAY ATTITUDE
059791,000406: 20,2357           71273                           MASK     RCSFLAGS                              #  ERRORS    WAIT AT LEAST 4 MS FOR
059792,000407: 20,2360           55273                           TS       RCSFLAGS                              #  RELAY CLOSURE
059793,000408: 20,2361           12442                           TCF      RETNMORE                              
059794,000409: 
059795,000410: 20,2362           34746        NEEDLES3           CAF      BIT6                                  #  CHECK TO SEE IF IMU ERROR COUNTER
059796,000411: 20,2363           00006                           EXTEND                                         #  IS ENABLED
059797,000412: 20,2364           02012                           RAND     CHAN12                                

Page 1419

059799,000414: 20,2365           10000                           CCS      A                                     #  IF NOT, RE-INITIALIZE NEEDLER.
059800,000415: 20,2366           12373                           TCF      NEEDLES                               
059801,000416: 
059802,000417: 20,2367           41273                           CS       RCSFLAGS                              #  SET UP INITIALIZATION FLAG IN RCSFLAGS.
059803,000418: 20,2370           74751                           MASK     BIT3                                  
059804,000419: 20,2371           27273                           ADS      RCSFLAGS                              
059805,000420: 20,2372           12442                           TCF      RETNMORE                              
059806,000421: 
059807,000422: 20,2373           34752        NEEDLES            CAF      TWO                                   
059808,000423: 20,2374           54063        DACLOOP            TS       DINDX                                 
059809,000424: 20,2375           42434                           CS       ONETENTH                              #  RESCALE INPUTS TO + OR - 1800 DEGREES.
059810,000425: 20,2376           00006                           EXTEND                                         
059811,000426: 20,2377           50063                           INDEX    DINDX                                 
059812,000427: 20,2400           71761                           MP       AK                                    
059813,000428: 20,2401           54001                           TS       L                                     
059814,000429: 20,2402           10000                           CCS      A                                     
059815,000430: 20,2403           32432                           CA       DACLIMIT                              
059816,000431: 20,2404           12406                           TCF      +2                                    
059817,000432: 20,2405           42432                           CS       DACLIMIT                              
059818,000433: 20,2406           60001                           AD       L                                     
059819,000434: 20,2407           54061                           TS       T5TEMP                                #  OVFLO CHK
059820,000435: 20,2410           12414                           TCF      +4                                    
059821,000436: 20,2411           50000                           INDEX    A                                     #  ON OVERFLOW LIMIT OUTPUT TO +-384
059822,000437: 20,2412           32432                           CAF      DACLIMIT                              
059823,000438: 20,2413           54001                           TS       L                                     
059824,000439: 20,2414           50063                           INDEX    DINDX                                 
059825,000440: 20,2415           41764                           CS       EDRIVEX                               #  CURRENT VALUE OF DAC
059826,000441: 20,2416           60001                           AD       L                                     
059827,000442: 20,2417           50063                           INDEX    DINDX                                 
059828,000443: 20,2420           26050                           ADS      CDUXCMD                               
059829,000444: 20,2421           50063                           INDEX    DINDX                                 
059830,000445: 20,2422           23764                           LXCH     EDRIVEX                               
059831,000446: 20,2423           10063                           CCS      DINDX                                 
059832,000447: 20,2424           12374                           TCF      DACLOOP                               
059833,000448: 20,2425           37740                           CAF      13,14,15                              
059834,000449: 20,2426           00006                           EXTEND                                         
059835,000450: 20,2427           05014                           WOR      CHAN14                                #  SET DAC ACTIVITY BITS
059836,000451: 20,2430           12442                           TCF      RETNMORE                              
059837,000452: 
059838,000453: 20,2431           77177                           DEC      -384       B-14                       
059839,000454: 20,2432           37200        DACLIMIT           DEC      16000      B-14                       
059840,000455: 20,2433           00600                           DEC      384        B-14                       
059841,000456: 
059842,000457: 20,2434           03146        ONETENTH           OCT      03146                                 #  DECIMAL +0.1, SCALED AT 1.
059843,000458: 20,2435     4750               DSPLYALT           EQUALS   BIT4                                  #  100 MS ALTERNATION BIT IN RCSFLAGS
059844,000459: 
059845,000460: 20,2435           54007        OVERSUB2           TS       7                                     #  RETURNS A UNCHANGED OR LIMITED TO
059846,000461: 20,2436           00002                           TC       Q                                     #  POSMAX OR NEGMAX IF A HAS OVERFLOW
059847,000462: 20,2437           50000                           INDEX    A                                     

Page 1420

059849,000464: 20,2440           44734                           CS       LIMITS                                #  DUPLICATE CODING IN BANK 16
059850,000465: 20,2441           00002                           TC       Q                                     
059851,000466: 
059852,000467: 20,2442           00006        RETNMORE           EXTEND                                         #  RETURN TO CHEKMORE
059853,000468: 20,2443           32446                           DCA      MORECADR                              
059854,000469: 20,2444           52006                           DTCB                                           
059855,000470: 
059856,000471: 20,2445  E6,1537                                  EBANK=   AOSQ                                  
059857,000472: 20,2445           02016 34106  MORECADR           2CADR    CHEKMORE                              
059858,000473: 

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