Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Peter McDermott. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	YUL SYSTEM FOR AGC: NEW PROGRAM SHEPATIN BY EYLES
	DEC 13, 1966

	THIS PROGRAM WAS ASSEMBLED AS A VERSION OF REVISION 37 
        OF PROGRAM SUNBURST BY LEM GROUP
Note that the date is the date of the printout, not the date of the program revision.

024562,000002:                                                                                                  ## Copyright:   Public domain.
024563,000003:                                                                                                  ## Filename:    TRIM_GIMBAL_CONTROL_SYSTEM.agc
024564,000004:                                                                                                  ## Purpose:     A section of Sunburst revision 37, or Shepatin revision 0.
024565,000005:                                                                                                  ##              It is part of an early development version of the software
024566,000006:                                                                                                  ##              for Apollo Guidance Computer (AGC) on the unmanned Lunar
024567,000007:                                                                                                  ##              Module (LM) flight Apollo 5. Sunburst 37 was the program
024568,000008:                                                                                                  ##              upon which Don Eyles's offline development program Shepatin
024569,000009:                                                                                                  ##              was based; the listing herein transcribed was actually for
024570,000010:                                                                                                  ##              the equivalent revision 0 of Shepatin.
024571,000011:                                                                                                  ##              This file is intended to be a faithful transcription, except
024572,000012:                                                                                                  ##              that the code format has been changed to conform to the
024573,000013:                                                                                                  ##              requirements of the yaYUL assembler rather than the
024574,000014:                                                                                                  ##              original YUL assembler.
024575,000015:                                                                                                  ## Reference:   pp. 554-568
024576,000016:                                                                                                  ## Assembler:   yaYUL
024577,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
024578,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
024579,000019:                                                                                                  ## Mod history: 2017-05-24 MAS  Created from Sunburst 120.
024580,000020:                                                                                                  ##              2017-06-07 HG   Transcribed
024581,000021:                                                                                                  ##              2017-06-15 HG   Fix operand  ACENTRAL -> A2CNTRAL
024582,000022:                                                                                                  ##                                  operator CS -> CAE
024583,000023:                                                                                                  ##                                           TC -> INDEX
024584,000024:                                                                                                  ##              2017-06-22 RSB  Proofed comment text with
024585,000025:                                                                                                  ##                              octopus/ProoferComments.
024586,000026: 

Page 554

024588,000028: 21,2561                                           BANK     21                                    
024589,000029: 21,2561  E6,1541                                  EBANK=   DT                                    
024590,000030:                                                                                                  #  CONTROL REACHES THIS POINT UNDER EITHER OF THE FOLLOWING TWO CONDITIONS ONCE THE DESCENT ENGINE AND THE DIGITAL
024591,000031:                                                                                                  #  AUTOPILOT ARE BOTH ON:
024592,000032:                                                                                                  #           A) THE TRIM GIMBAL CONTROL LAW WAS ON DURING THE PREVIOUS Q,R-AXIS TIME5 INTERRUPT (OR THE DAPIDLER
024593,000033:                                                                                                  #              INITIALIZATION WAS SET FOR TRIM GIMBAL CONTROL AND THIS IS THE FIRST PASS), OR
024594,000034:                                                                                                  #           B) THE Q,R-AXES RCS JET CONTROL LAW ATTITUDE STEERING MODE REDUCED THE ATTITUDE ERROR TO LESS THAN
024595,000035:                                                                                                  #  1DEGREE ON EACH AXIS ON ITS LAST TIME5 INTERRUPT.
024596,000036: 
024597,000037:                                                                                                  #  THE FOLLOWING T5RUPT ENTRY BEGINS THE TRIM GIMBAL CONTROL LAW.  SINCE IT IS ASSUMED THAT THE LEM WILL REMAIN
024598,000038:                                                                                                  #  UNDER TRIM GIMBAL CONTROL, A KALMAN FILTER RUPT IS SET UP TO BEGIN 30 MS FROM THE TRIM GIMBAL RUPT.
024599,000039: 
024600,000040: 21,2561           32374        GTS                CAF      MS30F                                 #  RESET TIMER IMMEDIATELY: DT = 30 MS
024601,000041: 21,2562           54030                           TS       TIME5                                 
024602,000042: 
024603,000043: 21,2563           22016                           LXCH     BANKRUPT                              #  INTERRUPT LEAD IN (CONTINUED)
024604,000044: 21,2564           00006                           EXTEND                                         
024605,000045: 21,2565           22012                           QXCH     QRUPT                                 
024606,000046: 
024607,000047: 21,2566           00006                           EXTEND                                         
024608,000048: 21,2567           32403                           DCA      POSTPFIL                              
024609,000049: 21,2570           53001                           DXCH     T5ADR                                 
024610,000050: 
024611,000051: 21,2571           12663                           TCF      GTSTEST                               #  SKIP OVER XFORMS UNTIL REORGANIZATION
024612,000052: 
024613,000053: 21,2572           00006        GIMBAL             EXTEND                                         #  GET D.P. FILTERED CDUY VALUE (ONES COMP)
024614,000054: 21,2573           31553                           DCA      CDUYFIL                               #  SCALED AT 2PI RADIANS
024615,000055: 21,2574           02303                           TC       ONETOTWO                              #  FORM S.P. VALUE IN TWOS COMPLEMENT AT PI
024616,000056: 21,2575           00006                           EXTEND                                         
024617,000057: 21,2576           20767                           MSU      CDUYD                                 #  FORM Y-AXIS ERROR IN ONES COMPLEMENT
024618,000058: 21,2577           55467                           TS       QDIFF                                 #  (SAVE IN Q-AXIS ERROR LOC: EFFICIENCY)
024619,000059: 
024620,000060: 21,2600           00006                           EXTEND                                         #  GET D.P. FILTERED CDUZ VALUE (ONES COMP)
024621,000061: 21,2601           31555                           DCA      CDUZFIL                               #  SCALED AT 2PI RADIANS
024622,000062: 21,2602           02303                           TC       ONETOTWO                              #  FORM S.P. VALUE IN TWOS COMPLEMENT AT PI
024623,000063: 21,2603           00006                           EXTEND                                         
024624,000064: 21,2604           20770                           MSU      CDUZD                                 #  FORM Z-AXIS ERROR IN ONES COMPLEMENT
024625,000065: 21,2605           55470                           TS       RDIFF                                 #  (SAVE IN R-AXIS ERROR LOC: EFFICIENCY)
024626,000066: 
024627,000067:                                                                                                  #  TRANSFORM Y,Z CDU ERRORS TO THE Q,R-AXES.
024628,000068: 
024629,000069: 21,2606           00006                           EXTEND                                         #  GET BOTH Y AND Z CDU ERRORS AT PI RAD
024630,000070: 21,2607           31470                           DCA      QDIFF                                 
024631,000071: 21,2610           03420                           TC       QTRANSF                               #  FORM Q-ERROR IN A (SCALED AT PI RAD)
024632,000072: 21,2611           53470                           DXCH     QDIFF                                 #  STORE Q-ERROR, GET BOTH Y,Z CDU ERRORS
024633,000073: 21,2612           03430                           TC       RTRANSF                               #  FORM R-ERROR IN A (SCALED AT PI RAD)
024634,000074: 21,2613           57470                           XCH      RDIFF                                 #  STORE R-ERROR
024635,000075: 
024636,000076:                                                                                                  #  TRANSFORM THE FILTERED Y,Z RATES TO THE Q,R-AXES.
024637,000077:                                                                                                  #  (THESE MAY BE NEEDED FOR THE RATE DERIVATION FOR THE JETS IF THEY MUST BE USED.)
024638,000078: 

Page 555

