Source Code

These source-code files are part of a reconstructed copy of Luminary 178, the final release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 178 listing would be different.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

060000,000002:                                                                                                  ## Copyright:   Public domain.
060001,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
060002,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
060003,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
060004,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
060005,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
060006,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
060007,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
060008,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
060009,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
060010,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
060011,000013:                                                                                                  ##              that the reconstruction is correct.
060012,000014:                                                                                                  ## Reference:   pp. 1398-1408
060013,000015:                                                                                                  ## Assembler:   yaYUL
060014,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060015,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060016,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
060017,000019:                                                                                                  ##              2019-09-15 MAS  Removed NONEEDLE tag and changed CHEKBITS
060018,000020:                                                                                                  ##                              to branch to MOREIDLE. Also removed/changed
060019,000021:                                                                                                  ##                              back some comments.
060020,000022: 

Page 1398

060022,000024:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.             THE DAPIDLER PROGRAM IS DONE 10 TIMES
060023,000025:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
060024,000026:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
060025,000027: 16,2000                                           BANK     16                                    
060026,000028: 16,2000                                           SETLOC   DAPS1                                 
060027,000029: 16,2000                                           BANK                                           
060028,000030: 
060029,000031: 16,2000  E6,1536                                  EBANK=   AOSQ                                  
060030,000032: 
060031,000033: 16,2000                                           COUNT*   $$/DAPID                              
060032,000034: 
060033,000035: 16,2000           00006        CHEKBITS           EXTEND                                         
060034,000036: 16,2001           00031                           READ     CHAN31                                #  IF BOTH BIT13 AND BIT14 ARE ONE, THEN
060035,000037: 16,2002           40000                           COM                                            #  THE MODE SELECT SWITCH IS IN THE OFF
060036,000038: 16,2003           74355                           MASK     BIT13-14                              #  POSITION, AND SO THE DAP SHOULD BE OFF,
060037,000039: 16,2004           00006                           EXTEND                                         #  WITH NO ATTITUDE ERROR DISPLAY.
060038,000040: 16,2005           12157                           BZF      MOREIDLE                              
060039,000041: 
060040,000042: 16,2006           41300                           CS       IMODES33                              
060041,000043: 16,2007           74746                           MASK     BIT6                                  
060042,000044: 16,2010           10000                           CCS      A                                     
060043,000045: 16,2011           12206                           TCF      JUMPDSP                               
060044,000046: 16,2012           41262                           CS       RCSFLAGS                              #  IMU NOT USABLE.  SET UP INITIALIZATION
060045,000047: 16,2013           74751                           MASK     BIT3                                  #  FLAG FOR ATT ERROR DISPLAY ROUTINE.
060046,000048: 16,2014           27262                           ADS      RCSFLAGS                              
060047,000049: 16,2015           12163                           TCF      SHUTDOWN                              
060048,000050: 
060049,000051: 16,2016           34742        CHEKMORE           CAF      BIT10                                 #  BIT 10 OF 30 IS PGNCS CONTROL OF S/C
060050,000052: 16,2017           00006                           EXTEND                                         
060051,000053: 16,2020           02030                           RAND     CHAN30                                #  BITS IN 30 ARE INVERTED
060052,000054: 16,2021           10000                           CCS      A                                     
060053,000055: 16,2022           12157                           TCF      MOREIDLE                              
060054,000056: 
060055,000057: 16,2023           00002                           RETURN                                         
060056,000058: 

Page 1399

