Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

059552,000002:                                                                                                  ## Copyright:   Public domain.
059553,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
059554,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
059555,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
059556,000006:                                                                                                  ##              although several more revisions would follow. It has been
059557,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
059558,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
059559,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
059560,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
059561,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
059562,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
059563,000013:                                                                                                  ##              rather than the original YUL assembler.
059564,000014:                                                                                                  ## Reference:   pp. 1402-1412
059565,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059566,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059567,000017:                                                                                                  ## Mod history: 06/07/03 RSB.   Began transcribing.
059568,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
059569,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
059570,000020:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
059571,000021:                                                                                                  ##                              numbers in 1701.pdf.
059572,000022:                                                                                                  ##              2017-01-28 RSB  Comment-text fixes identified for Luminary 69.
059573,000023:                                                                                                  ##              2017-02-28 RSB  Proofed comment text using octopus/ProoferComments.
059574,000024:                                                                                                  ##              2017-03-10 RSB  Comment-text fixes noted in proofing Luminary 116.
059575,000025:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
059576,000026:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
059577,000027: 

Page 1402

059579,000029:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.  THE DAPIDLER PROGRAM IS DONE 10 TIMES
059580,000030:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
059581,000031:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
059582,000032: 
059583,000033: 16,2000                                           BANK     16                                    
059584,000034: 16,2000                                           SETLOC   DAPS1                                 
059585,000035: 16,2000                                           BANK                                           
059586,000036: 
059587,000037: 16,2000  E6,1536                                  EBANK=   AOSQ                                  
059588,000038: 
059589,000039: 16,2000                                           COUNT*   $$/DAPID                              
059590,000040: 
059591,000041: 16,2000           00006        CHEKBITS           EXTEND                                         
059592,000042: 16,2001           00031                           READ     CHAN31                                #  IF BOTH BIT13 AND BIT14 ARE ONE, THEN
059593,000043: 16,2002           40000                           COM                                            #  THE MODE SELECT SWITCH IS IN THE OFF
059594,000044: 16,2003           74355                           MASK     BIT13-14                              #  POSITION, AND SO THE DAP SHOULD BE OFF,
059595,000045: 16,2004           00006                           EXTEND                                         #  WITH NO ATTITUDE ERROR DISPLAY.
059596,000046: 16,2005           12157                           BZF      MOREIDLE                              
059597,000047: 
059598,000048: 16,2006           41300                           CS       IMODES33                              
059599,000049: 16,2007           74746                           MASK     BIT6                                  
059600,000050: 16,2010           10000                           CCS      A                                     
059601,000051: 16,2011           12206                           TCF      JUMPDSP                               
059602,000052: 16,2012           41262                           CS       RCSFLAGS                              #  IMU NOT USABLE.  SET UP INITIALIZATION
059603,000053: 16,2013           74751                           MASK     BIT3                                  #  FLAG FOR ATT ERROR DISPLAY ROUTINE.
059604,000054: 16,2014           27262                           ADS      RCSFLAGS                              
059605,000055: 16,2015           12163                           TCF      SHUTDOWN                              
059606,000056: 
059607,000057: 16,2016           34742        CHEKMORE           CAF      BIT10                                 #  BIT 10 OF 30 IS PGNCS CONTROL OF S/C
059608,000058: 16,2017           00006                           EXTEND                                         
059609,000059: 16,2020           02030                           RAND     CHAN30                                #  BITS IN 30 ARE INVERTED
059610,000060: 16,2021           10000                           CCS      A                                     
059611,000061: 16,2022           12157                           TCF      MOREIDLE                              
059612,000062: 
059613,000063: 16,2023           00002                           RETURN                                         
059614,000064: 

Page 1403