024640,000080: 21,2614           31560                           CAE      DCDUZFIL                              #  GET FILTERED Y,Z RATES
024641,000081: 21,2615           54001                           TS       L                                     #  SCALED AT PI/4 RADIANS/SECOND
024642,000082: 21,2616           31556                           CAE      DCDUYFIL                              
024643,000083: 21,2617           03420                           TC       QTRANSF                               #  FOR Q-AXIS RATE
024644,000084: 21,2620           55417                           TS       OMEGAQ                                #  STORED SCALED AT PI/4 RADIANS/SECOND
024645,000085: 
024646,000086: 21,2621           31560                           CAE      DCDUZFIL                              #  GET FILTERED Y,Z RATES
024647,000087: 21,2622           54001                           TS       L                                     #  SCALED AT PI/4 RADIANS/SECOND
024648,000088: 21,2623           31556                           CAE      DCDUYFIL                              
024649,000089: 21,2624           03430                           TC       RTRANSF                               #  FOR R-AXIS RATE
024650,000090: 21,2625           55421                           TS       OMEGAR                                #  STORED SCALED AT PI/4 RADIANS/SECOND
024651,000091: 
024652,000092:                                                                                                  #  TRANSFORM THE FILTERED Y,Z ACCELERATIONS TO THE Q,R-AXES.
024653,000093:                                                                                                  #  (THESE MAY BE NEEDED TO CALCULATE TRIM GIMBAL OFF-TIMES IF ATTITUDE ERROR HAS GONE BEYOND TRIM GIMBAL CONTROL.)
024654,000094: 
024655,000095: 21,2626           31564                           CAE      D2CDUZFL                              #  GET FILTERED Y,Z ACCELERATIONS
024656,000096: 21,2627           54001                           TS       L                                     #  SCALED AT PI/8 RADIANS/SECOND(2)
024657,000097: 21,2630           31562                           CAE      D2CDUYFL                              
024658,000098: 21,2631           03420                           TC       QTRANSF                               #  FORM Q-AXIS ACCELERATION
024659,000099: 
024660,000100: 21,2632           55420                           TS       ALPHAQ                                #  STORE AT PI/8 RADIANS/SECOND(2)
024661,000101: 
024662,000102: 21,2633           31564                           CAE      D2CDUZFL                              #  GET FILTERED Y,Z ACCELERATIONS
024663,000103: 21,2634           54001                           TS       L                                     #  SCALED AT PI/8 RADIANS/SECOND(2)
024664,000104: 21,2635           31562                           CAE      D2CDUYFL                              
024665,000105: 21,2636           03430                           TC       RTRANSF                               #  FORM R-AXIS ACCELERATION
024666,000106: 21,2637           55422                           TS       ALPHAR                                #  STORE AT PI/8 RADIANS/SECOND(2)
024667,000107: 
024668,000108:                                                                                                  #  EXTRAPOLATE THETA AND OMEGA OVER THE 20 MS DELAY BETWEEN THE KALMAN FILTER AND THE TRIM GIMBAL CONTROL.
024669,000109: 
024670,000110: 21,2640           31417                           CAE      OMEGAQ                                
024671,000111: 21,2641           00006                           EXTEND                                         
024672,000112: 21,2642           72661                           MP       DTW                                   
024673,000113: 21,2643           27467                           ADS      QDIFF                                 
024674,000114: 
024675,000115: 21,2644           31421                           CAE      OMEGAR                                
024676,000116: 21,2645           00006                           EXTEND                                         
024677,000117: 21,2646           72661                           MP       DTW                                   
024678,000118: 21,2647           27470                           ADS      RDIFF                                 
024679,000119: 
024680,000120: 21,2650           31420                           CAE      ALPHAQ                                
024681,000121: 21,2651           00006                           EXTEND                                         
024682,000122: 21,2652           72662                           MP       DTA                                   
024683,000123: 
024684,000124: 21,2653           27417                           ADS      OMEGAQ                                
024685,000125: 
024686,000126: 21,2654           31422                           CAE      ALPHAR                                
024687,000127: 21,2655           00006                           EXTEND                                         
024688,000128: 21,2656           72662                           MP       DTA                                   
024689,000129: 21,2657           27421                           ADS      OMEGAR                                
024690,000130: 
024691,000131: 21,2660           15751                           TCF      RESUME                                
024692,000132: 

Page 556

024694,000134: 
024695,000135: 21,2661           00122        DTW                DEC      .005                                  
024696,000136: 21,2662           00051        DTA                DEC      .0025                                 
024697,000137: 
024698,000138:                                                                                                  #  TEST TO SEE IF TRIM GIMBAL CONTROL LAW HAS KEPT BOTH ATTITUDE ERRORS BELOW THE 1 DEGREE BOUNDARY WITH THE REGION
024699,000139:                                                                                                  #  OF RCS CONTROL LAW DOMINANCE OR IS STILL REDUCING THE ERROR.
024700,000140: 
024701,000141: 21,2663           37754        GTSTEST            CAF      TRYGIMBL                              #  VERIFY THAT GTS IS STILL OPERATIVE.
024702,000142: 21,2664           70077                           MASK     DAPBOOLS                              
024703,000143: 21,2665           10000                           CCS      A                                     
024704,000144: 21,2666           12720                           TCF      RCSCNTRL                              #  GTS NOT OPERATIVE
024705,000145: 21,2667           37755                           CAF      BIT1                                  
024706,000146: 21,2670           54066        LOOPTEST           TS       QRCNTR                                
024707,000147: 21,2671           50066                           INDEX    QRCNTR                                
024708,000148: 21,2672           11467                           CCS      QDIFF                                 #  SCALED AT PI.
024709,000149: 21,2673           62716                           AD       -TGBND+1                              #  -2 DEG SCALED AT PI, + 1 BIT.
024710,000150: 21,2674           12676                           TCF      +2                                    
024711,000151: 21,2675           62716                           AD       -TGBND+1                              
024712,000152: 21,2676           00006                           EXTEND                                         
024713,000153: 21,2677           62701                           BZMF     +2                                    #  IS ERROR MAG LESS,EQUAL 2 DEG.
024714,000154: 21,2700           12720                           TCF      RCSCNTRL                              #  NO.   GO TO JETS.
024715,000155: 21,2701           30066                           CA       QRCNTR                                #  YES.  TRY RATE MAGNITUDE.
024716,000156: 21,2702           60000                           DOUBLE                                         
024717,000157: 21,2703           50000                           INDEX    A                                     
024718,000158: 21,2704           11417                           CCS      OMEGAQ                                #  SCALED AT PI/4.
024719,000159: 21,2705           62717                           AD       -RATBD+1                              #  -.65 DEC/SEC SCALED AT PI/4  + 1 BIT
024720,000160: 21,2706           12710                           TCF      +2                                    
024721,000161: 
024722,000162: 21,2707           62717                           AD       -RATBD+1                              
024723,000163: 21,2710           00006                           EXTEND                                         
024724,000164: 21,2711           62713                           BZMF     +2                                    #  IS RATE MAG LESS,EQUAL .65 DEG/SEC.
024725,000165: 21,2712           12720                           TCF      RCSCNTRL                              #  NO.    GO TO JETS.
024726,000166: 21,2713           10066                           CCS      QRCNTR                                #  YES.  THIS AXIS IS FINE. ARE BOTH DONE.
024727,000167: 21,2714           12670                           TCF      LOOPTEST                              #  TRY THE Q AXIS NOW.
024728,000168: 21,2715           12765                           TCF      GTSRAXIS                              #  USE TRIM GIMBAL CONTROL.
024729,000169: 21,2716           77512        -TGBND+1           OCT      77512                                 #  -2 DEG SCALED AT PI, + 1 BIT.
024730,000170: 21,2717           77423        -RATBD+1           OCT      77423                                 #  -.65 DEG/SEC SCALED AT PI/4  + 1 BIT
024731,000171:                                                                                                  #  ATTITUDE ERROR IS BEYOND TRIM GIMBAL CONTROL LAW RANGE.  SET UP FOR RCS CONTROL LAW (Q,R-AXIS) AND CALCULATE
024732,000172:                                                                                                  #  TIMES TO TURN OFF THE GIMBAL DRIVES.
024733,000173: 
024734,000174: 21,2720           32743        RCSCNTRL           CAF      POSTQRFL                              #  CHANGE LOCATION OF NEXT T5RUPT FROM
024735,000175: 21,2721           55000                           TS       T5ADR                                 #  FILTER TO FILDUMMY
024736,000176: 
024737,000177: 21,2722           00006                           EXTEND                                         #  SET UP POST P-AXIS T5RUPT TO GO TO
024738,000178: 21,2723           32745                           DCA      QRJPFILT                              #  DUMMYFIL INSTEAD OF FILTER.  USE 2CADR
024739,000179: 21,2724           53572                           DXCH     PFILTADR                              #  BECAUSE DUMMYFIL NOW IN BANK 16.
024740,000180: 
024741,000181: 21,2725           00006                           EXTEND                                         #  PREPARE FOR SEQUENCED RESUMPTION OF
024742,000182: 21,2726           30034                           DCA      CDUY                                  #  Q,R-AXIS RCS CONTROL RATE DERIVATION
024743,000183: 21,2727           53431                           DXCH     OLDYFORQ                              #  BY PROVIDING OLD CDU READINGS
024744,000184: 
024745,000185: 21,2730           00006                           EXTEND                                         #  MOVE FILTERED AND TRANSFORMED ATTITUDE
024746,000186: 