060058,000060:                                                                                                  #  DAPIDLER ENTRY.
060059,000061: 
060060,000062: 16,2024           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
060061,000063: 16,2025           00006                           EXTEND                                         
060062,000064: 16,2026           22012                           QXCH     QRUPT                                 
060063,000065: 
060064,000066: 16,2027           31262                           CA       RCSFLAGS                              
060065,000067: 16,2030           74737                           MASK     BIT13                                 
060066,000068: 16,2031           10000                           CCS      A                                     #  CHECK IF 1/ACCJOB HAS BEEN SET UP SINCE
060067,000069: 16,2032           12041                           TCF      CHECKUP                               #  THE LAST FRESH START OR RESTART.
060068,000070: 16,2033           34737                           CA       BIT13                                 
060069,000071: 16,2034           27262                           ADS      RCSFLAGS                              #  BIT 13 IS 1.
060070,000072: 16,2035           37720                           CAF      PRIO27                                
060071,000073: 16,2036           05072                           TC       NOVAC                                 #  SET UP JOB TO DO A LITTLE INITIALIZATION
060072,000074: 16,2037  E6,1536                                  EBANK=   AOSQ                                  #    AND EXECUTE 1/ACCS.
060073,000075: 16,2037           03423 42106                     2CADR    1/ACCSET                              #  (WILL BRANCH TO MOREIDLE ON ACCSOKAY)
060074,000076: 
060075,000077: 
060076,000078: 16,2041           02000        CHECKUP            TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON AND
060077,000079:                                                                                                  #    DO ERROR DISPLAY.
060078,000080: 
060079,000081: 16,2042           30111                           CAE      DAPBOOLS                              #  IF 1/ACCS HAS NOT BEEN COMPLETED, IDLE.
060080,000082: 16,2043           74751                           MASK     ACCSOKAY                              #    NOTE: ONLY FRESH START AND RESTART
060081,000083: 16,2044           00006                           EXTEND                                         #          KNOCK THIS BIT DOWN.
060082,000084: 16,2045           12157                           BZF      MOREIDLE                              
060083,000085: 
060084,000086: 16,2046           04674        STARTDAP           TC       IBNKCALL                              #  ZERO ATTITUDE ERROR AND DESIRED RATES.
060085,000087: 16,2047           40154                           FCADR    ZATTEROR                              
060086,000088: 16,2050           34755                           CAF      ZERO                                  #  ********** INITIALIZE: **********
060087,000089: 16,2051           55524                           TS       TJP                                   
060088,000090: 16,2052           55525                           TS       TJU                                   
060089,000091: 16,2053           55526                           TS       TJV                                   
060090,000092: 16,2054           55421                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
060091,000093: 16,2055           55422                           TS       OMEGAQ                                
060092,000094: 16,2056           55423                           TS       OMEGAR                                
060093,000095: 16,2057           55430                           TS       TRAPEDP                               
060094,000096: 16,2060           55431                           TS       TRAPEDQ                               
060095,000097: 16,2061           55432                           TS       TRAPEDR                               
060096,000098: 16,2062           55536                           TS       AOSQ                                  #  OFFSET ACCELERATION ESTIMATES.
060097,000099: 16,2063           55537                           TS       AOSQ       +1                         
060098,000100: 16,2064           55540                           TS       AOSR                                  
060099,000101: 16,2065           55541                           TS       AOSR       +1                         
060100,000102: 16,2066           55424                           TS       ALPHAQ                                #  COPIES OF OFFSET ESTIMATES FOR DOWNLIST.
060101,000103: 16,2067           55425                           TS       ALPHAR                                
060102,000104: 16,2070           55501                           TS       NEGUQ                                 
060103,000105: 16,2071           55503                           TS       NEGUR                                 
060104,000106: 16,2072           55544                           TS       AOSQTERM                              #  QRAXIS RATE DERIVATION TERMS AND KALMAN
060105,000107: 16,2073           55545                           TS       AOSRTERM                              #  FILTER INITIALIZATION TERMS.
060106,000108: 16,2074           55510                           TS       QACCDOT                               #  DESCENT ACCELERATION DERIVATIVE EST.
060107,000109: 16,2075           55512                           TS       RACCDOT                               

Page 1400

060109,000111: 16,2076           55502                           TS       ALLOWGTS                              #  AOSTASK FLAG FOR QRAXIS RCS CONTROL USE.
060110,000112: 16,2077           55630                           TS       COTROLER                              #  DO TRYGTS ON FIRST PASS (WILL GO TO RCS)
060111,000113: 16,2100           55632                           TS       INGTS                                 #  RECOGNIZE FIRST GTS PASS AS SUCH.
060112,000114: 16,2101           55631                           TS       QGIMTIMR                              #  STOP GIMBAL DRIVES.  (PROBABLY WOULD BE
060113,000115: 16,2102           55633                           TS       RGIMTIMR                              #    GOOD ENOUGH JUST TO INACTIVATE TIMERS)
060114,000116: 16,2103           55460                           TS       OLDPMIN                               #  MINIMUM IMPULSE MODE ERASABLES
060115,000117: 16,2104           55461                           TS       OLDQRMIN                              
060116,000118: 16,2105           55766                           TS       PJETCTR                               #  INITIALIZE DOCKED JET INHIBITION
060117,000119: 16,2106           55767                           TS       UJETCTR                               #  COUNTERS
060118,000120: 16,2107           55770                           TS       VJETCTR                               
060119,000121: 16,2110     4747               CALLGMBL           EQUALS   BIT5                                  #  RCSFLAGS INITIALIZATION.
060120,000122: 16,2110           42202                           CS       MANFLAG                               
060121,000123: 16,2111           71262                           MASK     RCSFLAGS                              #  NEGUQ(R) HAVE BEEN GENERATED.
060122,000124: 16,2112           55262                           TS       RCSFLAGS                              
060123,000125: 
060124,000126:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
060125,000127: 
060126,000128: 16,2113           00006                           EXTEND                                         
060127,000129: 16,2114           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
060128,000130: 16,2115           53441                           DXCH     OLDXFORP                              
060129,000131: 16,2116           30034                           CA       CDUZ                                  
060130,000132: 16,2117           55442                           TS       OLDZFORQ                              
060131,000133: 16,2120           41262                           CS       RCSFLAGS                              
060132,000134: 16,2121           74740                           MASK     BIT12                                 
060133,000135: 16,2122           27262                           ADS      RCSFLAGS                              #  BIT 12 SET TO 1.
060134,000136: 16,2123           34751                           CA       FOUR                                  
060135,000137: 16,2124           55534                           TS       SKIPU                                 
060136,000138: 16,2125           55535                           TS       SKIPV                                 
060137,000139: 16,2126           34733                           CA       POSMAX                                
060138,000140: 16,2127           54031                           TS       TIME6                                 
060139,000141: 16,2130           55466                           TS       T6NEXT                                
060140,000142: 16,2131           55470                           TS       T6FURTHA                              
060141,000143: 16,2132           34755                           CA       ZERO                                  
060142,000144: 16,2133           55467                           TS       T6NEXT     +1                         
060143,000145: 16,2134           55471                           TS       T6FURTHA   +1                         
060144,000146: 16,2135           55465                           TS       NXT6ADR                               
060145,000147: 16,2136           55472                           TS       NEXTP                                 
060146,000148: 16,2137           55473                           TS       NEXTU                                 
060147,000149: 16,2140           55474                           TS       NEXTV                                 
060148,000150: 16,2141           44363                           CS       TEN                                   
060149,000151: 16,2142           55756                           TS       DAPZRUPT                              #  JASK NOT IN PROGRESS, INITIALIZE NEG.
060150,000152: 16,2143           34752                           CA       TWO                                   
060151,000153: 16,2144           55433                           TS       NPTRAPS                               
060152,000154: 16,2145           55434                           TS       NQTRAPS                               
060153,000155: 16,2146           55435                           TS       NRTRAPS                               
060154,000156: 16,2147           00006                           EXTEND                                         
060155,000157: 16,2150           32205                           DCA      PAXADIDL                              
060156,000158: 16,2151           53264                           DXCH     T5ADR                                 
060157,000159: 16,2152           37732        SETTIME5           CAF      MS100                                 
060158,000160: 16,2153           54030                           TS       TIME5                                 