059616,000066:                                                                                                  #  DAPIDLER ENTRY.
059617,000067: 
059618,000068: 16,2024           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
059619,000069: 16,2025           00006                           EXTEND                                         
059620,000070: 16,2026           22012                           QXCH     QRUPT                                 
059621,000071: 
059622,000072: 16,2027           31262                           CA       RCSFLAGS                              
059623,000073: 16,2030           74737                           MASK     BIT13                                 
059624,000074: 16,2031           10000                           CCS      A                                     #  CHECK IF 1/ACCJOB HAS BEEN SET UP SINCE
059625,000075: 16,2032           12041                           TCF      CHECKUP                               #  THE LAST FRESH START OR RESTART.
059626,000076: 16,2033           34737                           CA       BIT13                                 
059627,000077: 16,2034           27262                           ADS      RCSFLAGS                              #  BIT 13 IS 1.
059628,000078: 16,2035           37720                           CAF      PRIO27                                
059629,000079: 16,2036           05072                           TC       NOVAC                                 #  SET UP JOB TO DO A LITTLE INITIALIZATION
059630,000080: 16,2037  E6,1536                                  EBANK=   AOSQ                                  #        AND EXECUTE 1/ACCS.
059631,000081: 16,2037           03645 42106                     2CADR    1/ACCSET                              #  (WILL BRANCH TO MOREIDLE ON ACCSOKAY)
059632,000082: 
059633,000083: 16,2041           02000        CHECKUP            TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON AND
059634,000084:                                                                                                  #        DO ERROR DISPLAY.
059635,000085: 
059636,000086: 16,2042           30111                           CAE      DAPBOOLS                              #  IF 1/ACCS HAS NOT BEEN COMPLETED, IDLE.
059637,000087: 16,2043           74751                           MASK     ACCSOKAY                              #        NOTE:   ONLY FRESH START AND RESTART
059638,000088: 16,2044           00006                           EXTEND                                         #                KNOCK THIS BIT DOWN.
059639,000089: 16,2045           12157                           BZF      MOREIDLE                              
059640,000090: 
059641,000091: 16,2046           04674        STARTDAP           TC       IBNKCALL                              #  ZERO ATTITUDE ERROR AND DESIRED RATES.
059642,000092: 16,2047           40154                           FCADR    ZATTEROR                              
059643,000093: 16,2050           34755                           CAF      ZERO                                  #  ********** INITIALIZE: **********
059644,000094: 16,2051           55524                           TS       TJP                                   
059645,000095: 16,2052           55525                           TS       TJU                                   
059646,000096: 16,2053           55526                           TS       TJV                                   
059647,000097: 16,2054           55421                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
059648,000098: 16,2055           55422                           TS       OMEGAQ                                
059649,000099: 16,2056           55423                           TS       OMEGAR                                
059650,000100: 16,2057           55430                           TS       TRAPEDP                               
059651,000101: 16,2060           55431                           TS       TRAPEDQ                               
059652,000102: 16,2061           55432                           TS       TRAPEDR                               
059653,000103: 16,2062           55536                           TS       AOSQ                                  #  OFFSET ACCELERATION ESTIMATES.
059654,000104: 16,2063           55537                           TS       AOSQ       +1                         
059655,000105: 16,2064           55540                           TS       AOSR                                  
059656,000106: 16,2065           55541                           TS       AOSR       +1                         
059657,000107: 16,2066           55424                           TS       ALPHAQ                                #  COPIES OF OFFSET ESTIMATES FOR DOWNLIST.
059658,000108: 16,2067           55425                           TS       ALPHAR                                
059659,000109: 16,2070           55501                           TS       NEGUQ                                 
059660,000110: 16,2071           55503                           TS       NEGUR                                 
059661,000111: 16,2072           55544                           TS       AOSQTERM                              #  QRAXIS RATE DERIVATION TERMS AND KALMAN
059662,000112: 16,2073           55545                           TS       AOSRTERM                              #  FILTER INITIALIZATION TERMS.
059663,000113: 16,2074           55510                           TS       QACCDOT                               #  DESCENT ACCELERATION DERIVATIVE EST.
059664,000114: 16,2075           55512                           TS       RACCDOT                               

Page 1404

059666,000116: 16,2076           55502                           TS       ALLOWGTS                              #  AOSTASK FLAG FOR QRAXIS RCS CONTROL USE.
059667,000117: 16,2077           55630                           TS       COTROLER                              #  DO TRYGTS ON FIRST PASS (WILL GO TO RCS)
059668,000118: 16,2100           55632                           TS       INGTS                                 #  RECOGNIZE FIRST GTS PASS AS SUCH.
059669,000119: 16,2101           55631                           TS       QGIMTIMR                              #  STOP GIMBAL DRIVES.  (PROBABLY WOULD BE
059670,000120: 16,2102           55633                           TS       RGIMTIMR                              #        GOOD ENOUGH JUST TO INACTIVATE TIMERS)
059671,000121: 16,2103           55460                           TS       OLDPMIN                               #  MINIMUM IMPULSE MODE ERASABLES
059672,000122: 16,2104           55461                           TS       OLDQRMIN                              
059673,000123: 16,2105           55766                           TS       PJETCTR                               #  INITIALIZE DOCKED JET INHIBITION
059674,000124: 16,2106           55767                           TS       UJETCTR                               #  COUNTERS
059675,000125: 16,2107           55770                           TS       VJETCTR                               
059676,000126: 16,2110     4747               CALLGMBL           EQUALS   BIT5                                  #  RCSFLAGS INITIALIZATION.
059677,000127: 16,2110           42202                           CS       MANFLAG                               
059678,000128: 16,2111           71262                           MASK     RCSFLAGS                              #  NEGUQ(R) HAVE BEEN GENERATED.
059679,000129: 16,2112           55262                           TS       RCSFLAGS                              
059680,000130: 
059681,000131:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
059682,000132: 
059683,000133: 16,2113           00006                           EXTEND                                         
059684,000134: 16,2114           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
059685,000135: 16,2115           53441                           DXCH     OLDXFORP                              
059686,000136: 16,2116           30034                           CA       CDUZ                                  
059687,000137: 16,2117           55442                           TS       OLDZFORQ                              
059688,000138: 16,2120           41262                           CS       RCSFLAGS                              
059689,000139: 16,2121           74740                           MASK     BIT12                                 
059690,000140: 16,2122           27262                           ADS      RCSFLAGS                              #  BIT 12 SET TO 1.
059691,000141: 16,2123           34751                           CA       FOUR                                  
059692,000142: 16,2124           55534                           TS       SKIPU                                 
059693,000143: 16,2125           55535                           TS       SKIPV                                 
059694,000144: 16,2126           34733                           CA       POSMAX                                
059695,000145: 16,2127           54031                           TS       TIME6                                 
059696,000146: 16,2130           55466                           TS       T6NEXT                                
059697,000147: 16,2131           55470                           TS       T6FURTHA                              
059698,000148: 16,2132           34755                           CA       ZERO                                  
059699,000149: 16,2133           55467                           TS       T6NEXT     +1                         
059700,000150: 16,2134           55471                           TS       T6FURTHA   +1                         
059701,000151: 16,2135           55465                           TS       NXT6ADR                               
059702,000152: 16,2136           55472                           TS       NEXTP                                 
059703,000153: 16,2137           55473                           TS       NEXTU                                 
059704,000154: 16,2140           55474                           TS       NEXTV                                 
059705,000155: 16,2141           44363                           CS       TEN                                   
059706,000156: 16,2142           55756                           TS       DAPZRUPT                              #  JASK NOT IN PROGRESS, INITIALIZE NEG.
059707,000157: 16,2143           34752                           CA       TWO                                   
059708,000158: 16,2144           55433                           TS       NPTRAPS                               
059709,000159: 16,2145           55434                           TS       NQTRAPS                               
059710,000160: 16,2146           55435                           TS       NRTRAPS                               
059711,000161: 16,2147           00006                           EXTEND                                         
059712,000162: 16,2150           32205                           DCA      PAXADIDL                              
059713,000163: 16,2151           53264                           DXCH     T5ADR                                 
059714,000164: 16,2152           37732        SETTIME5           CAF      MS100                                 
059715,000165: 16,2153           54030                           TS       TIME5                                 

