Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

060970,000002:                                                                                                  ## Copyright:   Public domain.
060971,000003:                                                                                                  ## Filename:    DAPIDLER_PROGRAM.agc
060972,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
060973,000005:                                                                                                  ##              It is part of the source code for the original release
060974,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
060975,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
060976,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
060977,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
060978,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
060979,000011:                                                                                                  ##              that the code format has been changed to conform to the
060980,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
060981,000013:                                                                                                  ##              original YUL assembler.
060982,000014:                                                                                                  ## Reference:   pp. 1405-1415
060983,000015:                                                                                                  ## Assembler:   yaYUL
060984,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060985,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060986,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
060987,000019:                                                                                                  ##              2016-12-18 MAS  Updated from comment-proofed Luminary 99 version.
060988,000020:                                                                                                  ##              2016-12-23 RRB  Updated for Luminary 69.
060989,000021:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
060990,000022:                                                                                                  ##                              and fixed errors found.
060991,000023: 

Page 1405

060993,000025:                                                                                                  #  THE DAPIDLER PROGRAM IS STARTED BY FRESH START AND RESTART.  THE DAPIDLER PROGRAM IS DONE 10 TIMES
060994,000026:                                                                                                  #  PER SECOND UNTIL THE ASTRONAUT DESIRES THE DAP TO WAKE UP, AND THE IMU AND CDUS ARE READY FOR USE BY THE DAP.
060995,000027:                                                                                                  #  THE NECESSARY INITIALIZATION OF THE DAP IS DONE BY THE DAPIDLER PROGRAM.
060996,000028: 
060997,000029: 16,2000                                           BANK     16                                    
060998,000030: 16,2000                                           SETLOC   DAPS1                                 
060999,000031: 16,2000                                           BANK                                           
061000,000032: 
061001,000033: 16,2000  E6,1537                                  EBANK=   AOSQ                                  
061002,000034: 
061003,000035: 16,2000                                           COUNT*   $$/DAPID                              
061004,000036: 
061005,000037: 16,2000           00006        CHEKBITS           EXTEND                                         
061006,000038: 16,2001           00031                           READ     CHAN31                                #  IF BOTH BIT13 AND BIT14 ARE ONE, THEN
061007,000039: 16,2002           40000                           COM                                            #  THE MODE SELECT SWITCH IS IN THE OFF
061008,000040: 16,2003           74355                           MASK     BIT13-14                              #  POSITION, AND SO THE DAP SHOULD BE OFF,
061009,000041: 16,2004           00006                           EXTEND                                         #  WITH NO ATTITUDE ERROR DISPLAY.
061010,000042: 16,2005           12154                           BZF      MOREIDLE                              
061011,000043: 
061012,000044: 16,2006           41303                           CS       IMODES33                              
061013,000045: 16,2007           74746                           MASK     BIT6                                  
061014,000046: 16,2010           10000                           CCS      A                                     
061015,000047: 16,2011           12203                           TCF      JUMPDSP                               
061016,000048: 16,2012           41273                           CS       RCSFLAGS                              #  IMU NOT USABLE.  SET UP INITIALIZATION
061017,000049: 16,2013           74751                           MASK     BIT3                                  #  FLAG FOR ATT ERROR DISPLAY ROUTINE.
061018,000050: 16,2014           27273                           ADS      RCSFLAGS                              
061019,000051: 16,2015           12160                           TCF      SHUTDOWN                              
061020,000052: 
061021,000053: 16,2016           34742        CHEKMORE           CAF      BIT10                                 #  BIT 10 OF 30 IS PGNCS CONTROL OF S/C
061022,000054: 16,2017           00006                           EXTEND                                         
061023,000055: 16,2020           02030                           RAND     CHAN30                                #  BITS IN 30 ARE INVERTED
061024,000056: 16,2021           10000                           CCS      A                                     
061025,000057: 16,2022           12154                           TCF      MOREIDLE                              
061026,000058: 
061027,000059: 16,2023           00002                           RETURN                                         
061028,000060: 

Page 1406