Page 1401

060160,000162: 16,2154           15301                           TCF      RESUME                                
060161,000163: 16,2155  E6,1536                                  EBANK=   AOSQ                                  
060162,000164: 16,2155           02024 34106  IDLERADR           2CADR    DAPIDLER                              
060163,000165: 
060164,000166: 16,2157           04674        MOREIDLE           TC       IBNKCALL                              #  CALCULATE Q,R-AXES ATTITUDE ERRORS.
060165,000167: 16,2160           36655                           CADR     QERRCALC                              
060166,000168: 
060167,000169: 16,2161           04674                           TC       IBNKCALL                              
060168,000170: 16,2162           35451                           CADR     CALCPERR                              #  CALCULATE P AXIS ATTITUDE ERRORS.
060169,000171: 
060170,000172: 16,2163           00006        SHUTDOWN           EXTEND                                         
060171,000173: 16,2164           32156                           DCA      IDLERADR                              
060172,000174: 16,2165           53264                           DXCH     T5ADR                                 
060173,000175: 
060174,000176: 16,2166           34755                           CAF      ZERO                                  #  KILL ANY POSSIBLE JET REQUESTS
060175,000177: 16,2167           55472                           TS       NEXTP                                 
060176,000178: 16,2170           55473                           TS       NEXTU                                 
060177,000179: 16,2171           55474                           TS       NEXTV                                 
060178,000180: 16,2172           00006                           EXTEND                                         #  COMMAND JETS OFF.
060179,000181: 16,2173           01005                           WRITE    CHAN5                                 
060180,000182: 16,2174           00006                           EXTEND                                         
060181,000183: 16,2175           01006                           WRITE    CHAN6                                 
060182,000184: 16,2176           42203                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
060183,000185: 16,2177           00006                           EXTEND                                         
060184,000186: 16,2200           03012                           WAND     CHAN12                                
060185,000187: 16,2201           12152                           TCF      SETTIME5                              #  RETURN IN 100 MSEC.
060186,000188: 
060187,000189: 16,2202           03021        MANFLAG            OCT      03021                                 
060188,000190: 16,2203           07400        BGIM23             OCTAL    07400                                 
060189,000191: 16,2204  E6,1421                                  EBANK=   OMEGAP                                
060190,000192: 16,2204           02213 34106  PAXADIDL           2CADR    PAXIS                                 
060191,000193: 
060192,000194: 16,2206     7732               MS100              =        OCT37766                              
060193,000195: 16,2206     0061               COSMG              =        ITEMP1                                
060194,000196: 16,2206           00006        JUMPDSP            EXTEND                                         #  TRANSFER TO BANK 20
060195,000197: 16,2207           32212                           DCA      DSPCADR                               #  FOR ATTITUDE ERROR DISPLAYS
060196,000198: 16,2210           52006                           DTCB                                           
060197,000199: 
060198,000200: 16,2211  E6,1760                                  EBANK=   AK                                    
060199,000201: 16,2211           02227 40106  DSPCADR            2CADR    ALTDSPLY                              
060200,000202: 

Page 1402