Page 557

024748,000188: 21,2731           31470                           DCA      QDIFF                                 #  ERRORS INTO ERASABLE FOR Q,R-AXIS RCS
024749,000189: 21,2732           57470                           XCH      RERROR                                #  CONTROL; NOTE THAT THE AXES SEEM TO BE
024750,000190: 21,2733           23467                           LXCH     QERROR                                #  INTERCHANGED BUT ARE NOT CONFUSED
024751,000191: 
024752,000192: 21,2734           37755                           CAF      ONE                                   
024753,000193: 21,2735           05701                           TC       WAITLIST                              
024754,000194: 21,2736  E6,1541                                  EBANK=   DT                                    
024755,000195: 21,2736           02750 42006                     2CADR    CHEKDRIV                              #  DO TGOFF CALCULATION IN WAITLIST TASK
024756,000196: 
024757,000197: 21,2740           00006                           EXTEND                                         #  GO TO Q,R-AXES CONTROL IMMEDIATELY
024758,000198: 21,2741           32747                           DCA      TGENTRY                               
024759,000199: 21,2742           52006                           DTCB                                           
024760,000200: 
024761,000201: 21,2743           03011        POSTQRFL           GENADR   FILDUMMY                              
024762,000202: 21,2744  E6,1656                                  EBANK=   AOSQTERM                              
024763,000203: 21,2744           03631 34006  QRJPFILT           2CADR    DUMMYFIL                              #  NECESSARY BECAUSE DUMMYFIL IN BANK 16.
024764,000204: 
024765,000205: 21,2746  E6,1541                                  EBANK=   DT                                    
024766,000206: 21,2746           02755 36006  TGENTRY            2CADR    STILLRCS                              
024767,000207: 
024768,000208: 
024769,000209: 21,2750           37761        CHEKDRIV           CAF      ZERO                                  #  CALCULATE Q-AXIS GIMBAL DRIVE SHUTDOWN T
024770,000210: 21,2751           03441                           TC       TGOFFCAL                              
024771,000211: 21,2752           05701                           TC       WAITLIST                              
024772,000212: 21,2753  E6,1541                                  EBANK=   DT                                    
024773,000213: 21,2753           03367 42006                     2CADR    OFFGIMQ                               
024774,000214: 
024775,000215: 21,2755           37754                           CAF      TWO                                   #  CALCULATE R-AXIS GIMBAL DRIVE SHUTDOWN T
024776,000216: 21,2756           03441                           TC       TGOFFCAL                              
024777,000217: 21,2757           05701                           TC       WAITLIST                              
024778,000218: 
024779,000219: 21,2760  E6,1541                                  EBANK=   DT                                    
024780,000220: 21,2760           03372 42006                     2CADR    OFFGIMR                               
024781,000221: 
024782,000222: 21,2762           03377                           TC       WRCHN12                               #  SET UP NEW DRIVES AS OF NOW
024783,000223: 
024784,000224: 21,2763           15745                           TCF      TASKOVER                              
024785,000225: 

Page 558

024787,000227: 
024788,000228:                                                                                                  #  THE DRIVE SETTING ALGORITHM
024789,000229:                                                                                                  #  DEL = SGN(OMEGA.K + SGN(ALPHA)ALPHA(2)/2)    ONLY +1/-1
024790,000230: 
024791,000231:                                                                                                  #  NEGUSUM = ERROR.K(2) + DEL((OMEGA.K.DEL + ALPHA(2)/2)(3/2) + (OMEGA.K.DEL + ALPHA(2)/3)ALPHA
024792,000232: 
024793,000233:                                                                                                  #  DRIVE = -SGN(NEGUSUM)
024794,000234: 
024795,000235: 21,2764           76504        -.04266            DEC      -.04266                               
024796,000236: 21,2765           37754        GTSRAXIS           CAF      TWO                                   #  SET INDEXER FOR R-AXIS CALCULATIONS
024797,000237: 21,2766           54066                           TS       QRCNTR                                
024798,000238: 21,2767           12772                           TCF      GTSQAXIS                              
024799,000239: 
024800,000240: 21,2770           37761        GOQTRIMG           CAF      ZERO                                  #  SET INDEXER FOR Q-AXIS CALCULATIONS
024801,000241: 21,2771           54066                           TS       QRCNTR                                
024802,000242: 
024803,000243: 21,2772           00006        GTSQAXIS           EXTEND                                         
024804,000244: 21,2773           50066                           INDEX    QRCNTR                                #  PICK UP K AND K(2) FOR THIS AXIS
024805,000245: 21,2774           31526                           DCA      KQ                                    
024806,000246: 21,2775           52062                           DXCH     KCENTRAL                              
024807,000247: 
024808,000248: 21,2776           00006                           EXTEND                                         
024809,000249: 21,2777           50066                           INDEX    QRCNTR                                #  PICK UP OMEGA AND ALPHA FOR THIS AXIS
024810,000250: 21,3000           31420                           DCA      OMEGAQ                                
024811,000251: 21,3001           52064                           DXCH     WCENTRAL                              
024812,000252: 
024813,000253: 21,3002           30066                           CAE      QRCNTR                                
024814,000254: 21,3003           00006                           EXTEND                                         
024815,000255: 21,3004           13007                           BZF      +3                                    
024816,000256: 21,3005           31470                           CAE      RDIFF                                 
024817,000257: 21,3006           13010                           TCF      +2                                    
024818,000258: 21,3007           31467                           CAE      QDIFF                                 
024819,000259: 
024820,000260: 21,3010           00006                           EXTEND                                         #  RESCALE DIFFERENCE BY MULTIPLYING BY
024821,000261: 21,3011           77747                           MP       BIT7                                  #  2(6)
024822,000262: 21,3012           22071                           LXCH     ETHETA                                
024823,000263: 
024824,000264: 21,3013           30061                           CAE      KCENTRAL                              #  TEST ON MAGNITUDE OF ACCDOT
024825,000265: 21,3014           62764                           AD       -.04266                               
024826,000266: 
024827,000267: 21,3015           00006                           EXTEND                                         
024828,000268: 21,3016           63032                           BZMF     ACCDOTSM                              #  BRANCH IF ACCDOT IS SMALL
024829,000269: 
024830,000270: 21,3017           37740        ACCDOTLG           CAF      BIT14                                 #  ACCDOT IS COMPARITIVELY LARGE
024831,000271: 21,3020           54072                           TS       SF1                                   #  SET UP SCALE FACTORS
024832,000272: 21,3021           37742                           CAF      BIT12                                 
024833,000273: 21,3022           54073        WSFTEST            TS       SF2                                   
024834,000274: 
024835,000275: 21,3023           10063                           CCS      WCENTRAL                              #  TEST ON MAGNITUDE OF OMEGA
024836,000276: 21,3024           63055                           AD       -.04438                               
024837,000277: 21,3025           13027                           TCF      +2                                    
024838,000278: 21,3026           63055                           AD       -.04438                               
024839,000279: 

Page 559