Page 1405

059717,000167: 16,2154           15270                           TCF      RESUME                                
059718,000168: 16,2155  E6,1536                                  EBANK=   AOSQ                                  
059719,000169: 16,2155           02024 34106  IDLERADR           2CADR    DAPIDLER                              
059720,000170: 
059721,000171: 16,2157           04674        MOREIDLE           TC       IBNKCALL                              #  CALCULATE Q,R-AXES ATTITUDE ERRORS.
059722,000172: 16,2160           36655                           CADR     QERRCALC                              
059723,000173: 
059724,000174: 16,2161           04674                           TC       IBNKCALL                              
059725,000175: 16,2162           35452                           CADR     CALCPERR                              #  CALCULATE P AXIS ATTITUDE ERRORS.
059726,000176: 
059727,000177: 16,2163           00006        SHUTDOWN           EXTEND                                         
059728,000178: 16,2164           32156                           DCA      IDLERADR                              
059729,000179: 16,2165           53264                           DXCH     T5ADR                                 
059730,000180: 
059731,000181: 16,2166           34755                           CAF      ZERO                                  #  KILL ANY POSSIBLE JET REQUESTS
059732,000182: 16,2167           55472                           TS       NEXTP                                 
059733,000183: 16,2170           55473                           TS       NEXTU                                 
059734,000184: 16,2171           55474                           TS       NEXTV                                 
059735,000185: 16,2172           00006                           EXTEND                                         #  COMMAND JETS OFF.
059736,000186: 16,2173           01005                           WRITE    CHAN5                                 
059737,000187: 16,2174           00006                           EXTEND                                         
059738,000188: 16,2175           01006                           WRITE    CHAN6                                 
059739,000189: 16,2176           42203                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
059740,000190: 16,2177           00006                           EXTEND                                         
059741,000191: 16,2200           03012                           WAND     CHAN12                                
059742,000192: 16,2201           12152                           TCF      SETTIME5                              #  RETURN IN 100 MSEC.
059743,000193: 
059744,000194: 16,2202           03021        MANFLAG            OCT      03021                                 
059745,000195: 16,2203           07400        BGIM23             OCTAL    07400                                 
059746,000196: 16,2204  E6,1421                                  EBANK=   OMEGAP                                
059747,000197: 16,2204           02213 34106  PAXADIDL           2CADR    PAXIS                                 
059748,000198: 
059749,000199: 16,2206     7732               MS100              =        OCT37766                              
059750,000200: 16,2206     0061               COSMG              =        ITEMP1                                
059751,000201: 16,2206           00006        JUMPDSP            EXTEND                                         #  TRANSFER TO BANK 20
059752,000202: 16,2207           32212                           DCA      DSPCADR                               #  FOR ATTITUDE ERROR DISPLAYS
059753,000203: 16,2210           52006                           DTCB                                           
059754,000204: 
059755,000205: 16,2211  E6,1760                                  EBANK=   AK                                    
059756,000206: 16,2211           02227 40106  DSPCADR            2CADR    ALTDSPLY                              
059757,000207: 