060202,000204: 20,2227                                           BANK     20                                    
060203,000205: 20,2000                                           SETLOC   DAPS3                                 
060204,000206: 20,2000                                           BANK                                           
060205,000207: 20,2227                                           COUNT*   $$/NEEDL                              
060206,000208: 
060207,000209:                                                                                                  #  PROGRAM: ALTDSPLY
060208,000210: 
060209,000211:                                                                                                  #  MOD 0.  6 DEC 1967
060210,000212: 
060211,000213:                                                                                                  #  AUTHOR:  CRAIG WORK, DON KEENE, MIT IL
060212,000214: 
060213,000215:                                                                                                  #  MOD 3 BY DON KEENE AUG 1, 1968 MOVED PROGRAM TO BANK 20
060214,000216: 
060215,000217:                                                                                                  #  PROGRAM DESCRIPTION:
060216,000218: 
060217,000219:                                                                                                  #  ALTDSPLY REVERSES THE DSPLYALT BIT OF RCSFLAGS EACH TIME IT IS CALLED, WHICH IS PRESUMABLY EVERY 100 MS.
060218,000220:                                                                                                  #  IF THE REVERSED BIT IS ONE, NEEDLER IS CALLED TO DISPLAY ATTITUDE ERRORS.  IF THE BIT IS ZERO, THE ATTITUDE ERR-
060219,000221:                                                                                                  #  ORS ARE CALCULATED AS 1) ESTIMATED RATES (FOLLOWING) IF NEED2FLG = 1, OTHERWISE AS 2) DAP FOLLOWING ERRORS FOR
060220,000222:                                                                                                  #  NEEDLFLG = 0 AND 3) TOTAL ATTITUDE ERRORS FOR NEEDLFLG = 1.
060221,000223: 
060222,000224:                                                                                                  #  WARNING:  ALTDSPLY MAY ONLY BE CALLED WITH INTERRUPT INHIBITED.
060223,000225: 
060224,000226:                                                                                                  #  WARNING:  EBANK MUST BE SET TO 6 WHEN USING THIS ROUTINE.
060225,000227: 
060226,000228:                                                                                                  #  INPUT:  RCSFLAGS AND 1) IF NEEDLFLG=0, INPUT PERROR,QERROR,RERROR.
060227,000229:                                                                                                  #                       2) IF NEEDLFLG=1, INPUT CPHI,CTHETA,CPSI,CDUX,CDUY,CDUZ,M11,M21,M32,M22,M32. (GPMATRIX)
060228,000230: 
060229,000231:                                                                                                  #               3) IF NEED2FLG = 1, INPUT OMEGAP, OMEGAQ, AND OMEGAR.
060230,000232: 
060231,000233:                                                                                                  #  OUTPUTS:  RCSFLAGS WITH DSPLYALT REVERSED,AK,AK1,AK2,+ NEEDLER OUTPUTS.
060232,000234: 
060233,000235:                                                                                                  #  ENTRY:   TCF    ALTDSPLY
060234,000236: 
060235,000237:                                                                                                  #  EXIT:    TCF    CHEKMORE
060236,000238: 
060237,000239:                                                                                                  #  ALARM OR ABORT EXITS:  NONE
060238,000240: 
060239,000241:                                                                                                  #  SUBPROGRAMS CALLED: NEEDLER, OVERSUB2
060240,000242: 
060241,000243:                                                                                                  #  DEBRIS:  A,L,AND NEEDLER DEBRIS.
060242,000244: 
060243,000245: 20,2227           31262        ALTDSPLY           CA       RCSFLAGS                              #  INVERT THE DISPLAY ALTERNATION BIT.
060244,000246: 20,2230           54001                           TS       L                                     
060245,000247: 20,2231           34750                           CA       DSPLYALT                              
060246,000248: 20,2232           00006                           EXTEND                                         
060247,000249: 20,2233           06001                           RXOR     LCHAN                                 
060248,000250: 20,2234           55262                           TS       RCSFLAGS                              
060249,000251: 
060250,000252: 20,2235           74750                           MASK     DSPLYALT                              
060251,000253: 20,2236           10000                           CCS      A                                     #  IS ALTERNATION FLAG ZERO?

Page 1403