061030,000062:                                                                                                  #  DAPIDLER ENTRY.
061031,000063: 
061032,000064: 16,2024           22016        DAPIDLER           LXCH     BANKRUPT                              #  INTERRUPT LEAD INS (CONTINUED)
061033,000065: 16,2025           00006                           EXTEND                                         
061034,000066: 16,2026           22012                           QXCH     QRUPT                                 
061035,000067: 
061036,000068: 16,2027           31273                           CA       RCSFLAGS                              
061037,000069: 16,2030           74737                           MASK     BIT13                                 
061038,000070: 16,2031           10000                           CCS      A                                     #  CHECK IF 1/ACCJOB HAS BEEN SET UP SINCE
061039,000071: 16,2032           12041                           TCF      CHECKUP                               #  THE LAST FRESH START OR RESTART.
061040,000072: 16,2033           34737                           CA       BIT13                                 
061041,000073: 16,2034           27273                           ADS      RCSFLAGS                              #  BIT 13 IS 1.
061042,000074: 16,2035           37714                           CAF      PRIO27                                
061043,000075: 16,2036           05072                           TC       NOVAC                                 #  SET UP JOB TO DO A LITTLE INITIALIZATION
061044,000076: 16,2037  E6,1537                                  EBANK=   AOSQ                                  #        AND EXECUTE 1/ACCS.
061045,000077: 16,2037           02447 40106                     2CADR    1/ACCSET                              #  (WILL BRANCH TO MOREIDLE ON ACCSOKAY)
061046,000078: 
061047,000079: 16,2041           02000        CHECKUP            TC       CHEKBITS                              #  CHECK TO SEE IF LM DAP IS TO GO ON AND
061048,000080:                                                                                                  #        DO ERROR DISPLAY.
061049,000081: 
061050,000082: 16,2042           30111                           CAE      DAPBOOLS                              #  IF 1/ACCS HAS NOT BEEN COMPLETED, IDLE.
061051,000083: 16,2043           74751                           MASK     ACCSOKAY                              #        NOTE:   ONLY FRESH START AND RESTART
061052,000084: 16,2044           00006                           EXTEND                                         #                KNOCK THIS BIT DOWN.
061053,000085: 16,2045           12154                           BZF      MOREIDLE                              
061054,000086: 
061055,000087: 16,2046           04674        STARTDAP           TC       IBNKCALL                              #  ZERO ATTITUDE ERROR AND DESIRED RATES.
061056,000088: 16,2047           40153                           FCADR    ZATTEROR                              
061057,000089: 16,2050           34755                           CAF      ZERO                                  #  ********** INITIALIZE: **********
061058,000090: 16,2051           55524                           TS       TJP                                   
061059,000091: 16,2052           55525                           TS       TJU                                   
061060,000092: 16,2053           55526                           TS       TJV                                   
061061,000093: 16,2054           55417                           TS       OMEGAP                                #  RATES IN BODY (PILOT) COORDINATES.
061062,000094: 16,2055           55420                           TS       OMEGAQ                                
061063,000095: 16,2056           55421                           TS       OMEGAR                                
061064,000096: 16,2057           55426                           TS       TRAPEDP                               
061065,000097: 16,2060           55427                           TS       TRAPEDQ                               
061066,000098: 16,2061           55430                           TS       TRAPEDR                               
061067,000099: 16,2062           55537                           TS       AOSQ                                  #  OFFSET ACCELERATION ESTIMATES.
061068,000100: 16,2063           55540                           TS       AOSQ       +1                         
061069,000101: 16,2064           55541                           TS       AOSR                                  
061070,000102: 16,2065           55542                           TS       AOSR       +1                         
061071,000103: 16,2066           55422                           TS       ALPHAQ                                #  COPIES OF OFFSET ESTIMATES FOR DOWNLIST.
061072,000104: 16,2067           55423                           TS       ALPHAR                                
061073,000105: 16,2070           55500                           TS       NEGUQ                                 
061074,000106: 16,2071           55502                           TS       NEGUR                                 
061075,000107: 16,2072           55545                           TS       AOSQTERM                              #  QRAXIS RATE DERIVATION TERMS AND KALMAN
061076,000108: 16,2073           55546                           TS       AOSRTERM                              #  FILTER INITIALIZATION TERMS.
061077,000109: 16,2074           55510                           TS       QACCDOT                               #  DESCENT ACCELERATION DERIVATIVE EST.
061078,000110: 16,2075           55512                           TS       RACCDOT                               

Page 1407