Page 1406

059759,000209: 20,2227                                           BANK     20                                    
059760,000210: 20,2000                                           SETLOC   DAPS3                                 
059761,000211: 20,2000                                           BANK                                           
059762,000212: 20,2227                                           COUNT*   $$/NEEDL                              
059763,000213: 
059764,000214:                                                                                                  #  PROGRAM:      ALTDSPLY
059765,000215:                                                                                                  #  MOD 0.        6 DEC 1967
059766,000216:                                                                                                  #  AUTHOR:       CRAIG WORK, DON KEENE, MIT IL
059767,000217:                                                                                                  #  MOD 3 BY DON KEENE AUG 1, 1968 MOVED PROGRAM TO BANK 20
059768,000218: 
059769,000219:                                                                                                  #  PROGRAM DESCRIPTION:
059770,000220:                                                                                                  #        ALTDSPLY REVERSES THE DSPLYALT BIT OF RCSFLAGS EACH TIME IT IS CALLED, WHICH IS PRESUMABLY EVERY 100 MS.
059771,000221:                                                                                                  #        IF THE REVERSED BIT IS ONE, NEEDLER IS CALLED TO DISPLAY ATTITUDE ERRORS.  IF THE BIT IS ZERO, THE ATTITUDE ERR-
059772,000222:                                                                                                  #        ORS ARE CALCULATED AS 1) ESTIMATED RATES (FOLLOWING) IF NEED2FLG = 1, OTHERWISE AS 2) DAP FOLLOWING ERRORS FOR
059773,000223:                                                                                                  #        NEEDLFLG = 0 AND 3) TOTAL ATTITUDE ERRORS FOR NEEDLFLG = 1.
059774,000224: 
059775,000225:                                                                                                  #  WARNING:      ALTDSPLY MAY ONLY BE CALLED WITH INTERRUPT INHIBITED.
059776,000226: 
059777,000227:                                                                                                  #  WARNING:      EBANK MUST BE SET TO 6 WHEN USING THIS ROUTINE.
059778,000228: 
059779,000229:                                                                                                  #  INPUT:        RCSFLAGS AND    1) IF NEEDLFLG = 0, INPUT PERROR, QERROR, RERROR.
059780,000230:                                                                                                  #                                2) IF NEEDLFLG = 1, INPUT CPHI,CTHETA,CPSI,CDUX,CDUY,CDUZ,M11,M21,M32,M22,M32.  (GPMATRIX)
059781,000231:                                                                                                  #                                3) IF NEED2FLG = 1, INPUT OMEGAP, OMEGAQ, AND OMEGAR.
059782,000232: 
059783,000233:                                                                                                  #  OUTPUTS:      RCSFLAGS WITH DSPLYALT REVERSED, AK, AK1, AK2, + NEEDLER OUTPUTS.
059784,000234: 
059785,000235:                                                                                                  #  ENTRY:        TCF     ALTDSPLY
059786,000236: 
059787,000237:                                                                                                  #  EXIT:         TCF     CHEKMORE
059788,000238: 
059789,000239:                                                                                                  #  ALARM OR ABORT EXITS:  NONE
059790,000240: 
059791,000241:                                                                                                  #  SUBPROGRAMS CALLED:  NEEDLER, OVERSUB2
059792,000242: 
059793,000243:                                                                                                  #  DEBRIS:       A, L, AND NEEDLER DEBRIS.
059794,000244: 
059795,000245: 20,2227           31262        ALTDSPLY           CA       RCSFLAGS                              #  INVERT THE DISPLAY ALTERNATION BIT.
059796,000246: 20,2230           54001                           TS       L                                     
059797,000247: 20,2231           34750                           CA       DSPLYALT                              
059798,000248: 20,2232           00006                           EXTEND                                         
059799,000249: 20,2233           06001                           RXOR     LCHAN                                 
059800,000250: 20,2234           55262                           TS       RCSFLAGS                              
059801,000251: 
059802,000252: 20,2235           74750                           MASK     DSPLYALT                              
059803,000253: 20,2236           10000                           CCS      A                                     #  IS ALTERNATION FLAG ZERO?

Page 1407