024841,000281: 21,3027           00006                           EXTEND                                         
024842,000282: 21,3030           63046                           BZMF     ASFTEST                               #  IF SMALL, GO TO ALPHA TEST
024843,000283: 
024844,000284: 21,3031           13070                           TCF      WLARGE                                
024845,000285: 
024846,000286: 21,3032           30061        ACCDOTSM           CAE      KCENTRAL                              #  RESCALE IF ACCDOT IS SMALL
024847,000287: 21,3033           00006                           EXTEND                                         
024848,000288: 21,3034           77751                           MP       BIT5                                  #  RESCALE K BY MULTIPLYING BY 2(4)
024849,000289: 21,3035           22061                           LXCH     KCENTRAL                              
024850,000290: 21,3036           30061                           CAE      KCENTRAL                              
024851,000291: 21,3037           00006                           EXTEND                                         
024852,000292: 21,3040           70000                           SQUARE                                         
024853,000293: 21,3041           54062                           TS       K2CNTRAL                              
024854,000294: 21,3042           37744                           CAF      BIT10                                 #  SET UP VARIABLE SCALE FACTORS
024855,000295: 21,3043           54072                           TS       SF1                                   
024856,000296: 21,3044           37752                           CAF      BIT4                                  
024857,000297: 21,3045           13022                           TCF      WSFTEST                               #  GO TEST ON MAGNITUDE OF OMEGA
024858,000298: 
024859,000299: 21,3046           10064        ASFTEST            CCS      ACENTRAL                              #  TEST ON MAGNITUDE OF ALPHA
024860,000300: 
024861,000301: 21,3047           63056                           AD       -.08882                               
024862,000302: 21,3050           13052                           TCF      +2                                    
024863,000303: 21,3051           63056                           AD       -.08882                               
024864,000304: 21,3052           00006                           EXTEND                                         
024865,000305: 21,3053           63057                           BZMF     WARESCAL                              #  IF SMALL, GO TO W,A RESCALING
024866,000306: 21,3054           13070                           TCF      WLARGE                                #  IF LARGE, DO SAME AS IF W LARGE
024867,000307: 
024868,000308: 21,3055           76450        -.04438            DEC      -.04438                               
024869,000309: 21,3056           75120        -.08882            DEC      -.08882                               
024870,000310: 
024871,000311: 21,3057           30063        WARESCAL           CAE      WCENTRAL                              #  RESCALE OMEGA BY MULTIPLYING BY 2(4)
024872,000312: 21,3060           00006                           EXTEND                                         
024873,000313: 21,3061           77751                           MP       BIT5                                  
024874,000314: 21,3062           22063                           LXCH     WCENTRAL                              
024875,000315: 
024876,000316: 21,3063           30064                           CAE      ACENTRAL                              #  RESCALE ALPHA BY MULTIPLYING BY 2(3)
024877,000317: 21,3064           00006                           EXTEND                                         
024878,000318: 21,3065           77752                           MP       BIT4                                  
024879,000319: 21,3066           22064                           LXCH     ACENTRAL                              
024880,000320: 
024881,000321: 21,3067           13100                           TCF      ALGORTHM                              
024882,000322: 
024883,000323: 21,3070           30072        WLARGE             CAE      SF1                                   #  RESCALE VARIABLE SCALE FACTORS
024884,000324: 
024885,000325: 21,3071           00006                           EXTEND                                         
024886,000326: 21,3072           77741                           MP       BIT13                                 #  SF1 = SF1*2(-2)
024887,000327: 21,3073           54072                           TS       SF1                                   
024888,000328: 21,3074           30073                           CAE      SF2                                   
024889,000329: 21,3075           00006                           EXTEND                                         
024890,000330: 21,3076           77750                           MP       BIT6                                  #  SF2 = SF2*2(-9)
024891,000331: 21,3077           54073                           TS       SF2                                   
024892,000332: 

Page 560

024894,000334: 21,3100           30071        ALGORTHM           CAE      ETHETA                                #  GET RESCALED ERROR THETA
024895,000335: 21,3101           00006                           EXTEND                                         
024896,000336: 
024897,000337: 21,3102           70062                           MP       K2CNTRAL                              #  FORM K(2)*THETA IN D.P.
024898,000338: 21,3103           22070                           LXCH     K2THETA                               
024899,000339: 21,3104           00006                           EXTEND                                         #  FORM K(2)*THETA*SF2 IN D.P.
024900,000340: 21,3105           70073                           MP       SF2                                   
024901,000341: 21,3106           52071                           DXCH     K2THETA                               
024902,000342: 21,3107           00006                           EXTEND                                         
024903,000343: 21,3110           70073                           MP       SF2                                   
024904,000344: 21,3111           26071                           ADS      K2THETA    +1                         
024905,000345: 
024906,000346: 21,3112           30063                           CA       WCENTRAL                              #  GET OMEGA
024907,000347: 21,3113           00006                           EXTEND                                         
024908,000348: 21,3114           70061                           MP       KCENTRAL                              #  FORM K*OMEGA IN D.P.
024909,000349: 21,3115           22061                           LXCH     OMEGA.K                               
024910,000350: 21,3116           00006                           EXTEND                                         #  FORM OMEGA*K*SF1 IN D.P.
024911,000351: 21,3117           70072                           MP       SF1                                   
024912,000352: 21,3120           52062                           DXCH     OMEGA.K                               
024913,000353: 21,3121           00006                           EXTEND                                         
024914,000354: 21,3122           70072                           MP       SF1                                   
024915,000355: 21,3123           26062                           ADS      OMEGA.K    +1                         
024916,000356: 
024917,000357: 21,3124           30064                           CA       ACENTRAL                              #  FORM ALPHA(2) IN D.P.
024918,000358: 21,3125           00006                           EXTEND                                         
024919,000359: 21,3126           70000                           SQUARE                                         
024920,000360: 
024921,000361: 21,3127           52073                           DXCH     A2CNTRAL                              
024922,000362: 
024923,000363: 21,3130           30064                           CAE      ACENTRAL                              #  GET SGN(ALPHA)
024924,000364: 21,3131           00006                           EXTEND                                         
024925,000365: 21,3132           63136                           BZMF     +4                                    
024926,000366: 21,3133           00006                           EXTEND                                         
024927,000367: 21,3134           30073                           DCA      A2CNTRAL                              
024928,000368: 21,3135           13140                           TCF      +3                                    
024929,000369: 21,3136           00006                           EXTEND                                         
024930,000370: 21,3137           40073                           DCS      A2CNTRAL                              
024931,000371: 21,3140           53521                           DXCH     FUNCTION                              #  SAVE AS SGN(ALPHA)ALPHA(2)
024932,000372: 21,3141           00006                           EXTEND                                         
024933,000373: 21,3142           30062                           DCA      OMEGA.K                               
024934,000374: 21,3143           21521                           DAS      FUNCTION                              #  FORM FUNCT1
024935,000375: 
024936,000376: 21,3144           11520                           CCS      FUNCTION                              #  DEL = SGN(FUNCT1)
024937,000377: 21,3145           13151                           TCF      POSFNCT1                              
024938,000378: 21,3146           13150                           TCF      +2                                    
024939,000379: 21,3147           13153                           TCF      NEGFNCT1                              
024940,000380: 
024941,000381: 21,3150           11521                           CCS      FUNCTION   +1                         #  USE LOW ORDER WORD SINCE HIGH IS ZERO
024942,000382: 21,3151           37754        POSFNCT1           CAF      TWO                                   
024943,000383: 21,3152           13154                           TCF      +2                                    
024944,000384: 
024945,000385: 21,3153           37761        NEGFNCT1           CAF      ZERO                                  
024946,000386: 21,3154           67763                           AD       NEG1                                  
024947,000387: 

Page 561