061080,000112: 16,2076           55501                           TS       ALLOWGTS                              #  AOSTASK FLAG FOR QRAXIS RCS CONTROL USE.
061081,000113: 16,2077           55627                           TS       COTROLER                              #  DO TRYGTS ON FIRST PASS (WILL GO TO RCS)
061082,000114: 16,2100           55631                           TS       INGTS                                 #  RECOGNIZE FIRST GTS PASS AS SUCH.
061083,000115: 16,2101           55630                           TS       QGIMTIMR                              #  STOP GIMBAL DRIVES.  (PROBABLY WOULD BE
061084,000116: 16,2102           55632                           TS       RGIMTIMR                              #        GOOD ENOUGH JUST TO INACTIVATE TIMERS)
061085,000117: 16,2103           55456                           TS       OLDPMIN                               #  MINIMUM IMPULSE MODE ERASABLES
061086,000118: 16,2104           55457                           TS       OLDQRMIN                              
061087,000119: 16,2105     4747               CALLGMBL           EQUALS   BIT5                                  #  RCSFLAGS INITIALIZATION.
061088,000120: 16,2105           42177                           CS       MANFLAG                               
061089,000121: 16,2106           71273                           MASK     RCSFLAGS                              #  NEGUQ(R) HAVE BEEN GENERATED.
061090,000122: 16,2107           55273                           TS       RCSFLAGS                              
061091,000123: 
061092,000124:                                                                                                  #  SET UP "OLD" MEASURED CDU ANGLES:
061093,000125: 
061094,000126: 16,2110           00006                           EXTEND                                         
061095,000127: 16,2111           30033                           DCA      CDUX                                  #  OLDXFORP AND OLDYFORP
061096,000128: 16,2112           53437                           DXCH     OLDXFORP                              
061097,000129: 16,2113           30034                           CA       CDUZ                                  
061098,000130: 16,2114           55440                           TS       OLDZFORQ                              
061099,000131: 16,2115           41273                           CS       RCSFLAGS                              
061100,000132: 16,2116           74740                           MASK     BIT12                                 
061101,000133: 16,2117           27273                           ADS      RCSFLAGS                              #  BIT 12 SET TO 1.
061102,000134: 16,2120           34751                           CA       FOUR                                  
061103,000135: 16,2121           55535                           TS       SKIPU                                 
061104,000136: 16,2122           55536                           TS       SKIPV                                 
061105,000137: 16,2123           34733                           CA       POSMAX                                
061106,000138: 16,2124           54031                           TS       TIME6                                 
061107,000139: 16,2125           55464                           TS       T6NEXT                                
061108,000140: 16,2126           55466                           TS       T6FURTHA                              
061109,000141: 16,2127           34755                           CA       ZERO                                  
061110,000142: 16,2130           55465                           TS       T6NEXT     +1                         
061111,000143: 16,2131           55467                           TS       T6FURTHA   +1                         
061112,000144: 16,2132           55463                           TS       NXT6ADR                               
061113,000145: 16,2133           55470                           TS       NEXTP                                 
061114,000146: 16,2134           55471                           TS       NEXTU                                 
061115,000147: 16,2135           55472                           TS       NEXTV                                 
061116,000148: 16,2136           44363                           CS       TEN                                   
061117,000149: 16,2137           55755                           TS       DAPZRUPT                              #  JASK NOT IN PROGRESS, INITIALIZE NEG.
061118,000150: 16,2140           34752                           CA       TWO                                   
061119,000151: 16,2141           55431                           TS       NPTRAPS                               
061120,000152: 16,2142           55432                           TS       NQTRAPS                               
061121,000153: 16,2143           55433                           TS       NRTRAPS                               
061122,000154: 16,2144           00006                           EXTEND                                         
061123,000155: 16,2145           32202                           DCA      PAXADIDL                              
061124,000156: 16,2146           53275                           DXCH     T5ADR                                 
061125,000157: 16,2147           37726        SETTIME5           CAF      MS100                                 
061126,000158: 16,2150           54030                           TS       TIME5                                 
061127,000159: 16,2151           15270                           TCF      RESUME                                
061128,000160: 16,2152  E6,1537                                  EBANK=   AOSQ                                  
061129,000161: 16,2152           02024 34106  IDLERADR           2CADR    DAPIDLER                              

Page 1408

061131,000163: 16,2154           04674        MOREIDLE           TC       IBNKCALL                              #  CALCULATE Q,R-AXES ATTITUDE ERRORS.
061132,000164: 16,2155           36563                           CADR     QERRCALC                              
061133,000165: 
061134,000166: 16,2156           04674                           TC       IBNKCALL                              
061135,000167: 16,2157           35425                           CADR     CALCPERR                              #  CALCULATE P AXIS ATTITUDE ERRORS.
061136,000168: 
061137,000169: 16,2160           00006        SHUTDOWN           EXTEND                                         
061138,000170: 16,2161           32153                           DCA      IDLERADR                              
061139,000171: 16,2162           53275                           DXCH     T5ADR                                 
061140,000172: 
061141,000173: 16,2163           34755                           CAF      ZERO                                  #  KILL ANY POSSIBLE JET REQUESTS
061142,000174: 16,2164           55470                           TS       NEXTP                                 
061143,000175: 16,2165           55471                           TS       NEXTU                                 
061144,000176: 16,2166           55472                           TS       NEXTV                                 
061145,000177: 16,2167           00006                           EXTEND                                         #  COMMAND JETS OFF.
061146,000178: 16,2170           01005                           WRITE    CHAN5                                 
061147,000179: 16,2171           00006                           EXTEND                                         
061148,000180: 16,2172           01006                           WRITE    CHAN6                                 
061149,000181: 16,2173           42200                           CS       BGIM23                                #  TURN TRIM GIMBAL OFF
061150,000182: 16,2174           00006                           EXTEND                                         
061151,000183: 16,2175           03012                           WAND     CHAN12                                
061152,000184: 16,2176           12147                           TCF      SETTIME5                              #  RETURN IN 100 MSEC.
061153,000185: 
061154,000186: 16,2177           03021        MANFLAG            OCT      03021                                 
061155,000187: 16,2200           07400        BGIM23             OCTAL    07400                                 
061156,000188: 16,2201  E6,1417                                  EBANK=   OMEGAP                                
061157,000189: 16,2201           02210 34106  PAXADIDL           2CADR    PAXIS                                 
061158,000190: 
061159,000191: 16,2203     7726               MS100              =        OCT37766                              
061160,000192: 16,2203     0061               COSMG              =        ITEMP1                                
061161,000193: 16,2203           00006        JUMPDSP            EXTEND                                         #  TRANSFER TO BANK 20
061162,000194: 16,2204           32207                           DCA      DSPCADR                               #  FOR ATTITUDE ERROR DISPLAYS
061163,000195: 16,2205           52006                           DTCB                                           
061164,000196: 
061165,000197: 16,2206  E6,1757                                  EBANK=   AK                                    
061166,000198: 16,2206           02226 40106  DSPCADR            2CADR    ALTDSPLY                              
061167,000199: 