059805,000255: 20,2237           12336                           TCF      NEEDLER                               
059806,000256: 
059807,000257: 20,2240           40074                           CS       FLAGWRD0                              #  CHECK FOR RATE DISPLAY TO ERROR NEEDLES
059808,000258: 20,2241           74735                           MASK     NEED2BIT                              #  VIA EXTENDED VERB 60
059809,000259: 20,2242           00006                           EXTEND                                         
059810,000260: 20,2243           12257                           BZF      DISPRATE                              
059811,000261: 
059812,000262: 20,2244           30074                           CAE      FLAGWRD0                              #  NEEDLFLG WILL INDICATE TOTAL OR DAP AT-
059813,000263: 20,2245           74750                           MASK     NEEDLBIT                              #  TITUDE ERROR DISPLAY REQUEST.
059814,000264: 20,2246           10000                           CCS      A                                     
059815,000265: 20,2247           12266                           TCF      DSPLYTOT                              #  TOTAL ERROR IS NEEDED IN AK, AK +1, AK +2
059816,000266: 
059817,000267: 20,2250           41450                           CS       QERROR                                #  YES.  DISPLAY ATT ERRORS ON THE ,-BALL.
059818,000268: 20,2251           55761                           TS       AK         +1                         #  ERROR COMPLEMENTS ARE INPUT TO NEEDLER.
059819,000269: 20,2252           41452                           CS       RERROR                                
059820,000270: 20,2253           55762                           TS       AK         +2                         
059821,000271: 20,2254           41464                           CS       PERROR                                
059822,000272: 20,2255           57760                           XCH      AK                                    
059823,000273: 
059824,000274: 20,2256           12456                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
059825,000275: 
059826,000276: 20,2257           41422        DISPRATE           CS       OMEGAQ                                #  LOAD ESTIMATED RATES (FOLLOWING)
059827,000277: 20,2260           55761                           TS       AK         +1                         
059828,000278: 20,2261           41423                           CS       OMEGAR                                
059829,000279: 20,2262           55762                           TS       AK         +2                         
059830,000280: 20,2263           41421                           CS       OMEGAP                                
059831,000281: 20,2264           57760                           XCH      AK                                    
059832,000282: 20,2265           12456                           TCF      RETNMORE                              
059833,000283: 
059834,000284:                                                                                                  #  CALCULATE GIMBAL ANGLE TOTAL ERRORS, RESOLVE INTO PILOT AXES, STORE TOTAL ERRORS FOR NEEDLER.  Q-AXIS FIRST.
059835,000285: 
059836,000286: 20,2266           00006        DSPLYTOT           EXTEND                                         
059837,000287: 20,2267           22061                           QXCH     ITEMP1                                #  SAVE Q FOR CHEKBITS RETURN.
059838,000288: 
059839,000289: 20,2270           30322                           CA       CTHETA                                #  DESIRED ATTITUDE, Y-AXIS, 2'S COMP.
059840,000290: 20,2271           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
059841,000291: 20,2272           20033                           MSU      CDUY                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
059842,000292: 20,2273           55760                           TS       AK                                    #  SAVE FOR R-ERROR CALCULATION.
059843,000293: 20,2274           00006                           EXTEND                                         
059844,000294: 20,2275           71415                           MP       M21                                   #  (CHTETA-CDUY)*M21 SCALED AT PI RADIANS.
059845,000295: 20,2276           57761                           XCH      AK         +1                         #  STORE FIRST TERM OF Q ERROR.
059846,000296: 20,2277           30323                           CA       CPSI                                  #  DESIRED ATTITUDE, Z-AXIS, 2'S COMP.
059847,000297: 20,2300           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
059848,000298: 20,2301           20034                           MSU      CDUZ                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
059849,000299: 20,2302           55762                           TS       AK         +2                         #  SAVE Z-AXIS TERM FOR R ERROR CALCULATION
059850,000300: 20,2303           00006                           EXTEND                                         
059851,000301: 20,2304           71417                           MP       M22                                   #  (CPSI-CDUZ)*M22, SCALED AT PI RADIANS.
059852,000302: 20,2305           61761                           AD       AK         +1                         #  Q ERROR COMPLETE         , AT PI RAD.
059853,000303: 20,2306           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
059854,000304: 20,2307           55761                           TS       AK         +1                         
059855,000305: 

Page 1408

059857,000307:                                                                                                  #  R ERROR CALCULATION NEXT.
059858,000308: 
059859,000309: 20,2310           31760                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q-AXIS CALC.
059860,000310: 20,2311           00006                           EXTEND                                         
059861,000311: 20,2312           71416                           MP       M31                                   #  (CTHETA-CDUY)*M31, SCALED AT PI RADIANS.
059862,000312: 20,2313           57762                           XCH      AK         +2                         #  FIRST TERM OF R ERROR.
059863,000313:                                                                                                  #  Z-AXIS DIFFERENCE, STORED BY A CALC. IS
059864,000314: 20,2314           00006                           EXTEND                                         #  RECOVERED BY THE EXCHANGE.
059865,000315: 20,2315           71420                           MP       M32                                   #  (CPSI-CDUZ)*M32, SCALED AT PI RADIANS.
059866,000316: 20,2316           61762                           AD       AK         +2                         #  R ERROR COMPLETE         , AT PI RAD.
059867,000317: 20,2317           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
059868,000318: 20,2320           55762                           TS       AK         +2                         
059869,000319: 
059870,000320:                                                                                                  #  NOW CALCULATE P ERROR.  (NOTE THAT M13 = 1, SCALED AT 1, SO THE MULTIPLICATION IS BY-PASSED.)
059871,000321: 
059872,000322: 20,2321           31760                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q AXIS CALC.
059873,000323: 20,2322           00006                           EXTEND                                         
059874,000324: 20,2323           71414                           MP       M11                                   #  (CTHETA-CDUY)*M11 SCALED AT PI RADIANS.
059875,000325: 20,2324           57760                           XCH      AK                                    #  FIRST TERM OF P ERROR IN AK, AT PI RAD.
059876,000326: 20,2325           30321                           CAE      CPHI                                  #  DESIRED ATTITUDE, X-AXIS, 2'S COMP.
059877,000327: 20,2326           00006                           EXTEND                                         #  SUBTRACT CURRENT X ATTITUDE.
059878,000328: 20,2327           20032                           MSU      CDUX                                  #  X-AXIS DIFFERENCE, 1'S COMP, AT PI RAD.
059879,000329: 
059880,000330:                                                                                                  #  M13 = 1, SO BYPASS THE MULTIPLICATION.
059881,000331:                                                                                                  #                EXTEND
059882,000332:                                                                                                  #                MP      M13             (CPHI-CDUX)*M13 SCALED AT PI RADIANS.
059883,000333: 
059884,000334: 20,2330           61760                           AD       AK                                    #  P ERROR COMPLETE      , SCALED AT PI RAD
059885,000335: 20,2331           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
059886,000336: 20,2332           55760                           TS       AK                                    
059887,000337: 
059888,000338: 20,2333           00006                           EXTEND                                         
059889,000339: 20,2334           22061                           QXCH     ITEMP1                                #  RESTORE Q FOR CHEKBITS RETURN.
059890,000340: 
059891,000341: 20,2335           12456                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
059892,000342: 