024949,000389: 21,3155           54065                           TS       DEL                                   
024950,000390: 
024951,000391: 21,3156           10065                           CCS      DEL                                   #  MAKE OMEGA*K REALLY DEL*OMEGA*K
024952,000392: 21,3157           13164                           TCF      FUNCT2                                #  (NOTHING NEED BE DONE)
024953,000393: 21,3160           25253        .66667             DEC      .66667                                
024954,000394: 21,3161           00006                           EXTEND                                         
024955,000395: 21,3162           40062                           DCS      OMEGA.K                               
024956,000396: 21,3163           52062                           DXCH     OMEGA.K                               #  CHANGE SIGN OF OMEGA.K
024957,000397: 
024958,000398: 21,3164           00006        FUNCT2             EXTEND                                         
024959,000399: 21,3165           30062                           DCA      OMEGA.K                               
024960,000400: 21,3166           53521                           DXCH     FUNCTION                              #  DEL*OMEGA*K
024961,000401: 21,3167           00006                           EXTEND                                         
024962,000402: 21,3170           30073                           DCA      A2CNTRAL                              
024963,000403: 21,3171           21521                           DAS      FUNCTION                              #  DEL*OMEGA*K + SGN(ALPHA)ALPHA(2)
024964,000404: 
024965,000405: 21,3172           30072        FUNCT3             CAE      A2CNTRAL                              #  CALCULATE (2/3)SGN(ALPHA)ALPHA(2)
024966,000406: 21,3173           00006                           EXTEND                                         
024967,000407: 21,3174           73160                           MP       .66667                                
024968,000408: 21,3175           52073                           DXCH     A2CNTRAL                              
024969,000409: 21,3176           56001                           XCH      L                                     
024970,000410: 21,3177           00006                           EXTEND                                         
024971,000411: 21,3200           73160                           MP       .66667                                
024972,000412: 21,3201           26073                           ADS      A2CNTRAL   +1                         
024973,000413: 21,3202           54001                           TS       L                                     
024974,000414: 21,3203           13205                           TCF      +2                                    
024975,000415: 21,3204           60072                           AD       A2CNTRAL                              
024976,000416: 
024977,000417: 21,3205           52062                           DXCH     OMEGA.K                               #  DEL*OMEGA*K+
024978,000418: 21,3206           20073                           DAS      A2CNTRAL                              #  (2/3)SGN(ALPHA)ALPHA(2)=G
024979,000419: 
024980,000420: 21,3207           30072                           CAE      A2CNTRAL                              #  G*ALPHA IN D.P.
024981,000421: 
024982,000422: 21,3210           00006                           EXTEND                                         
024983,000423: 21,3211           70064                           MP       ACENTRAL                              
024984,000424: 21,3212           52073                           DXCH     A2CNTRAL                              
024985,000425: 21,3213           56001                           XCH      L                                     
024986,000426: 21,3214           00006                           EXTEND                                         
024987,000427: 21,3215           70064                           MP       ACENTRAL                              
024988,000428: 21,3216           26073                           ADS      A2CNTRAL   +1                         
024989,000429: 21,3217           54001                           TS       L                                     
024990,000430: 21,3220           13222                           TCF      +2                                    
024991,000431: 21,3221           26072                           ADS      A2CNTRAL                              
024992,000432: 
024993,000433: 21,3222           52073                           DXCH     A2CNTRAL                              #  FIRST AND THIRD TERMS
024994,000434: 21,3223           20071                           DAS      K2THETA                               #  SUMMED IN D.P.
024995,000435: 
024996,000436:                                                                                                  #  THE FOLLOWING SECTION CALCULATES .707*DEL*FUNCTION(3/2) AND ADDS IT TO THE OTHER TWO TERMS OF NEGUSUM.
024997,000437: 
024998,000438: 21,3224           11520                           CCS      FUNCTION                              #  TEST FOR HIGH ORDER WORD NON-ZERO
024999,000439: 21,3225           13272                           TCF      FMAGTEST                              #  YES, SEE IF RESCALING IS NECESSARY
025000,000440: 

Page 562

025002,000442: 21,3226           13230                           TCF      +2                                    #  NO, USE LOW ORDER WORD ONLY
025003,000443: 21,3227           26501        .707GTS            DEC      .70711                                #  (CCS HOLE USED FOR DATA)
025004,000444: 21,3230           05041                           TC       T6JOBCHK                              
025005,000445: 
025006,000446: 21,3231           31521                           CAE      FUNCTION   +1                         #  USE LOW ORDER WORD ONLY
025007,000447: 21,3232           05435                           TC       SPROOT                                #  SQUARE ROOT SUBROUTINE CALL
025008,000448: 21,3233           00006                           EXTEND                                         #          3/2
025009,000449: 21,3234           71521                           MP       FUNCTION   +1                         #  FUNCTION
025010,000450: 21,3235           00006                           EXTEND                                         #  (NEEDS TO BE SHIFTED RIGHT 21 PLACES)
025011,000451: 21,3236           77746                           MP       BIT8                                  
025012,000452: 21,3237           56001                           XCH      L                                     
025013,000453: 21,3240           37761                           CAF      ZERO                                  #               3/2
025014,000454: 21,3241           53521                           DXCH     FUNCTION                              #  SAVE FUNCTION    IN FUNCTION LOCATION
025015,000455: 21,3242           13257                           TCF      DELTEST                               
025016,000456: 
025017,000457: 21,3243           31520        SQRESCAL           CAE      FUNCTION                              #  HIGH ORDER WORD OF FUNCTION NEEDS TO BE
025018,000458: 21,3244           00006                           EXTEND                                         #  RESCALED FOR ACCURACY, SO MULTIPLY D.P.
025019,000459: 21,3245           77747                           MP       BIT7                                  #  VALUE BY 2(6)
025020,000460: 21,3246           23520                           LXCH     FUNCTION                              
025021,000461: 21,3247           37761                           CAF      ZERO                                  
025022,000462: 21,3250           57521                           XCH      FUNCTION   +1                         
025023,000463: 21,3251           00006                           EXTEND                                         
025024,000464: 21,3252           77747                           MP       BIT7                                  
025025,000465: 21,3253           21521                           DAS      FUNCTION                              
025026,000466: 
025027,000467: 21,3254           37761                           CAF      ZERO                                  #  SET FLAG TO GO TO RESCALE, AND GO TO DO
025028,000468: 21,3255           55517                           TS       MULTFLAG                              #  SQUARE ROOT AND FUNCTION(3/2)
025029,000469: 21,3256           13277                           TCF      DOSPROOT                              #  CALCULATION
025030,000470: 
025031,000471: 21,3257           47735        DELTEST            CS       POSMAX                                #  SET FLAG TO GO TO NEGUSUM
025032,000472: 21,3260           55517                           TS       MULTFLAG                              
025033,000473: 21,3261           10065                           CCS      DEL                                   #  GET DEL*.707
025034,000474: 21,3262           33227                           CAF      .707GTS                               
025035,000475: 21,3263           13265                           TCF      +2                                    
025036,000476: 21,3264           43227                           CS       .707GTS                               
025037,000477: 21,3265           13301                           TCF      SPDMULT                               #  GO TO MULTIPLY ROUTINE
025038,000478: 
025039,000479: 21,3266           37735        RESHIFT            CAF      POSMAX                                #  SET FLAG TO GO TO DELTEST
025040,000480: 
025041,000481: 21,3267           55517                           TS       MULTFLAG                              
025042,000482: 21,3270           37750                           CAF      BIT6                                  
025043,000483: 21,3271           13301                           TCF      SPDMULT                               #  GOTO MULTIPLY ROUTINE
025044,000484: 
025045,000485: 21,3272           65522        FMAGTEST           AD       63/64+1                               #  IF MAGNITUDE OF HIGH ORDER WORD IS LESS
025046,000486: 21,3273           54000                           OVSK                                           #  THAN 1/64 RESCALE WHOLE D.P. WORD
025047,000487: 21,3274           13243                           TCF      SQRESCAL                              
025048,000488: 
025049,000489: 21,3275           37735                           CAF      POSMAX                                
025050,000490: 21,3276           55517                           TS       MULTFLAG                              
025051,000491: 
025052,000492: 21,3277           31520        DOSPROOT           CAE      FUNCTION                              #  USE HIGH ORDER WORD ONLY
025053,000493: 

Page 563