Page 1409

061169,000201: 20,2226                                           BANK     20                                    
061170,000202: 20,2000                                           SETLOC   DAPS3                                 
061171,000203: 20,2000                                           BANK                                           
061172,000204: 20,2226                                           COUNT*   $$/NEEDL                              
061173,000205: 
061174,000206:                                                                                                  #  PROGRAM:      ALTDSPLY
061175,000207:                                                                                                  #  MOD 0.        6 DEC 1967
061176,000208:                                                                                                  #  AUTHOR:       CRAIG WORK, DON KEENE, MIT IL
061177,000209:                                                                                                  #  MOD 3 BY DON KEENE AUG 1, 1968 MOVED PROGRAM TO BANK 20
061178,000210: 
061179,000211:                                                                                                  #  PROGRAM DESCRIPTION:
061180,000212:                                                                                                  #        ALTDSPLY REVERSES THE DSPLYALT BIT OF RCSFLAGS EACH TIME IT IS CALLED, WHICH IS PRESUMABLY EVERY 100 MS.
061181,000213:                                                                                                  #        IF THE REVERSED BIT IS ONE, NEEDLER IS CALLED TO DISPLAY ATTITUDE ERRORS.  IF THE BIT IS ZERO, THE ATTITUDE ERR-
061182,000214:                                                                                                  #        ORS ARE CALCULATED AS 1) DAP FOLLOWING ERRORS, IF NEEDLFLG = 0, AND 2) TOTAL ATTITUDE ERRORS FOR NEEDLFLG = 1.
061183,000215: 
061184,000216: 
061185,000217:                                                                                                  #  WARNING:      ALTDSPLY MAY ONLY BE CALLED WITH INTERRUPT INHIBITED.
061186,000218: 
061187,000219:                                                                                                  #  WARNING:      EBANK MUST BE SET TO 6 WHEN USING THIS ROUTINE.
061188,000220: 
061189,000221:                                                                                                  #  INPUT:        RCSFLAGS AND    1) IF NEEDLFLG = 0, INPUT PERROR, QERROR, RERROR.
061190,000222:                                                                                                  #                                2) IF NEEDLFLG = 1, INPUT CPHI,CTHETA,CPSI,CDUX,CDUY,CDUZ,M11,M21,M31,M22,M32.  (GPMATRIX)
061191,000223: 
061192,000224: 
061193,000225:                                                                                                  #  OUTPUTS:      RCSFLAGS WITH DSPLYALT REVERSED, AK, AK1, AK2, + NEEDLER OUTPUTS.
061194,000226: 
061195,000227:                                                                                                  #  ENTRY:        TCF     ALTDSPLY
061196,000228: 
061197,000229:                                                                                                  #  EXIT:         TCF     CHEKMORE
061198,000230: 
061199,000231:                                                                                                  #  ALARM OR ABORT EXITS: NONE
061200,000232: 
061201,000233:                                                                                                  #  SUBPROGRAMS CALLED:  NEEDLER, OVERSUB2
061202,000234: 
061203,000235:                                                                                                  #  DEBRIS:       A, L, AND NEEDLER DEBRIS.
061204,000236: 
061205,000237: 20,2226           31273        ALTDSPLY           CA       RCSFLAGS                              #  INVERT THE DISPLAY ALTERNATION BIT.
061206,000238: 20,2227           54001                           TS       L                                     
061207,000239: 20,2230           34750                           CA       DSPLYALT                              
061208,000240: 20,2231           00006                           EXTEND                                         
061209,000241: 20,2232           06001                           RXOR     LCHAN                                 
061210,000242: 20,2233           55273                           TS       RCSFLAGS                              
061211,000243: 
061212,000244: 20,2234           74750                           MASK     DSPLYALT                              
061213,000245: 20,2235           10000                           CCS      A                                     #  IS ALTERNATION FLAG ZERO?
061214,000246: 20,2236           12322                           TCF      NEEDLER                               
061215,000247: 
061216,000248: 20,2237           30074                           CAE      FLAGWRD0                              #  NEEDLFLG WILL INDICATE TOTAL OR DAP AT-

Page 1410