Page 1409

059894,000344:                                                                                                  #  FDAI ATTITUDE ERROR DISPLAY SUBROUTINE
059895,000345: 
059896,000346:                                                                                                  #  PROGRAM DESCRIPTION:          D. KEENE        5/24/67
059897,000347:                                                                                                  #  MOD 1 BY CRAIG WORK, 12 DEC 67
059898,000348:                                                                                                  #  MOD 2 BY CRAIG WORK, 6 APRIL 68 CONVERTS ATTITUDE ERROR DISPLAY SCALING FROM 16 7/8 DEG. TO 42 3/16 DEGREES.
059899,000349: 
059900,000350:                                                                                                  #  THIS SUBROUTINE IS USED TO DISPLAY ATTITUDE ERRORS ON THE FDAI VIA THE DIGITAL TO ANALOG CONVERTERS (DACS)
059901,000351:                                                                                                  #  IN THE CDUS.  CARE IS TAKEN TO METER OUT THE APPROPRIATE NUMBER OF PULSES TO THE IMU ERROR COUNTERS AND PREVENT
059902,000352:                                                                                                  #  OVERFLOW, TO CONTROL THE RELAY SEQUENCING, AND TO AVOID INTERFERENCE WITH THE COARSE ALIGN LOOP WHICH ALSO USES
059903,000353:                                                                                                  #  THE DACS.
059904,000354: 
059905,000355:                                                                                                  #  CALLING SEQUENCE:
059906,000356:                                                                                                  #        DURING THE INITIALIZATION SECTION OF THE USER'S PROGRAM, BIT3 OF RCSFLAGS SHOULD BE SET TO INITIATE THE
059907,000357:                                                                                                  #        TURN-ON SEQUENCE WITHIN THE NEEDLES PROGRAM:
059908,000358:                                                                                                  #                CS      RCSFLAGS        IN EBANK6
059909,000359:                                                                                                  #                MASK    BIT3
059910,000360:                                                                                                  #                ADS     RCSFLAGS
059911,000361:                                                                                                  #        THEREAFTER, THE ATTITUDE ERRORS GENERATED BY THE USER SHOULD BE TRANSFERED TO THE FOLLOWING LOCATIONS IN EBANK6:
059912,000362:                                                                                                  #                AK      SCALED 180 DEGREES      NOTE:   THESE LOCATIONS ARE SUBJECT
059913,000363:                                                                                                  #                AK1     SCALED 180 DEGREES              TO CHANGE
059914,000364:                                                                                                  #                AK2     SCALED 180 DEGREES
059915,000365:                                                                                                  #        FULL SCALED DEFLECTION OF THE NEEDLES CORRESPONDS TO 5 1/16 DEGREES, WHILE 384 BITS IN THE IMU ERROR COUNTER
059916,000366:                                                                                                  #        CORRESPONDS TO 42 3/16 DEGREES.  (DAC MAXIMUM CAPACITY IS 384 BITS.)  46 BITS EFFECTIVELY PIN THE NEEDLES.
059917,000367:                                                                                                  #        FOR RATE DISPLAY, FULL SCALE NEEDLE DEFLECTION IS 1 17/64 DEG/SEC, AND A FULL COUNTER IS ABOUT 10.5 DEG/SEC.
059918,000368:                                                                                                  #        A CALL TO NEEDLER WILL THEN UPDATE THE DISPLAY:
059919,000369:                                                                                                  #                INHINT
059920,000370:                                                                                                  #                TC      IBNKCALL        NOTE:  EBANK SHOULD BE SET TO E6
059921,000371:                                                                                                  #                CADR    NEEDLER
059922,000372:                                                                                                  #                RELINT
059923,000373:                                                                                                  #        THIS PROCESS SHOULD BE REPEATED EACH TIME THE ERRORS ARE UPDATED.  AT LEAST 3 PASSES THRU THE PROGRAM ARE
059924,000374:                                                                                                  #        REQUIRED BEFORE ANYTHING IS ACTUALLY DISPLAYED ON THE ERROR METERS.
059925,000375:                                                                                                  #        NOTE:  EACH CALL TO NEEDLER MUST BE SEPARATED BY AT LEAST 50 MS TO ASSURE PROPER RELAY SEQUENCING.
059926,000376: 
059927,000377:                                                                                                  #  ERASABLE USED:
059928,000378:                                                                                                  #        AK              CDUXCMD
059929,000379:                                                                                                  #        AK1             CDUYCMD
059930,000380:                                                                                                  #        AK2             CDUZCMD
059931,000381:                                                                                                  #        EDRIVEX         A,L,Q
059932,000382:                                                                                                  #        EDRIVEY         T5TEMP