025055,000495: 21,3300           05435                           TC       SPROOT                                #  SQUARE ROOT SUBROUTINE CALL
025056,000496: 
025057,000497: 21,3301           57520        SPDMULT            XCH      FUNCTION                              #  THIS IS AN OPEN SUBROUTINE WHICH USES
025058,000498: 21,3302           00006                           EXTEND                                         #  MULTFLAG AS A RETURN SWITCH.
025059,000499: 21,3303           71520                           MP       FUNCTION                              #  IT MULTIPLIES FUNCTION (D.P.) BY C(A)
025060,000500: 21,3304           53521                           DXCH     FUNCTION                              #  AND LEAVES THE RESULT IN FUNCTION (D.P.)
025061,000501: 21,3305           00006                           EXTEND                                         #  IT IS USED FOR-
025062,000502: 21,3306           70001                           MP       L                                     #  1) F(1/2)*F
025063,000503: 21,3307           27521                           ADS      FUNCTION   +1                         #  2) (.707*DEL)*F
025064,000504: 21,3310           54001                           TS       L                                     #  3) 2(-9)*F
025065,000505: 21,3311           13313                           TCF      +2                                    
025066,000506: 21,3312           27520                           ADS      FUNCTION                              
025067,000507: 
025068,000508: 21,3313           11517                           CCS      MULTFLAG                              #  POSMAX MEANS GO TO DELTEST
025069,000509: 21,3314           13257                           TCF      DELTEST                               #  ZERO   MEANS GO TO RESHIFT
025070,000510: 21,3315           13266                           TCF      RESHIFT                               #  NEGMAX MEANS GO TO NEGUSUM
025071,000511: 
025072,000512: 21,3316           00006        NEGUSUM            EXTEND                                         #  FORM FINAL SUM FOR NEGUSUM
025073,000513: 21,3317           31521                           DCA      FUNCTION                              
025074,000514: 
025075,000515: 21,3320           20071                           DAS      K2THETA                               
025076,000516: 
025077,000517: 21,3321           10070                           CCS      K2THETA                               #  TEST FOR ZERO HIGH ORDER PART
025078,000518: 21,3322           13326                           TCF      NEGDRIVE                              
025079,000519: 21,3323           13325                           TCF      +2                                    
025080,000520: 21,3324           13330                           TCF      POSDRIVE                              
025081,000521: 
025082,000522: 21,3325           10071                           CCS      K2THETA    +1                         #  SIGN TEST ON LOW ORDER PART
025083,000523: 21,3326           37754        NEGDRIVE           CAF      TWO                                   
025084,000524: 21,3327           13331                           TCF      +2                                    
025085,000525: 21,3330           37761        POSDRIVE           CAF      ZERO                                  
025086,000526: 21,3331           67763                           AD       NEG1                                  
025087,000527: 21,3332           50066                           INDEX    ITEMP6                                #  SET NEGUQ,R TO NEG DRIVE
025088,000528: 21,3333           55522                           TS       NEGUQ                                 
025089,000529: 
025090,000530: 21,3334           40000                           COM                                            
025091,000531: 21,3335           00006                           EXTEND                                         #  SEND BACK JERK TERM
025092,000532: 21,3336           50066                           INDEX    ITEMP6                                
025093,000533: 21,3337           71531                           MP       ACCDOTQ                               
025094,000534: 21,3340           50066                           INDEX    ITEMP6                                
025095,000535: 21,3341           23532                           LXCH     QACCDOT                               
025096,000536: 
025097,000537: 21,3342           10066                           CCS      QRCNTR                                #  LOOP COUNTER
025098,000538: 
025099,000539: 21,3343           12770                           TCF      GOQTRIMG                              
025100,000540: 
025101,000541:                                                                                                  #  TRANSFORM JERKS BACK TO GIMBAL AXES.
025102,000542: 
025103,000543: 21,3344           31532                           CAE      QACCDOT                               #  SCALED AT PI/2(7)
025104,000544: 21,3345           00006                           EXTEND                                         
025105,000545: 21,3346           71400                           MP       MR12                                  #  SCALED AT 2
025106,000546: 21,3347           55566                           TS       Y3DOT                                 
025107,000547: 

Page 564

025109,000549: 21,3350           31534                           CAE      RACCDOT                               #  SCALED AT PI/2(7)
025110,000550: 21,3351           00006                           EXTEND                                         
025111,000551: 
025112,000552: 21,3352           71402                           MP       MR13                                  #  SCALED AT 2
025113,000553: 21,3353           27566                           ADS      Y3DOT                                 
025114,000554: 21,3354           27566                           ADS      Y3DOT                                 #  SCALED AT PI/2(7)
025115,000555: 
025116,000556: 21,3355           31532                           CAE      QACCDOT                               #  SCALED AT PI/2(7)
025117,000557: 21,3356           00006                           EXTEND                                         
025118,000558: 21,3357           71401                           MP       MR22                                  #  SCALED AT 1
025119,000559: 21,3360           55570                           TS       Z3DOT                                 
025120,000560: 21,3361           31534                           CAE      RACCDOT                               #  SCALED AT PI/2(7)
025121,000561: 21,3362           00006                           EXTEND                                         
025122,000562: 21,3363           71403                           MP       MR23                                  #  SCALED AT 1
025123,000563: 21,3364           27570                           ADS      Z3DOT                                 #  SCALED AT PI/2(7)
025124,000564: 
025125,000565: 21,3365           03377                           TC       WRCHN12                               #  SEND GIMBAL DRIVES TO SERVOS
025126,000566: 21,3366           15751                           TCF      RESUME                                #  WAIT UNTIL NEXT TRIM GIMBAL RUPT
025127,000567: 
025128,000568:                                                                                                  #  WAITLIST TASKS TO SET TRIM GIMBAL TURN OFF BITS.
025129,000569: 
025130,000570: 21,3367           37761        OFFGIMQ            CAF      ZERO                                  #  SET Q-AXIS FLAG TO ZERO
025131,000571: 21,3370           55522                           TS       NEGUQ                                 
025132,000572: 21,3371           13374                           TCF      +3                                    
025133,000573: 21,3372           37761        OFFGIMR            CAF      ZERO                                  #  SET R-AXIS FLAG TO ZERO
025134,000574: 21,3373           55524                           TS       NEGUR                                 
025135,000575: 
025136,000576: 21,3374           03377                           TC       WRCHN12                               #  FLAGS TO CHANNEL BITS
025137,000577: 21,3375           15745                           TCF      TASKOVER                              
025138,000578: 
025139,000579:                                                                                                  #  THE WRCHN12 SUBROUTINE SETS BITS 9,10,11,12 OF CHANNEL 12 ON THE BASIS OF THE CONTENTS OF NEGUQ,NEGUR WHICH ARE
025140,000580:                                                                                                  #  THE NEGATIVES OF THE TRIM GIMBAL DESIRED DRIVES.
025141,000581: 
025142,000582: 21,3376           07400        BGIM               OCTAL    07400                                 
025143,000583: 21,3377     0066               CHNL12             EQUALS   ITEMP6                                
025144,000584: 
025145,000585: 21,3377           43376        WRCHN12            CS       BGIM                                  #  SAVE THE REST OF CHANNEL 12 DURING TESTS
025146,000586: 21,3400           00006                           EXTEND                                         
025147,000587: 21,3401           02012                           RAND     12                                    
025148,000588: 21,3402           54066                           TS       CHNL12                                #  (TEMPORARY STORAGE)
025149,000589: 
025150,000590: 21,3403           11522                           CCS      NEGUQ                                 
025151,000591: 21,3404           37745                           CAF      BIT9                                  
025152,000592: 21,3405           13407                           TCF      +2                                    
025153,000593: 21,3406           37744                           CAF      BIT10                                 
025154,000594: 21,3407           26066                           ADS      CHNL12                                
025155,000595: 
025156,000596: 21,3410           11524                           CCS      NEGUR                                 
025157,000597: 21,3411           37743                           CAF      BIT11                                 
025158,000598: 21,3412           13414                           TCF      +2                                    
025159,000599: 
025160,000600: 21,3413           37742                           CAF      BIT12                                 
025161,000601: 21,3414           26066                           ADS      CHNL12                                #  (STORED RESULT NOT USED AT PRESENT)
025162,000602: 

Page 565

025164,000604: 21,3415           00006                           EXTEND                                         
025165,000605: 21,3416           01012                           WRITE    12                                    
025166,000606: 
025167,000607: 21,3417           00002                           TC       Q                                     #  SIMPLE RETURN ALWAYS
025168,000608: 
025169,000609:                                                                                                  #  Q,R-TRANSF TRANSFORMS A Y,Z GIMBAL COORDINATE VARIABLE PAIR (IN A,L) TO PILOT COORDINATES (Q/R), RETURNED IN A.
025170,000610:                                                                                                  #  (THE MATRIX M FROM GIMBAL TO PILOT AXES IS ASSUMED TO BE DONE BY T4RUPT AND SCALED AT +1.)
025171,000611: 
025172,000612: 21,3420     0066               QRERAS             EQUALS   ITEMP6                                
025173,000613: 
025174,000614: 21,3420           22066        QTRANSF            LXCH     QRERAS                                #  SAVE Z-AXIS VARIABLE
025175,000615: 21,3421           00006                           EXTEND                                         
025176,000616: 21,3422           71405                           MP       M21                                   #  (Y-AXIS)*M21
025177,000617: 21,3423           56066                           XCH      QRERAS                                #  SAVE, GET Z-AXIS VARIABLE
025178,000618: 21,3424           00006                           EXTEND                                         
025179,000619: 21,3425           71401                           MP       M22                                   #  (Z-AXIS)*M22
025180,000620: 21,3426           60066                           AD       QRERAS                                #  SUM = (Y-AXIS)*M21 + (Z-AXIS)*M22
025181,000621: 21,3427           00002                           TC       Q                                     #  RETURN WITH SUM IN A
025182,000622: 
025183,000623: 21,3430           22066        RTRANSF            LXCH     QRERAS                                #  SAVE Z-AXIS VARIABLE
025184,000624: 21,3431           00006                           EXTEND                                         
025185,000625: 21,3432           71406                           MP       M31                                   #  (Y-AXIS)*M31
025186,000626: 21,3433           56066                           XCH      QRERAS                                #  SAVE, GET Z-AXIS VARIABLE
025187,000627: 21,3434           00006                           EXTEND                                         
025188,000628: 21,3435           71403                           MP       M32                                   #  (Z-AXIS)*M32
025189,000629: 21,3436           60066                           AD       QRERAS                                #  SUM = (Y-AXIS)*M31 + (Z-AXIS)*M32
025190,000630: 21,3437           00002                           TC       Q                                     #  RETURN WITH SUM IN A
025191,000631: 
025192,000632: 21,3440           25253        (2/3)              DEC      0.66667                               
025193,000633: 