060253,000255: 20,2237           12336                           TCF      NEEDLER                               
060254,000256: 
060255,000257: 20,2240           40074                           CS       FLAGWRD0                              #  CHECK FOR RATE DISPLAY TO ERROR NEEDLES
060256,000258: 20,2241           74735                           MASK     NEED2BIT                              #  VIA EXTENDED VERB 60
060257,000259: 20,2242           00006                           EXTEND                                         
060258,000260: 20,2243           12257                           BZF      DISPRATE                              
060259,000261: 
060260,000262: 20,2244           30074                           CAE      FLAGWRD0                              #  NEEDLFLG WILL INDICATE TOTAL OR DAP AT-
060261,000263: 20,2245           74750                           MASK     NEEDLBIT                              #  TITUDE ERROR DISPLAY REQUEST.
060262,000264: 20,2246           10000                           CCS      A                                     
060263,000265: 20,2247           12266                           TCF      DSPLYTOT                              #  TOTAL ERROR IS NEEDED IN AK,AK +1,AK +2
060264,000266: 
060265,000267: 20,2250           41450                           CS       QERROR                                #  YES. DISPLAY ATT ERRORS ON THE ,-BALL.
060266,000268: 20,2251           55761                           TS       AK         +1                         #  ERROR COMPLEMENTS ARE INPUT TO NEEDLER.
060267,000269: 20,2252           41452                           CS       RERROR                                
060268,000270: 20,2253           55762                           TS       AK         +2                         
060269,000271: 20,2254           41464                           CS       PERROR                                
060270,000272: 20,2255           57760                           XCH      AK                                    
060271,000273: 
060272,000274: 20,2256           12456                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
060273,000275: 
060274,000276: 20,2257           41422        DISPRATE           CS       OMEGAQ                                #  LOAD ESTIMATED RATES (FOLLOWING)
060275,000277: 20,2260           55761                           TS       AK         +1                         
060276,000278: 20,2261           41423                           CS       OMEGAR                                
060277,000279: 20,2262           55762                           TS       AK         +2                         
060278,000280: 20,2263           41421                           CS       OMEGAP                                
060279,000281: 20,2264           57760                           XCH      AK                                    
060280,000282: 20,2265           12456                           TCF      RETNMORE                              
060281,000283: 
060282,000284:                                                                                                  #  CALCULATE GIMBAL ANGLE TOTAL ERRORS, RESOLVE INTO PILOT AXES, STORE TOTAL ERRORS FOR NEEDLER.  Q-AXIS FIRST.
060283,000285: 
060284,000286: 20,2266           00006        DSPLYTOT           EXTEND                                         
060285,000287: 20,2267           22061                           QXCH     ITEMP1                                #  SAVE Q FOR CHEKBITS RETURN.
060286,000288: 
060287,000289: 20,2270           30322                           CA       CTHETA                                #  DESIRED ATTITUDE, Y-AXIS, 2'S COMP.
060288,000290: 20,2271           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
060289,000291: 20,2272           20033                           MSU      CDUY                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
060290,000292: 20,2273           55760                           TS       AK                                    #  SAVE FOR R-ERROR CALCULATION.
060291,000293: 20,2274           00006                           EXTEND                                         
060292,000294: 20,2275           71415                           MP       M21                                   #  (CHTETA-CDUY)*M21 SCALED AT PI RADIANS.
060293,000295: 20,2276           57761                           XCH      AK         +1                         #  STORE FIRST TERM OF Q ERROR.
060294,000296: 20,2277           30323                           CA       CPSI                                  #  DESIRED ATTITUDE, Z-AXIS, 2'S COMP.
060295,000297: 20,2300           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
060296,000298: 20,2301           20034                           MSU      CDUZ                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
060297,000299: 20,2302           55762                           TS       AK         +2                         #  SAVE Z-AXIS TERM FOR R ERROR CALCULATION
060298,000300: 20,2303           00006                           EXTEND                                         
060299,000301: 20,2304           71417                           MP       M22                                   #  (CPSI-CDUZ)*M22, SCALED AT PI RADIANS.
060300,000302: 20,2305           61761                           AD       AK         +1                         #  Q ERROR COMPLETE         , AT PI RAD.
060301,000303: 20,2306           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
060302,000304: 20,2307           55761                           TS       AK         +1                         
060303,000305: 

Page 1404

060305,000307:                                                                                                  #  R ERROR CALCULATION NEXT.
060306,000308: 
060307,000309: 20,2310           31760                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q-AXIS CALC.
060308,000310: 20,2311           00006                           EXTEND                                         
060309,000311: 20,2312           71416                           MP       M31                                   #  (CTHETA-CDUY)*M31, SCALED AT PI RADIANS.
060310,000312: 20,2313           57762                           XCH      AK         +2                         #  FIRST TERM OF R ERROR.
060311,000313:                                                                                                  #  Z-AXIS DIFFERENCE, STORED BY A CALC. IS
060312,000314: 20,2314           00006                           EXTEND                                         #  RECOVERED BY THE EXCHANGE.
060313,000315: 20,2315           71420                           MP       M32                                   #  (CPSI-CDUZ)*M32, SCALED AT PI RADIANS.
060314,000316: 20,2316           61762                           AD       AK         +2                         #  R ERROR COMPLETE         , AT PI RAD.
060315,000317: 20,2317           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
060316,000318: 20,2320           55762                           TS       AK         +2                         
060317,000319: 
060318,000320:                                                                                                  #  NOW CALCULATE P ERROR.  (NOTE THAT M13 = 1, SCALED AT 1, SO THE MULTIPLICATION IS BY-PASSED.)
060319,000321: 
060320,000322: 20,2321           31760                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q AXIS CALC.
060321,000323: 20,2322           00006                           EXTEND                                         
060322,000324: 20,2323           71414                           MP       M11                                   #  (CTHETA-CDUY)*M11 SCALED AT PI RADIANS.
060323,000325: 20,2324           57760                           XCH      AK                                    #  FIRST TERM OF P ERROR IN AK, AT PI RAD.
060324,000326: 20,2325           30321                           CAE      CPHI                                  #  DESIRED ATTITUDE, X-AXIS, 2'S COMP.
060325,000327: 20,2326           00006                           EXTEND                                         #  SUBTRACT CURRENT X ATTITUDE.
060326,000328: 20,2327           20032                           MSU      CDUX                                  #  X-AXIS DIFFERENCE, 1'S COMP, AT PI RAD.
060327,000329: 
060328,000330:                                                                                                  #  M13 = 1, SO BYPASS THE MULTIPLICATION.
060329,000331:                                                                                                  #           EXTEND
060330,000332:                                                                                                  #           MP     M13             (CPHI-CDUX)*M13 SCALED AT PI RADIANS.
060331,000333: 
060332,000334: 20,2330           61760                           AD       AK                                    #  P ERROR COMPLETE      , SCALED AT PI RAD
060333,000335: 20,2331           02451                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
060334,000336: 20,2332           55760                           TS       AK                                    
060335,000337: 
060336,000338: 20,2333           00006                           EXTEND                                         
060337,000339: 20,2334           22061                           QXCH     ITEMP1                                #  RESTORE Q FOR CHEKBITS RETURN.
060338,000340: 
060339,000341: 20,2335           12456                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
060340,000342: 

