Source Code

008357,000002: ## Copyright: Public domain. 008358,000003: ## Filename: IMU_COMPENSATION_PACKAGE.agc 008359,000004: ## Purpose: Part of the source code for Solarium build 55. This 008360,000005: ## is for the Command Module's (CM) Apollo Guidance 008361,000006: ## Computer (AGC), for Apollo 6. 008362,000007: ## Assembler: yaYUL --block1 008363,000008: ## Contact: Jim Lawton <jim DOT lawton AT gmail DOT com> 008364,000009: ## Website: www.ibiblio.org/apollo/index.html 008365,000010: ## Page Scans: www.ibiblio.org/apollo/ScansForConversion/Solarium055/ 008366,000011: ## Mod history: 2009-09-29 JL Created. 008367,000012: ## 2016-08-18 RSB Typos. 008368,000013: ## 2016-12-28 RSB Proofed comment text using octopus/ProoferComments, 008369,000014: ## and fixed errors found. 008370,000015:

Page 214

008372,000017: 
008373,000018:                                                                                                  #        THE FOLLWOING ROUTINE IS DESIGNED TO COMPENSATE FOR PIPA BIAS AND SCALE FACTOR ERROR. ATTHE SAME TIME,
008374,000019:                                                                                                  #  IT ACCUMULATES GYRO TORQUE COMMANDS NECESSARY TO COMPENSATE FOR THE ASSOCIATED BIAS AND ACCELERATION-CAUSED GYRO
008375,000020:                                                                                                  #  DRIFTS. THIS ROUTINE EXPECTS TO FIND PIPA READINGS IN THE MAJOR PARTS OF DELV (DELVX, DELVY, DELVZ), WITH THE
008376,000021:                                                                                                  #  MINOR PARTS IRRELEVANT. OUTPUT FROM 1/PIPA IS DOUBLE PRECISION COMPENSATED DATA, THE MINOR PART OF WHICH USUALLY
008377,000022:                                                                                                  #  CONTAINS ALL THE COMPENSATION. 1/PIPA MUST BE CALLED AT LEAST EVERY 2.56 SECONDS, DUE TO SCALING CONSIDERATIONS.
008378,000023:                                                                                                  #  SPECIFICALLY, THE CORRECTION IS:
008379,000024: 
008380,000025:                                                                                                  #        PIPA  = PIPA (1 + SCALE FACTOR ERROR) - BIAS DELTAT
008381,000026:                                                                                                  #            C       I
008382,000027: 
008383,000028:                                                                                                  #  WHERE PIPA  IS THE COMPENSATED DATA OBTAINED FROM THE SAMPLED PIPA .
008384,000029:                                                                                                  #            C                                                       I
008385,000030: 
008386,000031: 
008387,000032: 
008388,000033: 14,7017                                           BANK     14                                    
008389,000034: 14,7017           35502        1/PIPA             CAF      FOUR                                  #  LOOP TO PROCESS INPUT PIPA DATA.
008390,000035: 14,7020           50101                 +1        TS       BUF        +2                         
008391,000036: 14,7021           20000                           INDEX    A                                     
008392,000037: 14,7022           41001                           CS       DELVX                                 #  SAMPLED PIPA INTO MPAC
008393,000038: 14,7023           50115                           TS       MPAC                                  
008394,000039: 14,7024           20101                           INDEX    BUF        +2                         #  SUBTRACT BIAS TERM (LESS THAN 1 BIT).
008395,000040: 14,7025           40736                           CS       PIPABIAS                              
008396,000041: 14,7026           25777                           EXTEND                                         
008397,000042: 14,7027           40755                           MP       1/PIPADT                              #  SUPPLIED BY USER SCALED AT CS 2(-8),
008398,000043: 14,7030           50116                           TS       MPAC       +1                         
008399,000044: 
008400,000045: 14,7031           40115                           CS       MPAC                                  #  SHIFT THE PIPA READING LEFT THREE PLACES
008401,000046: 14,7032           50115                           TS       MPAC                                  
008402,000047: 14,7033           25777                           EXTEND                                         #  IN PREPARATION FOR SCALE FACTOR
008403,000048: 14,7034           44513                           MP       BIT4                                  #  CORRECTION. IF IT OVERFLOWS, SHIFT THE
008404,000049: 14,7035           10000                           CCS      A                                     #  SCALE FACTOR ERROR RIGHT 11 PLACES
008405,000050: 14,7036           07216                           TC       PIPOVF                                #  TAKING A LOSS IN PRECISION.
008406,000051: 
008407,000052: 14,7037           07041                           TC       +2                                    #  THE ABOVE HAPPENS AT DELTA VS OF OVER
008408,000053: 14,7040           07216                           TC       PIPOVF                                #  12 G-SECS., RESULTING IN A SCALE FACTOR
008409,000054: 14,7041           20101                           INDEX    BUF        +2                         #  CORRECTION GOOD ONLY TO 60 PPM.
008410,000055: 14,7042           40737                           CS       PIPASCF                               
008411,000056: 14,7043           40000                           COM                                            
008412,000057: 14,7044           25777                           EXTEND                                         
008413,000058: 14,7045           40003                           MP       LP                                    
008414,000059: 14,7046           60116                           AD       MPAC       +1                         #  ADD TO BIAS CORRECTION.
008415,000060: 14,7047           20101                           INDEX    BUF        +2                         
008416,000061: 14,7050           51002                           TS       DELVX      +1                         #  AND MAYBE SKIP.
008417,000062: 14,7051           35501                           CAF      ZERO                                  
008418,000063: 
008419,000064: 14,7052           60115                           AD       MPAC                                  
008420,000065: 14,7053           20101                           INDEX    BUF        +2                         
008421,000066: 14,7054           51001                           TS       DELVX                                 