Page 566

025195,000635:                                                                                                  #  SUBROUTINE: TGOFFCAL            MOD. NO. 1  DATE: AUGUST 22, 1966
025196,000636: 
025197,000637:                                                                                                  #  PROGRAM DESIGN BY: RICHARD D. GOSS (MIT/IL)
025198,000638: 
025199,000639:                                                                                                  #  PROGRAM IMPLEMENTATION BY: JONATHAN D. ADDELSTON (ADAMS ASSOCIATES)
025200,000640: 
025201,000641:                                                                                                  #  MODIFIED 30 NOV 66, TO USE ACCDOTQ AND ACCDOTR.              CRAIG WORK
025202,000642:                                                                                                  #  THIS SUBROUTINE CALCULATES THE TRIM GIMBAL SHUTDOWN TIME FOR EITHER THE Q OR THE R AXIS (DEPENDING ON THE
025203,000643:                                                                                                  #  CALLING SEQUENCE).  THIS TIME IS SCALED FOR IMMEDIATE USE BY A WAITLIST CALL AS SHOWN IN THE CALLING SEQUENCES.
025204,000644:                                                                                                  #  IF THE TIME-TO-GO IS MORE THAN TWO MINUTES, IT IS LIMITED TO TWO MINUTES DUE TO THE WAITLIST SPECIFICATION.  IF
025205,000645:                                                                                                  #  THE TIME-TO-GO IS LESS THAN TEN MILLISECONDS, THE SHUTDOWN IS PERFORMED IMMEDIATELY AND THE WAITLIST CALL IS
025206,000646:                                                                                                  #  BY-PASSED.
025207,000647: 
025208,000648:                                                                                                  #  THESE TIME-TO-GO CALCULATIONS ARE DESIGNED TO DRIVE THE TRIM GIMBAL TO A POSITION WHERE THE DESCENT ENGINE WILL
025209,000649: 
025210,000650:                                                                                                  #  CAUSE NO ANGULAR ACCELERATION.  THIS SUBROUTINE IS CALLED ONLY FROM THE WAITLIST TASK CHEKDRIV WHICH IS
025211,000651:                                                                                                  #  INITIATED ONLY WHEN THE TRIM GIMBAL CONTROL LAW HAS LOST CONTROL OF THE LEM VEHICLE ATTITUDE AND MUST RETURN TO
025212,000652:                                                                                                  #  THE USE OF REACTION CONTROL SYSTEM JETS.
025213,000653: 
025214,000654:                                                                                                  #  CALLING SEQUENCES:
025215,000655: 
025216,000656:                                                                                                  #                      26,1000  3 7657 1            CAF    ZERO            Q-AXIS INDEXER
025217,000657:                                                                                                  #                      26,1001  0 $$$$ $            TC     TGOFFCAL        CALL TGOFFCAL (*** REPLACE $$ ***)
025218,000658:                                                                                                  #                      26,1002  0 4511 0            TC     WAITLIST        CALL WAITLIST WITH CALCULATED TIME
025219,000659:                                                                                                  #                      26,1003   0$$$$ $            2CADR  OFFGIMQ         2CADR OF Q-AXIS SHUTDOWN PROGRAM
025220,000660:                                                                                                  #                      26,1004   54006 1
025221,000661: 
025222,000662:                                                                                                  #                      26,1005  3 7657 1            CAF     TWO            R-AXIS INDEXER
025223,000663:                                                                                                  #                      26,1006  0 $$$$ $            TC      TGOFFCAL       CALL TGOFFCAL (*** REPLACE $$ ***)
025224,000664:                                                                                                  #                      26,1007  0 4511 0            TC      WAITLIST       CALL WAITLIST WITH CALCULATED TIME
025225,000665:                                                                                                  #                      26,1010   0$$$$ $            2CADR   OFFGIMR        2CADR OF R-AXIS SHUTDOWN PROGRAM
025226,000666:                                                                                                  #                      26,1011   54006 1
025227,000667: 
025228,000668:                                                                                                  #  SUBROUTINES CALLED: NONE, BUT WRCHNL12 IS CALLED AFTER BOTH TGOFFCALL CALLS.
025229,000669: 
025230,000670:                                                                                                  #  NORMAL EXITS: TO WAITLIST CALL OR BEYOND 2CADR IN CALLING SEQUENCE AS SPECIFIED ABOVE.
025231,000671: 
025232,000672:                                                                                                  #  ALARM OR ABORT EXIT MODES: NONE
025233,000673: 
025234,000674:                                                                                                  #  INPUT: 1. THE AXIS INDEXER: 0 FOR Q, 2 FOR R (SEE CALLING SEQUENCES)
025235,000675:                                                                                                  #         2. THE SIGNED TIME DERIVATIVE OF ACCELERATION (QACCDOT OR RACCDOT) SCALED AT PI/2(7) RAD/SEC(3).
025236,000676:                                                                                                  #         3. THE ACCELERATION APPROXIMATION FROM THE DESCENT KALMAN FILTER TRANSFORMED TO PILOT AXES (ALPHAQ OR
025237,000677:                                                                                                  #  ALPHAR) SCALED AT PI/8 RAD/SEC(2).
025238,000678: 
025239,000679:                                                                                                  #         4. CHANNEL 12 CONTAINS THE GIMBAL DRIVES AND OTHER BITS.
025240,000680:                                                                                                  #  OUTPUT 5. THE NEGATIVE GIMBAL DRIVE FLAG (NEGUQ AND NEGUR) WHERE A +1 BIT REQUESTS POSITIVE GIMBAL DRIVE
025241,000681:                                                                                                  #            (ANGULAR ACCELERATION DECREASING), A -1 BIT REQUESTS NEGATIVE GIMBAL DRIVE (ANG. ACC. INCREASING).
025242,000682:                                                                                                  #            A ZERO INDICATES NO DRIVE.
025243,000683:                                                                                                  #         6. TIME REQUIRED TO ZERO ACCELERATION, SCALED FOR WAITLIST.
025244,000684: 
025245,000685:                                                                                                  #  ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
025246,000686: 

Page 567