Page 1405

060342,000344:                                                                                                  #  FDAI ATTITUDE ERROR DISPLAY SUBROUTINE
060343,000345: 
060344,000346:                                                                                                  #  PROGRAM DESCRIPTION:    D. KEENE   5/24/67
060345,000347: 
060346,000348:                                                                                                  #  MOD 1 BY CRAIG WORK, 12 DEC 67
060347,000349: 
060348,000350:                                                                                                  #  MOD 2 BY CRAIG WORK, 6 APRIL 68 CONVERTS ATTITUDE ERROR DISPLAY SCALING FROM 16 7/8 DEG. TO 42 3/16 DEGREES.
060349,000351: 
060350,000352:                                                                                                  #      THIS SUBROUTINE IS USED TO DISPLAY ATTITUDE ERRORS ON THE FDAI VIA THE DIGITAL TO ANALOG CONVERTERS (DACS)
060351,000353:                                                                                                  #  IN THE CDUS.  CARE IS TAKEN TO METER OUT THE APPROPRIATE NUMBER OF PULSES TO THE IMU ERROR COUNTERS AND PREVENT
060352,000354:                                                                                                  #  OVERFLOW, TO CONTROL THE RELAY SEQUENCING, AND TO AVOID INTERFERENCE WITH THE COARSE ALIGN LOOP WHICH ALSO USES
060353,000355:                                                                                                  #  THE DACS.
060354,000356: 
060355,000357: 
060356,000358:                                                                                                  #  CALLING SEQUENCE:
060357,000359: 
060358,000360:                                                                                                  #      DURING THE INITIALIZATION SECTION OF THE USER'S PROGRAM, BIT3 OF RCSFLAGS SHOULD BE SET TO INITIATE THE
060359,000361:                                                                                                  #  TURN-ON SEQUENCE WITHIN THE NEEDLES PROGRAM:
060360,000362: 
060361,000363:                                                                                                  #           CS     RCSFLAGS        IN EBANK6
060362,000364:                                                                                                  #           MASK   BIT3
060363,000365:                                                                                                  #           ADS    RCSFLAGS
060364,000366: 
060365,000367:                                                                                                  #  THEREAFTER, THE ATTITUDE ERRORS GENERATED BY THE USER SHOULD BE TRANSFERED TO THE FOLLOWING LOCATIONS IN EBANK6:
060366,000368: 
060367,000369:                                                                                                  #           AK     SCALED 180 DEGREES  NOTE: THESE LOCATIONS ARE SUBJECT
060368,000370:                                                                                                  #           AK1    SCALED 180 DEGREES        TO CHANGE
060369,000371:                                                                                                  #           AK2    SCALED 180 DEGREES
060370,000372: 
060371,000373:                                                                                                  #  FULL SCALED DEFLECTION OF THE NEEDLES CORRESPONDS TO 5 1/16 DEGREES, WHILE 384 BITS IN THE IMU ERROR COUNTER
060372,000374:                                                                                                  #  CORRESPONDS TO 42 3/16 DEGREES.  (DAC MAXIMUM CAPACITY IS 384 BITS.) 46 BITS EFFECTIVELY PIN THE NEEDLES.
060373,000375: 
060374,000376:                                                                                                  #  FOR RATE DISPLAY, FULL SCALE NEEDLE DEFLECTION IS 1 17/64 DEG/SEC, AND A FULL COUNTER IS ABOUT 10.5 DEG/SEC.
060375,000377:                                                                                                  #  A CALL TO NEEDLER WILL THEN UPDATE THE DISPLAY:
060376,000378: 
060377,000379:                                                                                                  #           INHINT
060378,000380:                                                                                                  #           TC     IBNKCALL        NOTE: EBANK SHOULD BE SET TO E6
060379,000381:                                                                                                  #           CADR   NEEDLER
060380,000382:                                                                                                  #           RELINT
060381,000383: 
060382,000384:                                                                                                  #      THIS PROCESS SHOULD BE REPEATED EACH TIME THE ERRORS ARE UPDATED.  AT LEAST 3 PASSES THRU THE PROGRAM ARE
060383,000385:                                                                                                  #  REQUIRED BEFORE ANYTHING IS ACTUALLY DISPLAYED ON THE ERROR METERS.
060384,000386:                                                                                                  #  NOTE: EACH CALL TO NEEDLER MUST BE SEPARATED BY AT LEAST 50MS TO ASSURE PROPER RELAY SEQUENCING.
060385,000387: 
060386,000388:                                                                                                  #  ERASABLE USED:
060387,000389:                                                                                                  #                       AK        CDUXCMD
060388,000390:                                                                                                  #                       AK1       CDUYCMD
060389,000391:                                                                                                  #                       AK2       CDUZCMD
060390,000392:                                                                                                  #                       EDRIVEX   A,L,Q
060391,000393:                                                                                                  #                       EDRIVEY   T5TEMP