061218,000250: 20,2240           74750                           MASK     NEEDLBIT                              #  TITUDE ERROR DISPLAY REQUEST.
061219,000251: 20,2241           10000                           CCS      A                                     
061220,000252: 20,2242           12252                           TCF      DSPLYTOT                              #  TOTAL ERROR IS NEEDED IN AK, AK +1, AK +2
061221,000253: 
061222,000254: 20,2243           41446                           CS       QERROR                                #  YES.  DISPLAY ATT ERRORS ON THE ,-BALL.
061223,000255: 20,2244           55760                           TS       AK         +1                         #  ERROR COMPLEMENTS ARE INPUT TO NEEDLER.
061224,000256: 20,2245           41450                           CS       RERROR                                
061225,000257: 20,2246           55761                           TS       AK         +2                         
061226,000258: 20,2247           41462                           CS       PERROR                                
061227,000259: 20,2250           57757                           XCH      AK                                    
061228,000260: 
061229,000261: 20,2251           12442                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
061230,000262: 
061231,000263:                                                                                                  #  CALCULATE GIMBAL ANGLE TOTAL ERRORS, RESOLVE INTO PILOT AXES, STORE TOTAL ERRORS FOR NEEDLER.  Q-AXIS FIRST.
061232,000264: 
061233,000265: 20,2252           00006        DSPLYTOT           EXTEND                                         
061234,000266: 20,2253           22061                           QXCH     ITEMP1                                #  SAVE Q FOR CHEKBITS RETURN.
061235,000267: 
061236,000268: 20,2254           30322                           CA       CTHETA                                #  DESIRED ATTITUDE, Y-AXIS, 2'S COMP.
061237,000269: 20,2255           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
061238,000270: 20,2256           20033                           MSU      CDUY                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
061239,000271: 20,2257           55757                           TS       AK                                    #  SAVE FOR R-ERROR CALCULATION.
061240,000272: 20,2260           00006                           EXTEND                                         
061241,000273: 20,2261           71413                           MP       M21                                   #  (CHTETA-CDUY)*M21 SCALED AT PI RADIANS.
061242,000274: 20,2262           57760                           XCH      AK         +1                         #  STORE FIRST TERM OF Q ERROR.
061243,000275: 20,2263           30323                           CA       CPSI                                  #  DESIRED ATTITUDE, Z-AXIS, 2'S COMP.
061244,000276: 20,2264           00006                           EXTEND                                         #  SUBTRACT CURRENT ATTITUDE.
061245,000277: 20,2265           20034                           MSU      CDUZ                                  #  DIFFERENCE SCALED AT PI, 1'S COMP.
061246,000278: 20,2266           55761                           TS       AK         +2                         #  SAVE Z-AXIS TERM FOR R ERROR CALCULATION
061247,000279: 20,2267           00006                           EXTEND                                         
061248,000280: 20,2270           71415                           MP       M22                                   #  (CPSI-CDUZ)*M22, SCALED AT PI RADIANS.
061249,000281: 20,2271           61760                           AD       AK         +1                         #  Q ERROR COMPLETE         , AT PI RAD.
061250,000282: 20,2272           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
061251,000283: 20,2273           55760                           TS       AK         +1                         
061252,000284: 
061253,000285:                                                                                                  #  R ERROR CALCULATION NEXT.
061254,000286: 
061255,000287: 20,2274           31757                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q-AXIS CALC.
061256,000288: 20,2275           00006                           EXTEND                                         
061257,000289: 20,2276           71414                           MP       M31                                   #  (CTHETA-CDUY)*M31, SCALED AT PI RADIANS.
061258,000290: 20,2277           57761                           XCH      AK         +2                         #  FIRST TERM OF R ERROR.
061259,000291:                                                                                                  #  Z-AXIS DIFFERENCE, STORED BY A CALC. IS
061260,000292: 20,2300           00006                           EXTEND                                         #  RECOVERED BY THE EXCHANGE.
061261,000293: 20,2301           71416                           MP       M32                                   #  (CPSI-CDUZ)*M32, SCALED AT PI RADIANS.
061262,000294: 20,2302           61761                           AD       AK         +2                         #  R ERROR COMPLETE         , AT PI RAD.
061263,000295: 20,2303           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
061264,000296: 20,2304           55761                           TS       AK         +2                         
061265,000297: 
061266,000298:                                                                                                  #  NOW CALCULATE P ERROR.  (NOTE THAT M13 = 1, SCALED AT 1, SO THE MULTIPLICATION IS BY-PASSED.)

Page 1411