Page 215

008423,000068: 
008424,000069: 14,7055           10101        PIPJUMP            CCS      BUF        +2                         #  LOOP TO PROCESS NEXT COMPONENT.
008425,000070: 14,7056           64335                           AD       NEG1                                  
008426,000071: 14,7057           07020                           TC       1/PIPA     +1                         
008427,000072: 14,7060           00756        LGCOMP             ADRES    GCOMP                                 
008428,000073: 

Page 216

008430,000075: 
008431,000076:                                                                                                  #        THE FOLLOWING ROUTINE COMPUTES THE GYRO TORQUES NECESSARY TO COMPENSATE FOR THE ACCELERATION-SENSITIVE
008432,000077:                                                                                                  #  DRIFTS DUE TO THE DATA JUST PROCESSED, AND SUMS THEM INTO THE GCOMP REGISTERS.
008433,000078: 
008434,000079: 14,7061           50101                           TS       GCOMPSW                               #  SET GYRO TORQUE INDICATOR TO ZERO.
008435,000080: 14,7062           50077                           TS       BUF                                   #  RELATIVE ADDRESS OF PRESENT COMPONENT.
008436,000081: 
008437,000082: 14,7063           41001                           CS       DELVX                                 #  PROCESS X COMPONENT.
008438,000083: 14,7064           50115                           TS       MPAC                                  
008439,000084: 14,7065           41002                           CS       DELVX      +1                         
008440,000085: 14,7066           50116                           TS       MPAC       +1                         
008441,000086: 14,7067           40747                           CS       ADIAX                                 
008442,000087: 14,7070           07145                           TC       GCOMPSUB   -1                         
008443,000088: 
008444,000089: 14,7071           41003                           CS       DELVY                                 
008445,000090: 14,7072           50115                           TS       MPAC                                  
008446,000091: 14,7073           41004                           CS       DELVY      +1                         
008447,000092: 14,7074           50116                           TS       MPAC       +1                         
008448,000093: 14,7075           40752                           CS       ADSRAX                                
008449,000094: 14,7076           07146                           TC       GCOMPSUB                              
008450,000095: 
008451,000096: 14,7077           40744                           CS       GBIASX                                #  ADD IN BIAS DRIFTS.
008452,000097: 14,7100           07171                           TC       DRIFTSUB                              
008453,000098: 
008454,000099: 14,7101           41003                           CS       DELVY                                 #  COMPUTE Y GYRO COMPENSATION.
008455,000100: 14,7102           50115                           TS       MPAC                                  
008456,000101: 14,7103           41004                           CS       DELVY      +1                         
008457,000102: 14,7104           50116                           TS       MPAC       +1                         
008458,000103: 14,7105           40750                           CS       ADIAY                                 
008459,000104: 14,7106           07145                           TC       GCOMPSUB   -1                         
008460,000105: 
008461,000106: 14,7107           41005                           CS       DELVZ                                 
008462,000107: 14,7110           50115                           TS       MPAC                                  
008463,000108: 14,7111           41006                           CS       DELVZ      +1                         
008464,000109: 14,7112           50116                           TS       MPAC       +1                         
008465,000110: 14,7113           40753                           CS       ADSRAY                                
008466,000111: 14,7114           07146                           TC       GCOMPSUB                              
008467,000112: 
008468,000113: 14,7115           40745                           CS       GBIASY                                
008469,000114: 14,7116           07171                           TC       DRIFTSUB                              
008470,000115: 