Page 1406

060393,000395:                                                                                                  #                       EDRIVEZ   DINDX
060394,000396: 
060395,000397:                                                                                                  #  SWITCHES:            RCSFLAGS  BITS 3,2
060396,000398: 
060397,000399:                                                                                                  #  I/O CHANNELS:        CHAN12    BIT 4 (COARSE ALIGN - READ ONLY)
060398,000400:                                                                                                  #                       CHAN12    BIT 6 (IMU ERROR COUNTER ENABLE)
060399,000401:                                                                                                  #                       CHAN14    BIT 13,14,15 (DAC ACTIVITY)
060400,000402: 
060401,000403: 
060402,000404:                                                                                                  #  SIGN CONVENTION<   AK = THETAC - THETA
060403,000405:                                                                                                  #            WHERE    THETAC = COMMAND ANGLE
060404,000406:                                                                                                  #                     THETA  = PRESENT ANGLE
060405,000407: 
060406,000408: 
060407,000409: 20,2336           31262        NEEDLER            CA       RCSFLAGS                              
060408,000410: 20,2337           76245                           MASK     SIX                                   
060409,000411: 20,2340           00006                           EXTEND                                         
060410,000412: 20,2341           12376                           BZF      NEEDLES3                              
060411,000413: 20,2342           74751                           MASK     BIT3                                  
060412,000414: 20,2343           00006                           EXTEND                                         
060413,000415: 20,2344           12367                           BZF      NEEDLER2                              #  BIT3 = 0, BIT2 = 1
060414,000416: 
060415,000417: 20,2345           44746                           CS       BIT6                                  #  FIRST PASS BIT3 = 1
060416,000418: 20,2346           00006                           EXTEND                                         #  DISABLE IMU ERROR COUNTER TO ZERO DACS
060417,000419: 20,2347           03012                           WAND     CHAN12                                #  MUST WAIT AT LEAST 60 MS BEFORE
060418,000420: 20,2350           44755        NEEDLE11           CS       ZERO                                  #  ENABLING COUNTERS.
060419,000421: 20,2351           55760                           TS       AK                                    #  ZERO THE INPUTS ON FIRST PASS
060420,000422: 20,2352           55761                           TS       AK1                                   
060421,000423: 20,2353           55762                           TS       AK2                                   
060422,000424: 20,2354           55763                           TS       EDRIVEX                               #  ZERO THE DISPLAY REGISTERS
060423,000425: 20,2355           55764                           TS       EDRIVEY                               
060424,000426: 20,2356           55765                           TS       EDRIVEZ                               
060425,000427: 20,2357           54050                           TS       CDUXCMD                               #  ZERO THE OUT COUNTERS
060426,000428: 20,2360           54051                           TS       CDUYCMD                               
060427,000429: 20,2361           54052                           TS       CDUZCMD                               
060428,000430: 20,2362           46245                           CS       SIX                                   #  RESET RCSFLAGS FOR PASS2
060429,000431: 20,2363           71262                           MASK     RCSFLAGS                              
060430,000432: 20,2364           64752                           AD       BIT2                                  
060431,000433: 20,2365           55262                           TS       RCSFLAGS                              
060432,000434: 20,2366           12456                           TCF      RETNMORE                              
060433,000435: 
060434,000436: 20,2367           34746        NEEDLER2           CAF      BIT6                                  #  ENABLE IMU ERROR COUNTERS
060435,000437: 20,2370           00006                           EXTEND                                         
060436,000438: 20,2371           05012                           WOR      CHAN12                                
060437,000439: 20,2372           46245                           CS       SIX                                   #  RESET RCSFLAGS TO DISPLAY ATTITUDE
060438,000440: 20,2373           71262                           MASK     RCSFLAGS                              #  ERRORS    WAIT ATLEAST 4 MS FOR
060439,000441: 20,2374           55262                           TS       RCSFLAGS                              #  RELAY CLOSURE
060440,000442: 20,2375           12456                           TCF      RETNMORE                              
060441,000443: 
060442,000444: 20,2376           34746        NEEDLES3           CAF      BIT6                                  #  CHECK TO SEE IF IMU ERROR COUNTER