061268,000300: 20,2305           31757                           CA       AK                                    #  Y-AXIS DIFFERENCE STORED BY Q AXIS CALC.
061269,000301: 20,2306           00006                           EXTEND                                         
061270,000302: 20,2307           71412                           MP       M11                                   #  (CTHETA-CDUY)*M11 SCALED AT PI RADIANS.
061271,000303: 20,2310           57757                           XCH      AK                                    #  FIRST TERM OF P ERROR IN AK, AT PI RAD.
061272,000304: 20,2311           30321                           CAE      CPHI                                  #  DESIRED ATTITUDE, X-AXIS, 2'S COMP.
061273,000305: 20,2312           00006                           EXTEND                                         #  SUBTRACT CURRENT X ATTITUDE.
061274,000306: 20,2313           20032                           MSU      CDUX                                  #  X-AXIS DIFFERENCE, 1'S COMP, AT PI RAD.
061275,000307: 
061276,000308:                                                                                                  #  M13 = 1, SO BYPASS THE MULTIPLICATION.
061277,000309:                                                                                                  #                EXTEND
061278,000310:                                                                                                  #                MP      M13             (CPHI-CDUX)*M13 SCALED AT PI RADIANS.
061279,000311: 
061280,000312: 20,2314           61757                           AD       AK                                    #  P ERROR COMPLETE      , SCALED AT PI RAD
061281,000313: 20,2315           02435                           TC       OVERSUB2                              #  PIN NEEDLES IN CASE OF OVERFLOW.
061282,000314: 20,2316           55757                           TS       AK                                    
061283,000315: 
061284,000316: 20,2317           00006                           EXTEND                                         
061285,000317: 20,2320           22061                           QXCH     ITEMP1                                #  RESTORE Q FOR CHEKBITS RETURN.
061286,000318: 
061287,000319: 20,2321           12442                           TCF      RETNMORE                              #  DISPLAY THESE THE NEXT TIME THROUGH
061288,000320: 

Page 1412

061290,000322:                                                                                                  #  FDAI ATTITUDE ERROR DISPLAY SUBROUTINE
061291,000323: 
061292,000324:                                                                                                  #  PROGRAM DESCRIPTION:          D. KEENE        5/24/67
061293,000325:                                                                                                  #  MOD 1 BY CRAIG WORK, 12 DEC 67
061294,000326:                                                                                                  #  MOD 2 BY CRAIG WORK, 6 APRIL 68 CONVERTS ATTITUDE ERROR DISPLAY SCALING FROM 16 7/8 DEG. TO 42 3/16 DEGREES.
061295,000327: 
061296,000328:                                                                                                  #  THIS SUBROUTINE IS USED TO DISPLAY ATTITUDE ERRORS ON THE FDAI VIA THE DIGITAL TO ANALOG CONVERTERS (DACS)
061297,000329:                                                                                                  #  IN THE CDUS.  CARE IS TAKEN TO METER OUT THE APPROPRIATE NUMBER OF PULSES TO THE IMU ERROR COUNTERS AND PREVENT
061298,000330:                                                                                                  #  OVERFLOW, TO CONTROL THE RELAY SEQUENCING, AND TO AVOID INTERFERENCE WITH THE COARSE ALIGN LOOP WHICH ALSO USES
061299,000331:                                                                                                  #  THE DACS.
061300,000332: 
061301,000333:                                                                                                  #  CALLING SEQUENCE:
061302,000334:                                                                                                  #        DURING THE INITIALIZATION SECTION OF THE USER'S PROGRAM, BIT3 OF RCSFLAGS SHOULD BE SET TO INITIATE THE
061303,000335:                                                                                                  #        TURN-ON SEQUENCE WITHIN THE NEEDLES PROGRAM:
061304,000336:                                                                                                  #                CS      RCSFLAGS        IN EBANK6
061305,000337:                                                                                                  #                MASK    BIT3
061306,000338:                                                                                                  #                ADS     RCSFLAGS
061307,000339:                                                                                                  #        THEREAFTER, THE ATTITUDE ERRORS GENERATED BY THE USER SHOULD BE TRANSFERED TO THE FOLLOWING LOCATIONS IN EBANK6:
061308,000340:                                                                                                  #                AK      SCALED 180 DEGREES      NOTE:   THESE LOCATIONS ARE SUBJECT
061309,000341:                                                                                                  #                AK1     SCALED 180 DEGREES              TO CHANGE
061310,000342:                                                                                                  #                AK2     SCALED 180 DEGREES
061311,000343:                                                                                                  #        FULL SCALED DEFLECTION OF THE NEEDLES CORRESPONDS TO 5 1/16 DEGREES, WHILE 384 BITS IN THE IMU ERROR COUNTER
061312,000344:                                                                                                  #        CORRESPONDS TO 42 3/16 DEGREES.  (DAC MAXIMUM CAPACITY IS 384 BITS.)  46 BITS EFFECTIVELY PIN THE NEEDLES.
061313,000345: 
061314,000346:                                                                                                  #        A CALL TO NEEDLER WILL THEN UPDATE THE DISPLAY:
061315,000347:                                                                                                  #                INHINT
061316,000348:                                                                                                  #                TC      IBNKCALL        NOTE:  EBANK SHOULD BE SET TO E6
061317,000349:                                                                                                  #                CADR    NEEDLER
061318,000350:                                                                                                  #                RELINT
061319,000351:                                                                                                  #        THIS PROCESS SHOULD BE REPEATED EACH TIME THE ERRORS ARE UPDATED.  AT LEAST 3 PASSES THRU THE PROGRAM ARE
061320,000352:                                                                                                  #        REQUIRED BEFORE ANYTHING IS ACTUALLY DISPLAYED ON THE ERROR METERS.
061321,000353:                                                                                                  #        NOTE:  EACH CALL TO NEEDLER MUST BE SEPARATED BY AT LEAST 50 MS TO ASSURE PROPER RELAY SEQUENCING.
061322,000354: 
061323,000355:                                                                                                  #  ERASABLE USED:
061324,000356:                                                                                                  #        AK              CDUXCMD
061325,000357:                                                                                                  #        AK1             CDUYCMD
061326,000358:                                                                                                  #        AK2             CDUZCMD
061327,000359:                                                                                                  #        EDRIVEX         A,L,Q
061328,000360:                                                                                                  #        EDRIVEY         T5TEMP
061329,000361:                                                                                                  #        EDRIVEZ         DINDX