Page 217

008472,000117: 14,7117           41003                           CS       DELVY                                 #  CORRESPONDING PATTERN FOR Z GYRO.
008473,000118: 14,7120           50115                           TS       MPAC                                  
008474,000119: 14,7121           41004                           CS       DELVY      +1                         
008475,000120: 14,7122           50116                           TS       MPAC       +1                         
008476,000121: 14,7123           40754                           CS       ADSRAZ                                
008477,000122: 14,7124           07145                           TC       GCOMPSUB   -1                         
008478,000123: 
008479,000124: 14,7125           41005                           CS       DELVZ                                 
008480,000125: 14,7126           50115                           TS       MPAC                                  
008481,000126: 14,7127           41006                           CS       DELVZ      +1                         
008482,000127: 14,7130           50116                           TS       MPAC       +1                         
008483,000128: 14,7131           40751                           CS       ADIAZ                                 
008484,000129: 14,7132           07145                           TC       GCOMPSUB   -1                         
008485,000130: 
008486,000131: 14,7133           40746                           CS       GBIASZ                                
008487,000132: 14,7134           07171                           TC       DRIFTSUB                              
008488,000133: 
008489,000134: 14,7135           10101                           CCS      GCOMPSW                               #  NON-ZERO IF TIME TO PUT OUT COMPENSATION
008490,000135: 14,7136           07140                           TC       +2                                    
008491,000136: 14,7137           05702                           TC       SWRETURN                              #  TORQUES NOT BIG ENOUGH YET.
008492,000137: 
008493,000138: 14,7140           20017                           INHINT                                         
008494,000139: 14,7141           32170                           CAF      PRIO35                                #  REQUEST COMPENSATION JOB
008495,000140: 14,7142           02052                           TC       NOVAC                                 
008496,000141: 14,7143           31237                           CADR     1/GYRO                                
008497,000142: 
008498,000143: 14,7144           06020                           TC       MODEEXIT                              #  RELINT AND RETURN TO SWRETURN.
008499,000144: 

Page 218

008501,000146: 
008502,000147:                                                                                                  #        SUBROUTINES USED TO ACCUMULATE GYRO COMPENSATION COMMANDS.
008503,000148: 
008504,000149: 14,7145           40000                 -1        COM                                            #  (ENTERS HERE TO RE-COMPLEMENT INPUT).
008505,000150: 14,7146           30116        GCOMPSUB           XCH      MPAC       +1                         #  DOES DP BY SINGLE MULTIPLY WITH DP ADD
008506,000151: 14,7147           25777                           EXTEND                                         #  TO STORAGE.
008507,000152: 14,7150           40116                           MP       MPAC       +1                         
008508,000153: 14,7151           30116                           XCH      MPAC       +1                         
008509,000154: 14,7152           25777                           EXTEND                                         
008510,000155: 14,7153           40115                           MP       MPAC                                  
008511,000156: 14,7154           50034                           TS       OVCTR                                 
008512,000157: 14,7155           30003                           XCH      LP                                    
008513,000158: 14,7156           60116                           AD       MPAC       +1                         #  (AND MAYBE INCREMENT OVCTR).
008514,000159: 
008515,000160: 14,7157           20077        BIASCOMP           INDEX    BUF                                   #  BIAS COMPENSATION ENTERS HERE.
008516,000161: 14,7160           60757                           AD       GCOMP      +1                         
008517,000162: 14,7161           20077                           INDEX    BUF                                   
008518,000163: 14,7162           30757                           XCH      GCOMP      +1                         
008519,000164: 14,7163           30034                           XCH      OVCTR                                 
008520,000165: 14,7164           20077                           INDEX    BUF                                   
008521,000166: 14,7165           60756                           AD       GCOMP                                 
008522,000167: 14,7166           20077                           INDEX    BUF                                   
008523,000168: 14,7167           50756                           TS       GCOMP                                 
008524,000169: 
008525,000170: 14,7170           00001                           TC       Q                                     
008526,000171: 