025248,000688: 
025249,000689:                                                                                                  #                                          NEGUQ    ERASE   +2             NEGATIVE OF Q-AXIS GIMBAL DRIVE
025250,000690:                                                                                                  #                                          (SPWORD) EQUALS NEGUQ +1        ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
025251,000691:                                                                                                  #                                          NEGUR    EQUALS NEGUQ +2        NEGATIVE OF R-AXIS GIMBAL DRIVE
025252,000692: 
025253,000693:                                                                                                  #                                          ACCDOTQ  ERASE   +2             Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
025254,000694:                                                                                                  #                                          (SPWORD) EQUALS ACCDOTQ +1      ANY S.P. ERASABLE NUMBER  NOW QACCDOT
025255,000695:                                                                                                  #                                          ACCDOTR  EQUALS ACCDOTQ +2      R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
025256,000696:                                                                                                  #                                                                          ACCDOTQ,ACCDOTR ARE MAGNITUDES.
025257,000697:                                                                                                  #                                          ALPHAQ   ERASE   +2             Q-AXIS ACCELERATION SCALED AT PI/8 R/S2
025258,000698:                                                                                                  #                                          (SPWORD) EQUALS ALPHAQ +1       ANY S.P. ERASABLE NUMBER, NOW OMEGAR
025259,000699:                                                                                                  #                                          ALPHAR   EQUALS ALPHAQ +2       R-AXIS ACCELERATION SCALED AT PI/8 R/S2
025260,000700:                                                                                                  #                                                                          NOTE: NOW OMEGAP,OMEGAQ PRECEDE ALPHAQ
025261,000701: 
025262,000702:                                                                                                  #  DEBRIS: L, Q, ITEMP1, ITEMP2, ITEMP6
025263,000703: 
025264,000704: 
025265,000705: 21,3441           54061        TGOFFCAL           TS       QRNDXER                               #  Q OR R AXIS INDEXER
025266,000706: 21,3442           50061                           INDEX    QRNDXER                               #  GET JERK TERM MAGNITUDE SCALED AT
025267,000707: 
025268,000708: 21,3443           31531                           CAE      ACCDOTQ                               #       PI/2(7) IN RADIANS/SEC(3).
025269,000709: 21,3444           00006                           EXTEND                                         #  UNLESS THETA TRIPLE-DOT MAGNITUDE IS NON
025270,000710: 21,3445           63525                           BZMF     TGOFFNOW                              #       -ZERO, SET DRIVE TO ZERO NOW.
025271,000711: 21,3446           54062                           TS       NZACCDOT                              #  SAVE NON-ZERO DENOMINATOR.
025272,000712: 21,3447           50061                           INDEX    QRNDXER                               #  INITIALIZE THE AOSTERM WHICH WILL BE UP-
025273,000713: 21,3450           31420                           CAE      ALPHAQ                                #  DATED IN THE DUMMYFIL CALCULATION FOR
025274,000714: 21,3451           00006                           EXTEND                                         #  USE IN THE QRAXIS RATE DERIVATION.  SET
025275,000715: 21,3452           73535                           MP       .1-.05K)                              #  AOSTERM TO ALPHA*CSP*(1-.5*K), WHERE CSP
025276,000716: 21,3453           56001                           XCH      L                                     #  IS .1 SEC, K IS .5   THEN AOSTERM IS SET
025277,000717: 21,3454           10061                           CCS      QRNDXER                               #  TO .075*ALPHA, SCALED AT PI/4,WHILE
025278,000718: 21,3455           50000                           INDEX    A                                     #  ALPHA IS SCALED AT PI/8( THE CONSTANT IS
025279,000719: 21,3456           23656                           LXCH     AOSQTERM                              #  SCALED AT 2.
025280,000720: 21,3457           50061                           INDEX    QRNDXER                               #  GET ACCELERATION SCALED AT PI/8
025281,000721: 21,3460           31420                           CAE      ALPHAQ                                #       RAD/SEC(2).
025282,000722: 21,3461           00006                           EXTEND                                         #  IF ACCELERATION IS ALREADY ZERO, EXIT.
025283,000723: 21,3462           13525                           BZF      TGOFFNOW                              #  OTHERWISE, PROCEED WITH NON-ZERO ALPHA.
025284,000724: 21,3463           00006                           EXTEND                                         #  SET NEGUQ TO THE SIGN OF ALPHA. THEN USE
025285,000725: 21,3464           63470                           BZMF     NEGALPH                               #    THE MAGNITUDE OF ALPHA TO COMPUTE TIME
025286,000726: 21,3465           54066                           TS       ITEMP6                                
025287,000727: 21,3466           37755                           CAF      BIT1                                  
025288,000728: 21,3467           13473                           TCF      +4                                    
025289,000729: 21,3470           40000        NEGALPH            CS       A                                     
025290,000730: 21,3471           54066                           TS       ITEMP6                                
025291,000731: 
025292,000732: 21,3472           47755                           CS       BIT1                                  
025293,000733: 21,3473           50061                           INDEX    QRNDXER                               #  STORE THE DRIVE DIRECTION FLAG
025294,000734: 21,3474           55522                           TS       NEGUQ                                 #  TIME = MAGNITUDE OF (ALPHA/ACCDOT),
025295,000735: 21,3475           40000                           COM                                            #  LEAVES THE SIGN OF Q(R)ACCDOT IN A.
025296,000736: 21,3476           00006                           EXTEND                                         #  STORE ACCDOT TO REFLECT THE CHANGE IN
025297,000737: 21,3477           50061                           INDEX    QRNDXER                               #  GIMBAL DRIVE DIRECTION (POSSIBLE).  THIS
025298,000738: 21,3500           71531                           MP       ACCDOTQ                               #  CAN BE ESSENTIAL FOR DUMMYFIL, IN CASE
025299,000739: 21,3501           50061                           INDEX    QRNDXER                               #  Q(R)ACCDOT IS NOT INITIALIZED BEFORE
025300,000740: 

Page 568

025302,000742: 21,3502           23532                           LXCH     QACCDOT                               #  EXECUTING DUMMYFIL.
025303,000743: 21,3503           30066                           CAE      ITEMP6                                
025304,000744: 
025305,000745: 21,3504           00006                           EXTEND                                         #  MULTIPLY BY 1/16
025306,000746: 21,3505           77743                           MP       BIT11                                 #  TO CHANGE SCALING TO 2PI RAD/SEC(2)
025307,000747: 21,3506           00006                           EXTEND                                         #  ACCDOT SCALED AT PI/2(7) IN DENOMINATOR
025308,000748: 21,3507           10062                           DV       NZACCDOT                              #  YIELDS TIME SCALED AT 256 SECONDS
025309,000749: 21,3510           63533                           AD       -2MIN256                              #  COMPARE WITH MAXIMUM 2 MINUTE DELAY OF
025310,000750: 21,3511           10000                           CCS      A                                     #  WAITLIST ACTION (TIMES AT 256 SECONDS)
025311,000751: 21,3512           43532                           CS       -2MINWL                               #  MORE THAN TWO MINUTES, USE 2MINUTES
025312,000752: 21,3513           00002                           TC       Q                                     #  RETURN WL CALL WITH 2 MIN AT 1BIT=10MS
025313,000753: 
025314,000754: 21,3514           67755                           AD       ONE                                   #  (CORRECT FOR CCS BIT)
025315,000755: 21,3515           00006                           EXTEND                                         #  CALCULATE DT = ABS(T-2MIN)
025316,000756: 21,3516           73534                           MP       128/164                               #  AND RESCALE DT TO WAITLIST SCALING
025317,000757: 21,3517           20001                           DDOUBL                                         
025318,000758: 21,3520           63532                           AD       -2MINWL                               #  -T = DT + 2MIN (IN WAITLIST SCALING)
025319,000759: 21,3521           40000                           COM                                            #  MAKE T POSITIVE FOR WAITLIST
025320,000760: 21,3522           00006                           EXTEND                                         #  MAKE FINAL CHECK TO INSURE T .G. 10 MS
025321,000761: 21,3523           63525                           BZMF     TGOFFNOW                              #  DO SHUTDOWN NOW (COULD USE BZF)
025322,000762: 21,3524           00002                           TC       Q                                     #  RETURN TO WAITLIST CALL WITH WL TIME
025323,000763: 
025324,000764: 21,3525           37761        TGOFFNOW           CAF      ZERO                                  #  MAKE SURE PLUS ZERO FOR DRIVE FLAG
025325,000765: 21,3526           50061                           INDEX    QRNDXER                               #  TURN OFF DRIVE FLAG NOW
025326,000766: 21,3527           55522                           TS       NEGUQ                                 
025327,000767: 21,3530           50002                           INDEX    Q                                     
025328,000768: 
025329,000769: 21,3531           00003                           TC       3                                     #  SKIP WAITLIST CALL AND 2CADR
025330,000770: 
025331,000771: 
025332,000772: 
025333,000773: 21,3532     0061               QRNDXER            EQUALS   ITEMP1                                #  INDEXER FOR Q OR R AXIS
025334,000774: 21,3532     0062               NZACCDOT           EQUALS   ITEMP2                                #  TEMPORARY STORAGE FOR NON-ZERO ACCDOT
025335,000775: 21,3532           50437        -2MINWL            DEC      -12000     B-14                       #  - 2 MINUTES SCALED FOR WAITLIST
025336,000776: 21,3533           60777        -2MIN256           DEC      -.46875                               #  - 2 MINUTES SCALED AT 256
025337,000777: 21,3534           31000        128/164            OCTAL    31000                                 #  128/163.84 CONVERTING 256 TO WAITLIST/2
025338,000778: 21,3535           01146        .1-.05K)           OCTAL    01146                                 #  .0375=.075 SCALED AT 2

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