Page 1413

061331,000363: 
061332,000364:                                                                                                  #  SWITCHES:             RCSFLAGS  BITS 3,2
061333,000365: 
061334,000366:                                                                                                  #  I/O CHANNELS:         CHAN12  BIT 4 (COARSE ALIGN - READ ONLY)
061335,000367:                                                                                                  #                        CHAN12  BIT 6 (IMU ERROR COUNTER ENABLE)
061336,000368:                                                                                                  #                        CHAN14  BIT 13,14,15 (DAC ACTIVITY)
061337,000369: 
061338,000370:                                                                                                  #  SIGN CONVENTION<      AK = THETAC - THETA
061339,000371:                                                                                                  #                        WHERE   THETAC = COMMAND ANGLE
061340,000372:                                                                                                  #                                THETA = PRESENT ANGLE
061341,000373: 
061342,000374: 20,2322           31273        NEEDLER            CA       RCSFLAGS                              
061343,000375: 20,2323           76241                           MASK     SIX                                   
061344,000376: 20,2324           00006                           EXTEND                                         
061345,000377: 20,2325           12362                           BZF      NEEDLES3                              
061346,000378: 20,2326           74751                           MASK     BIT3                                  
061347,000379: 20,2327           00006                           EXTEND                                         
061348,000380: 20,2330           12353                           BZF      NEEDLER2                              #  BIT3 = 0, BIT2 = 1
061349,000381: 
061350,000382: 20,2331           44746                           CS       BIT6                                  #  FIRST PASS BIT3 = 1
061351,000383: 20,2332           00006                           EXTEND                                         #  DISABLE IMU ERROR COUNTER TO ZERO DACS
061352,000384: 20,2333           03012                           WAND     CHAN12                                #  MUST WAIT AT LEAST 60 MS BEFORE
061353,000385: 20,2334           44755        NEEDLE11           CS       ZERO                                  #  ENABLING COUNTERS.
061354,000386: 20,2335           55757                           TS       AK                                    #  ZERO THE INPUTS ON FIRST PASS
061355,000387: 20,2336           55760                           TS       AK1                                   
061356,000388: 20,2337           55761                           TS       AK2                                   
061357,000389: 20,2340           55762                           TS       EDRIVEX                               #  ZERO THE DISPLAY REGISTERS
061358,000390: 20,2341           55763                           TS       EDRIVEY                               
061359,000391: 20,2342           55764                           TS       EDRIVEZ                               
061360,000392: 20,2343           54050                           TS       CDUXCMD                               #  ZERO THE OUT COUNTERS
061361,000393: 20,2344           54051                           TS       CDUYCMD                               
061362,000394: 20,2345           54052                           TS       CDUZCMD                               
061363,000395: 20,2346           46241                           CS       SIX                                   #  RESET RCSFLAGS FOR PASS2
061364,000396: 20,2347           71273                           MASK     RCSFLAGS                              
061365,000397: 20,2350           64752                           AD       BIT2                                  
061366,000398: 20,2351           55273                           TS       RCSFLAGS                              
061367,000399: 20,2352           12442                           TCF      RETNMORE                              
061368,000400: 
061369,000401: 20,2353           34746        NEEDLER2           CAF      BIT6                                  #  ENABLE IMU ERROR COUNTERS
061370,000402: 20,2354           00006                           EXTEND                                         
061371,000403: 20,2355           05012                           WOR      CHAN12                                
061372,000404: 20,2356           46241                           CS       SIX                                   #  RESET RCSFLAGS TO DISPLAY ATTITUDE
061373,000405: 20,2357           71273                           MASK     RCSFLAGS                              #  ERRORS    WAIT AT LEAST 4 MS FOR
061374,000406: 20,2360           55273                           TS       RCSFLAGS                              #  RELAY CLOSURE
061375,000407: 20,2361           12442                           TCF      RETNMORE                              
061376,000408: 
061377,000409: 20,2362           34746        NEEDLES3           CAF      BIT6                                  #  CHECK TO SEE IF IMU ERROR COUNTER
061378,000410: 20,2363           00006                           EXTEND                                         #  IS ENABLED
061379,000411: 20,2364           02012                           RAND     CHAN12                                