Page 219

008528,000173: 
008529,000174:                                                                                                  #        SUBROUTINE WHICH ADDS IN GYRO BIAS DRIFT, TESTS TORQUE SIZE TO SEE IF COMMANDS SHOULD BE PUT OUT, AND
008530,000175:                                                                                                  #  ADVANCES GCOMP POINTER.
008531,000176: 
008532,000177: 14,7171           30001        DRIFTSUB           XCH      Q                                     
008533,000178: 14,7172           50100                           TS       BUF        +1                         
008534,000179: 14,7173           30001                           XCH      Q                                     
008535,000180: 14,7174           25777                           EXTEND                                         
008536,000181: 14,7175           40755                           MP       1/PIPADT                              
008537,000182: 14,7176           25777                           EXTEND                                         #  RESULT WAS IN GYRO PULSES X 2(+2).
008538,000183: 14,7177           45502                           MP       FOUR                                  #  RE-SCALE TO ADD INTO GCOMP REGISTER.
008539,000184: 14,7200           50034                           TS       OVCTR                                 
008540,000185: 14,7201           30003                           XCH      LP                                    #  GO TO STANDARD INCREMENT ROUTINE.
008541,000186: 14,7202           07157        DRFTSUB2           TC       BIASCOMP                              
008542,000187: 
008543,000188: 14,7203           35503                           CAF      TWO                                   #  INCREMENT POINTER AND
008544,000189: 14,7204           60077                           AD       BUF                                   
008545,000190: 14,7205           30077                           XCH      BUF                                   #  CHECK MAGNITUDE OF TORQUE COMMAND. IF
008546,000191: 14,7206           20000                           INDEX    A                                     #  SUFFICIENTLY LARGE, SET GCOMPSW PNZ TO
008547,000192: 14,7207           10756                           CCS      GCOMP                                 #  CALL FOR COMPENSATION JOB, 1/GYRO.
008548,000193: 14,7210           07212                           TC       +2                                    #  GETS DABS OF COMMAND.
008549,000194: 14,7211           00100                           TC       BUF        +1                         
008550,000195: 
008551,000196: 14,7212           77260                           MASK     COMPCHK                               
008552,000197: 14,7213           10000                           CCS      A                                     
008553,000198: 14,7214           50101                           TS       GCOMPSW                               
008554,000199: 14,7215           00100                           TC       BUF        +1                         #  RETURN.
008555,000200: 

Page 220

008557,000202: 
008558,000203:                                                                                                  #        (1/PIPA COMES HERE IF PIPA COUNTER SHOWED A DELTA V OF OVER 12 G-SEC.)
008559,000204: 
008560,000205: 14,7216           20101        PIPOVF             INDEX    BUF        +2                         #  SHIFT THE SCALE FACTOR RIGHT 11 ON OVF.
008561,000206: 14,7217           40737                           CS       PIPASCF                               
008562,000207: 14,7220           40000                           COM                                            
008563,000208: 14,7221           25777                           EXTEND                                         
008564,000209: 14,7222           44513                           MP       BIT4                                  
008565,000210: 14,7223           25777                           EXTEND                                         #  FORM DP INCREMENT TO DELV IN THIS CASE.
008566,000211: 14,7224           40115                           MP       MPAC                                  
008567,000212: 14,7225           50034                           TS       OVCTR                                 
008568,000213: 
008569,000214: 14,7226           30003                           XCH      LP                                    
008570,000215: 14,7227           60116                           AD       MPAC       +1                         #  MAYBE INCREMENTING OVCTR.
008571,000216: 14,7230           20101                           INDEX    BUF        +2                         
008572,000217: 14,7231           31002                           XCH      DELVX      +1                         #  NO SKIP SINCE OVCTR SET.
008573,000218: 14,7232           30034                           XCH      OVCTR                                 
008574,000219: 14,7233           60115                           AD       MPAC                                  
008575,000220: 14,7234           20101                           INDEX    BUF        +2                         
008576,000221: 14,7235           31001                           XCH      DELVX                                 
008577,000222: 14,7236           07055                           TC       PIPJUMP                               #  JUMP ON LOOP COUNTER.
008578,000223: 