Page 1410

059934,000384:                                                                                                  #        EDRIVEZ         DINDX
059935,000385: 
059936,000386:                                                                                                  #  SWITCHES:             RCSFLAGS  BITS 3,2
059937,000387: 
059938,000388:                                                                                                  #  I/O CHANNELS:         CHAN12  BIT 4 (COARSE ALIGN - READ ONLY)
059939,000389:                                                                                                  #                        CHAN12  BIT 6 (IMU ERROR COUNTER ENABLE)
059940,000390:                                                                                                  #                        CHAN14  BIT 13,14,15 (DAC ACTIVITY)
059941,000391: 
059942,000392:                                                                                                  #  SIGN CONVENTION<      AK = THETAC - THETA
059943,000393:                                                                                                  #                        WHERE   THETAC = COMMAND ANGLE
059944,000394:                                                                                                  #                                THETA = PRESENT ANGLE
059945,000395: 
059946,000396: 20,2336           31262        NEEDLER            CA       RCSFLAGS                              
059947,000397: 20,2337           76245                           MASK     SIX                                   
059948,000398: 20,2340           00006                           EXTEND                                         
059949,000399: 20,2341           12376                           BZF      NEEDLES3                              
059950,000400: 20,2342           74751                           MASK     BIT3                                  
059951,000401: 20,2343           00006                           EXTEND                                         
059952,000402: 20,2344           12367                           BZF      NEEDLER2                              #  BIT3 = 0, BIT2 = 1
059953,000403: 
059954,000404: 20,2345           44746                           CS       BIT6                                  #  FIRST PASS BIT3 = 1
059955,000405: 20,2346           00006                           EXTEND                                         #  DISABLE IMU ERROR COUNTER TO ZERO DACS
059956,000406: 20,2347           03012                           WAND     CHAN12                                #  MUST WAIT AT LEAST 60 MS BEFORE
059957,000407: 20,2350           44755        NEEDLE11           CS       ZERO                                  #  ENABLING COUNTERS.
059958,000408: 20,2351           55760                           TS       AK                                    #  ZERO THE INPUTS ON FIRST PASS
059959,000409: 20,2352           55761                           TS       AK1                                   
059960,000410: 20,2353           55762                           TS       AK2                                   
059961,000411: 20,2354           55763                           TS       EDRIVEX                               #  ZERO THE DISPLAY REGISTERS
059962,000412: 20,2355           55764                           TS       EDRIVEY                               
059963,000413: 20,2356           55765                           TS       EDRIVEZ                               
059964,000414: 20,2357           54050                           TS       CDUXCMD                               #  ZERO THE OUT COUNTERS
059965,000415: 20,2360           54051                           TS       CDUYCMD                               
059966,000416: 20,2361           54052                           TS       CDUZCMD                               
059967,000417: 20,2362           46245                           CS       SIX                                   #  RESET RCSFLAGS FOR PASS2
059968,000418: 20,2363           71262                           MASK     RCSFLAGS                              
059969,000419: 20,2364           64752                           AD       BIT2                                  
059970,000420: 20,2365           55262                           TS       RCSFLAGS                              
059971,000421: 20,2366           12456                           TCF      RETNMORE                              
059972,000422: 
059973,000423: 20,2367           34746        NEEDLER2           CAF      BIT6                                  #  ENABLE IMU ERROR COUNTERS
059974,000424: 20,2370           00006                           EXTEND                                         
059975,000425: 20,2371           05012                           WOR      CHAN12                                
059976,000426: 20,2372           46245                           CS       SIX                                   #  RESET RCSFLAGS TO DISPLAY ATTITUDE
059977,000427: 20,2373           71262                           MASK     RCSFLAGS                              #  ERRORS   WAIT AT LEAST 4 MS FOR
059978,000428: 20,2374           55262                           TS       RCSFLAGS                              #  RELAY CLOSURE
059979,000429: 20,2375           12456                           TCF      RETNMORE                              
059980,000430: 
059981,000431: 20,2376           34746        NEEDLES3           CAF      BIT6                                  #  CHECK TO SEE IF IMU ERROR COUNTER

