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.

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

Page 554

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

Page 555

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

Page 556

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

Page 557

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

Page 558

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

Page 559

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

Page 560

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

Page 561

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

Page 562

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

Page 563

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

Page 564

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

Page 565

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

Page 566

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

Page 567

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

Page 568

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