Page 221

008580,000225: 
008581,000226:                                                                                                  #        THE FOLLOWING JOB IS INITIATED BY 1/PIPA TO PUT OUT COMPENSATING GYRO TORQUE COMMANDS.
008582,000227: 
008583,000228: 14,7237           34504        1/GYRO             CAF      BIT11                                 #  IF MODE SWITCH IN PROGRESS, DONT PUT
008584,000229: 14,7240           70646                           MASK     FLAGWRD1                              #  OUT COMPENSATION THIS TIME.
008585,000230: 14,7241           10000                           CCS      A                                     
008586,000231: 14,7242           02124                           TC       ENDOFJOB                              
008587,000232: 
008588,000233: 14,7243           03416                           TC       FLAG1UP                               #  SHOW IMU ACTIVITY
008589,000234: 14,7244           02000                           OCT      02000                                 #  FLAG TURNED OFF BY GYRO ROUTINES.
008590,000235: 
008591,000236: 14,7245           37060                           CAF      LGCOMP                                #  DISABLE THE T4RUPT CDU DRIVE THEMSELVES.
008592,000237: 14,7246           05654                           TC       BANKCALL                              
008593,000238: 14,7247           31347                           CADR     GYROSPNT                              #  NO TWITCH (2+2-) ON ZERO INPUT.
008594,000239: 
008595,000240: 14,7250           05654                           TC       BANKCALL                              
008596,000241: 14,7251           30331                           CADR     IMUSTALL                              
008597,000242: 14,7252           03066                           TC       CURTAINS                              
008598,000243: 
008599,000244: 14,7253           35501                           CAF      ZERO                                  #  ZERO GCOMP REGSITERS SINCE COMMANDS HAVE
008600,000245: 14,7254           50756                           TS       GCOMP                                 #  BEEN PUT OUT.
008601,000246: 14,7255           50760                           TS       GCOMP      +2                         
008602,000247: 14,7256           50762                           TS       GCOMP      +4                         
008603,000248: 
008604,000249: 14,7257           02124                           TC       ENDOFJOB                              
008605,000250: 
008606,000251: 14,7260           77740        COMPCHK            OCT      -37                                   #  COMMANDS MUST BE AT LEAST 32 PLS.
008607,000252: 

Page 222