Page 1414

061381,000413: 20,2365           10000                           CCS      A                                     #  IF NOT, RE-INITIALIZE NEEDLER.
061382,000414: 20,2366           12373                           TCF      NEEDLES                               
061383,000415: 
061384,000416: 20,2367           41273                           CS       RCSFLAGS                              #  SET UP INITIALIZATION FLAG IN RCSFLAGS.
061385,000417: 20,2370           74751                           MASK     BIT3                                  
061386,000418: 20,2371           27273                           ADS      RCSFLAGS                              
061387,000419: 20,2372           12442                           TCF      RETNMORE                              
061388,000420: 
061389,000421: 20,2373           34752        NEEDLES            CAF      TWO                                   
061390,000422: 20,2374           54063        DACLOOP            TS       DINDX                                 
061391,000423: 20,2375           42434                           CS       ONETENTH                              #  RESCALE INPUTS TO + OR - 1800 DEGREES.
061392,000424: 20,2376           00006                           EXTEND                                         
061393,000425: 20,2377           50063                           INDEX    DINDX                                 
061394,000426: 20,2400           71757                           MP       AK                                    
061395,000427: 20,2401           54001                           TS       L                                     
061396,000428: 20,2402           10000                           CCS      A                                     
061397,000429: 20,2403           32432                           CA       DACLIMIT                              
061398,000430: 20,2404           12406                           TCF      +2                                    
061399,000431: 20,2405           42432                           CS       DACLIMIT                              
061400,000432: 20,2406           60001                           AD       L                                     
061401,000433: 20,2407           54061                           TS       T5TEMP                                #  OVFLO CHK
061402,000434: 20,2410           12414                           TCF      +4                                    
061403,000435: 20,2411           50000                           INDEX    A                                     #  ON OVERFLOW LIMIT OUTPUT TO +-384
061404,000436: 20,2412           32432                           CAF      DACLIMIT                              
061405,000437: 20,2413           54001                           TS       L                                     
061406,000438: 20,2414           50063                           INDEX    DINDX                                 
061407,000439: 20,2415           41762                           CS       EDRIVEX                               #  CURRENT VALUE OF DAC
061408,000440: 20,2416           60001                           AD       L                                     
061409,000441: 20,2417           50063                           INDEX    DINDX                                 
061410,000442: 20,2420           26050                           ADS      CDUXCMD                               
061411,000443: 20,2421           50063                           INDEX    DINDX                                 
061412,000444: 20,2422           23762                           LXCH     EDRIVEX                               
061413,000445: 20,2423           10063                           CCS      DINDX                                 
061414,000446: 20,2424           12374                           TCF      DACLOOP                               
061415,000447: 20,2425           37737                           CAF      13,14,15                              
061416,000448: 20,2426           00006                           EXTEND                                         
061417,000449: 20,2427           05014                           WOR      CHAN14                                #  SET DAC ACTIVITY BITS
061418,000450: 20,2430           12442                           TCF      RETNMORE                              
061419,000451: 
061420,000452: 20,2431           77177                           DEC      -384       B-14                       
061421,000453: 20,2432           37200        DACLIMIT           DEC      16000      B-14                       
061422,000454: 20,2433           00600                           DEC      384        B-14                       
061423,000455: 
061424,000456: 20,2434           03146        ONETENTH           OCT      03146                                 #  DECIMAL +0.1, SCALED AT 1.
061425,000457: 20,2435     4750               DSPLYALT           EQUALS   BIT4                                  #  100 MS ALTERNATION BIT IN RCSFLAGS
061426,000458: 
061427,000459: 20,2435           54007        OVERSUB2           TS       7                                     #  RETURNS A UNCHANGED OR LIMITED TO
061428,000460: 20,2436           00002                           TC       Q                                     #  POSMAX OR NEGMAX IF A HAS OVERFLOW
061429,000461: 20,2437           50000                           INDEX    A                                     

Page 1415

061431,000463: 20,2440           44734                           CS       LIMITS                                #  DUPLICATE CODING IN BANK 16
061432,000464: 20,2441           00002                           TC       Q                                     
061433,000465: 
061434,000466: 20,2442           00006        RETNMORE           EXTEND                                         #  RETURN TO CHEKMORE
061435,000467: 20,2443           32446                           DCA      MORECADR                              
061436,000468: 20,2444           52006                           DTCB                                           
061437,000469: 
061438,000470: 20,2445  E6,1537                                  EBANK=   AOSQ                                  
061439,000471: 20,2445           02016 34106  MORECADR           2CADR    CHEKMORE                              
061440,000472: 

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