Page 1407

060444,000446: 20,2377           00006                           EXTEND                                         #  IS ENABLED
060445,000447: 20,2400           02012                           RAND     CHAN12                                
060446,000448: 20,2401           10000                           CCS      A                                     #  IF NOT, RE-INITIALIZE NEEDLER.
060447,000449: 20,2402           12407                           TCF      NEEDLES                               
060448,000450: 
060449,000451: 20,2403           41262                           CS       RCSFLAGS                              #  SET UP INITIALIZATION FLAG IN RCSFLAGS.
060450,000452: 20,2404           74751                           MASK     BIT3                                  
060451,000453: 20,2405           27262                           ADS      RCSFLAGS                              
060452,000454: 20,2406           12456                           TCF      RETNMORE                              
060453,000455: 
060454,000456: 20,2407           34752        NEEDLES            CAF      TWO                                   
060455,000457: 20,2410           54063        DACLOOP            TS       DINDX                                 
060456,000458: 20,2411           42450                           CS       ONETENTH                              #  RESCALE INPUTS TO + OR - 1800 DEGREES.
060457,000459: 20,2412           00006                           EXTEND                                         
060458,000460: 20,2413           50063                           INDEX    DINDX                                 
060459,000461: 20,2414           71760                           MP       AK                                    
060460,000462: 20,2415           54001                           TS       L                                     
060461,000463: 20,2416           10000                           CCS      A                                     
060462,000464: 20,2417           32446                           CA       DACLIMIT                              
060463,000465: 20,2420           12422                           TCF      +2                                    
060464,000466: 20,2421           42446                           CS       DACLIMIT                              
060465,000467: 20,2422           60001                           AD       L                                     
060466,000468: 20,2423           54061                           TS       T5TEMP                                #  OVFLO CHK
060467,000469: 20,2424           12430                           TCF      +4                                    
060468,000470: 20,2425           50000                           INDEX    A                                     #  ON OVERFLOW LIMIT OUTPUT TO +-384
060469,000471: 20,2426           32446                           CAF      DACLIMIT                              
060470,000472: 20,2427           54001                           TS       L                                     
060471,000473: 20,2430           50063                           INDEX    DINDX                                 
060472,000474: 20,2431           41763                           CS       EDRIVEX                               #  CURRENT VALUE OF DAC
060473,000475: 20,2432           60001                           AD       L                                     
060474,000476: 20,2433           50063                           INDEX    DINDX                                 
060475,000477: 20,2434           26050                           ADS      CDUXCMD                               
060476,000478: 20,2435           50063                           INDEX    DINDX                                 
060477,000479: 20,2436           23763                           LXCH     EDRIVEX                               
060478,000480: 20,2437           10063                           CCS      DINDX                                 
060479,000481: 20,2440           12410                           TCF      DACLOOP                               
060480,000482: 20,2441           37743                           CAF      13,14,15                              
060481,000483: 20,2442           00006                           EXTEND                                         
060482,000484: 20,2443           05014                           WOR      CHAN14                                #  SET DAC ACTIVITY BITS
060483,000485: 20,2444           12456                           TCF      RETNMORE                              
060484,000486: 
060485,000487: 20,2445           77177                           DEC      -384       B-14                       
060486,000488: 20,2446           37200        DACLIMIT           DEC      16000      B-14                       
060487,000489: 20,2447           00600                           DEC      384        B-14                       
060488,000490: 
060489,000491: 20,2450           03146        ONETENTH           OCT      03146                                 #  DECIMAL  +0.1, SCALED AT 1.
060490,000492: 20,2451     4750               DSPLYALT           EQUALS   BIT4                                  #  100 MS ALTERNATION BIT IN RCSFLAGS
060491,000493: 
060492,000494: 
060493,000495: 20,2451           54007        OVERSUB2           TS       7                                     #  RETURNS  A  UNCHANGED  OR LIMITED TO

Page 1408

060495,000497: 20,2452           00002                           TC       Q                                     #  POSMAX OR NEGMAX IF A HAS OVERFLOW
060496,000498: 20,2453           50000                           INDEX    A                                     
060497,000499: 20,2454           44734                           CS       LIMITS                                #  DUPLICATE CODING IN BANK 16
060498,000500: 20,2455           00002                           TC       Q                                     
060499,000501: 
060500,000502: 
060501,000503: 20,2456           00006        RETNMORE           EXTEND                                         #  RETURN TO CHEKMORE
060502,000504: 20,2457           32462                           DCA      MORECADR                              
060503,000505: 20,2460           52006                           DTCB                                           
060504,000506: 
060505,000507: 20,2461  E6,1536                                  EBANK=   AOSQ                                  
060506,000508: 20,2461           02016 34106  MORECADR           2CADR    CHEKMORE                              
060507,000509: 

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