008609,000254: 
008610,000255:                                                                                                  #        THE FOLLOWING ROUTINE SUPPLIES GYRO DRIFT COMPENSATION DURING THOSE PORTIONS OF A MISSION WHICH DO NOT
008611,000256:                                                                                                  #  USE PIPA DATA. THIS JOB IS CALLED EVERY 81.93 SECONDS (WHEN APPROPRIATE) BY THE IDLE TASK.
008612,000257: 
008613,000258: 14,7261           40036        BIASONLY           CS       TIME1                                 #  COMPUTE TIME DIFFERENCE (ALMOST ALWAYS
008614,000259: 14,7262           40000                           COM                                            #  81.93 SECS.).
008615,000260: 14,7263           30755                           XCH      OLDBT1                                
008616,000261: 14,7264           40000                           COM                                            
008617,000262: 14,7265           60755                           AD       OLDBT1                                
008618,000263: 14,7266           10000        BONLY2             CCS      A                                     #  LASTBIAS ENTERS HERE.
008619,000264: 14,7267           64516                           AD       ONE                                   
008620,000265: 14,7270           07275                           TC       BONLY3                                
008621,000266: 14,7271           07273                           TC       +2                                    
008622,000267: 14,7272           02124                           TC       ENDOFJOB                              #  MAY HAVE A COMPUTED DIFF = 0.
008623,000268: 
008624,000269: 14,7273           40000                           COM                                            
008625,000270: 14,7274           64476                           AD       POSMAX                                
008626,000271: 
008627,000272: 14,7275           25777        BONLY3             EXTEND                                         #  FORM DELTA-T AT 2(+8) CS.
008628,000273: 14,7276           44506                           MP       BIT9                                  #  SHIFT RIGHT 6.
008629,000274: 14,7277           50115                           TS       MPAC                                  
008630,000275: 14,7300           50106                           TS       TEM9                                  
008631,000276: 14,7301           30003                           XCH      LP                                    
008632,000277: 14,7302           50116                           TS       MPAC       +1                         
008633,000278: 14,7303           50107                           TS       TEM10                                 
008634,000279: 14,7304           35501                           CAF      ZERO                                  
008635,000280: 14,7305           50101                           TS       GCOMPSW                               
008636,000281: 14,7306           50077                           TS       BUF                                   
008637,000282: 
008638,000283: 14,7307           40744                           CS       GBIASX                                #  DO X, Y, AND THEN Z.
008639,000284: 14,7310           07331                           TC       FBIASSUB                              
008640,000285: 
008641,000286: 14,7311           40106                           CS       TEM9                                  #  RELOAD DT.
008642,000287: 14,7312           50115                           TS       MPAC                                  
008643,000288: 14,7313           40107                           CS       TEM10                                 
008644,000289: 14,7314           50116                           TS       MPAC       +1                         
008645,000290: 14,7315           40745                           CS       GBIASY                                
008646,000291: 14,7316           07330                           TC       FBIASSUB   -1                         
008647,000292: 
008648,000293: 14,7317           40106                           CS       TEM9                                  
008649,000294: 14,7320           50115                           TS       MPAC                                  
008650,000295: 14,7321           40107                           CS       TEM10                                 
008651,000296: 14,7322           50116                           TS       MPAC       +1                         
008652,000297: 14,7323           40746                           CS       GBIASZ                                
008653,000298: 14,7324           07330                           TC       FBIASSUB   -1                         

Page 223

008655,000300: 14,7325           10101                           CCS      GCOMPSW                               #  PUT OUT COMPENSATION IF CALLED FOR.
008656,000301: 14,7326           07237                           TC       1/GYRO                                
008657,000302: 14,7327           02124                           TC       ENDOFJOB                              
008658,000303: 
008659,000304: 14,7330           40000                 -1        COM                                            
008660,000305: 14,7331           30001        FBIASSUB           XCH      Q                                     
008661,000306: 14,7332           50100                           TS       BUF        +1                         
008662,000307: 14,7333           35501                           CAF      ZERO                                  
008663,000308: 14,7334           50117                           TS       MPAC       +2                         
008664,000309: 14,7335           30001                           XCH      Q                                     
008665,000310: 14,7336           05416                           TC       SHORTMP                               
008666,000311: 14,7337           30115                           XCH      MPAC                                  
008667,000312: 14,7340           50034                           TS       OVCTR                                 
008668,000313: 14,7341           30116                           XCH      MPAC       +1                         
008669,000314: 14,7342           07202                           TC       DRFTSUB2                              #  RETURN TO CALLER VIA BUF +1.
008670,000315: 
008671,000316: 14,7343           30755        LASTBIAS           XCH      OLDBT1                                #  COMES HERE FOR TRANSITION TO PIPA READ-
008672,000317: 14,7344           40000                           COM                                            #  ING MODE. NEW VALUE OF 1/PIPADT ARRIVES
008673,000318: 14,7345           60115                           AD       MPAC                                  #  IN A WITH WITH TIME1 AT PIPA ZEROING IN
008674,000319: 14,7346           07266                           TC       BONLY2                                #  MPAC. EXITS VIA ENDOFJOB.

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