Page 1411

059983,000433: 20,2377           00006                           EXTEND                                         #  IS ENABLED
059984,000434: 20,2400           02012                           RAND     CHAN12                                
059985,000435: 20,2401           10000                           CCS      A                                     #  IF NOT, RE-INITIALIZE NEEDLER.
059986,000436: 20,2402           12407                           TCF      NEEDLES                               
059987,000437: 
059988,000438: 20,2403           41262                           CS       RCSFLAGS                              #  SET UP INITIALIZATION FLAG IN RCSFLAGS.
059989,000439: 20,2404           74751                           MASK     BIT3                                  
059990,000440: 20,2405           27262                           ADS      RCSFLAGS                              
059991,000441: 20,2406           12456                           TCF      RETNMORE                              
059992,000442: 
059993,000443: 20,2407           34752        NEEDLES            CAF      TWO                                   
059994,000444: 20,2410           54063        DACLOOP            TS       DINDX                                 
059995,000445: 20,2411           42450                           CS       ONETENTH                              #  RESCALE INPUTS TO + OR - 1800 DEGREES.
059996,000446: 20,2412           00006                           EXTEND                                         
059997,000447: 20,2413           50063                           INDEX    DINDX                                 
059998,000448: 20,2414           71760                           MP       AK                                    
059999,000449: 20,2415           54001                           TS       L                                     
060000,000450: 20,2416           10000                           CCS      A                                     
060001,000451: 20,2417           32446                           CA       DACLIMIT                              
060002,000452: 20,2420           12422                           TCF      +2                                    
060003,000453: 20,2421           42446                           CS       DACLIMIT                              
060004,000454: 20,2422           60001                           AD       L                                     
060005,000455: 20,2423           54061                           TS       T5TEMP                                #  OVFLO CHK
060006,000456: 20,2424           12430                           TCF      +4                                    
060007,000457: 20,2425           50000                           INDEX    A                                     #  ON OVERFLOW LIMIT OUTPUT TO +-384
060008,000458: 20,2426           32446                           CAF      DACLIMIT                              
060009,000459: 20,2427           54001                           TS       L                                     
060010,000460: 20,2430           50063                           INDEX    DINDX                                 
060011,000461: 20,2431           41763                           CS       EDRIVEX                               #  CURRENT VALUE OF DAC
060012,000462: 20,2432           60001                           AD       L                                     
060013,000463: 20,2433           50063                           INDEX    DINDX                                 
060014,000464: 20,2434           26050                           ADS      CDUXCMD                               
060015,000465: 20,2435           50063                           INDEX    DINDX                                 
060016,000466: 20,2436           23763                           LXCH     EDRIVEX                               
060017,000467: 20,2437           10063                           CCS      DINDX                                 
060018,000468: 20,2440           12410                           TCF      DACLOOP                               
060019,000469: 20,2441           37743                           CAF      13,14,15                              
060020,000470: 20,2442           00006                           EXTEND                                         
060021,000471: 20,2443           05014                           WOR      CHAN14                                #  SET DAC ACTIVITY BITS
060022,000472: 20,2444           12456                           TCF      RETNMORE                              
060023,000473: 
060024,000474: 20,2445           77177                           DEC      -384       B-14                       
060025,000475: 20,2446           37200        DACLIMIT           DEC      16000      B-14                       
060026,000476: 20,2447           00600                           DEC      384        B-14                       
060027,000477: 
060028,000478: 20,2450           03146        ONETENTH           OCT      03146                                 #  DECIMAL +0.1, SCALED AT 1.
060029,000479: 20,2451     4750               DSPLYALT           EQUALS   BIT4                                  #  100 MS ALTERNATION BIT IN RCSFLAGS
060030,000480: 
060031,000481: 20,2451           54007        OVERSUB2           TS       7                                     #  RETURNS A UNCHANGED OR LIMITED TO

Page 1412

060033,000483: 20,2452           00002                           TC       Q                                     #  POSMAX OR NEGMAX IF A HAS OVERFLOW
060034,000484: 20,2453           50000                           INDEX    A                                     
060035,000485: 20,2454           44734                           CS       LIMITS                                #  DUPLICATE CODING IN BANK 16
060036,000486: 20,2455           00002                           TC       Q                                     
060037,000487: 
060038,000488: 20,2456           00006        RETNMORE           EXTEND                                         #  RETURN TO CHEKMORE
060039,000489: 20,2457           32462                           DCA      MORECADR                              
060040,000490: 20,2460           52006                           DTCB                                           
060041,000491: 
060042,000492: 20,2461  E6,1536                                  EBANK=   AOSQ                                  
060043,000493: 20,2461           02016 34106  MORECADR           2CADR    CHEKMORE                              
060044,000494: 
060045,000495: 
060046,000496: 
060047,000497: 

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