Code review of #756

As it was merged before I could review it
This commit is contained in:
James Harris 2020-10-13 17:40:29 +01:00
parent 124275cfaa
commit 0549b538d0

View File

@ -43,8 +43,8 @@
# GTS IS THE ENTRY TO THE GIMBAL TRIM SYSTEM FOR CONTROLLING ATTITUDE ERRORS AND RATES AS WELL AS ACCELERATIONS.
GTS CAF NEGONE # MAKE THE NEXT PASS THROUGH THE DAP BE
TS COTROLER # THROUGH RCS CONTROL,
CAF FOUR # AND ENSURE THAT IT IS NOT A SKIP.
TS COTROLER # THROUGH RCS CONTROL,
CAF FOUR # AND ENSURE THAT IT IS NOT A SKIP.
TS SKIPU
TS SKIPV
@ -55,11 +55,11 @@ GTS CAF NEGONE # MAKE THE NEXT PASS THROUGH THE DAP BE
# THE DRIVE SETTING ALGORITHM
#
# DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
# 2 1/2 2 3/2
# NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K (DEL*OMEGA + ALPHA /(2*K))
# DEL = SGN(OMEGA + ALPHA*ABS(ALPHA)/(2*K))
# 2 1/2 2 3/2
# NEGUSUM = ERROR*K + ALPHA*(DEL*OMEGA + ALPHA /(3*K)) + DEL*K (DEL*OMEGA + ALPHA /(2*K))
#
# DRIVE = -SGN(NEGUSUM)
# DRIVE = -SGN(NEGUSUM)
CA SR # SAVE THE SR. SHIFT IT LEFT TO CORRECT
AD A # FOR THE RIGHT SHIFT DUE TO EDITING.
@ -71,11 +71,11 @@ GTSGO+ON CAF TWO # SET INDEXER FOR R-AXIS CALCULATIONS.
GOQTRIMG CAF ZERO # SET INDEXER FOR Q-AXIS CALCULATIONS
TS QRCNTR
# Page 1473
# RSB 2009 ---------------------------------------------------------------------
# RSB 2009 -----------------------------------------------------------------------
# Everything between this line and the similar line below was simply filled-in
# as-is from Luminary 131, and then verified to assemble to the proper binary
# values. This area is blank on the Luminary 099 print-out, as if the
# printer ribbon had run out.
# values. This area is blank on the Luminary 099 print-out, as if the printer
# ribbon had run out.
INDEX QRCNTR # AOS SCALED AT PI/2
CA AOSQ
EXTEND
@ -124,7 +124,7 @@ ALGORTHM EXTEND # Q(R)DIFF IS THETA (ERROR) SCALED AT PI.
EXTEND
DCS A # ALPHA(2)/2 - K
AD KCENTRAL
# RSB 2009 ---------------------------------------------------------------------
# RSB 2009 -----------------------------------------------------------------------
EXTEND
DV KCENTRAL # HIGH ORDER OF QUOTIENT.
XCH A2CNTRAL
@ -202,7 +202,7 @@ FUNCT3 CA A2CNTRAL
MP NEG1/3
ADS A2CNTRAL +1
TS L
TCF +2 # A2CNTRAL NOW CONTAINS -ALPHA(2)/(6*K),
TCF +2 # A2CNTRAL NOW CONTAINS -ALPHA(2)/(6*K),
ADS A2CNTRAL # SCALED AT 16*PI, IN D.P.
EXTEND
@ -302,7 +302,7 @@ ACDT+C12 CS NEGUQ
# THE OFFSET ANGULAR ACCELERATION ABOUT THE Q (OR R) AXIS. INSTEAD OF USING AOSQ(R), TIMEGMBL USES .4*AOSQ(R),
# SCALED AT PI/8. FOR EACH AXIS, THE DRIVE TIME IS COMPUTED AS ABS(ALPHA/ACCDOT). A ZERO
# ALPHA OR ACCDOT OR A ZERO QUOTIENT TURNS OFF THE GIMBAL DRIVE IMMEDIATELY. OTHERWISE, THE GIMBAL IS TURNED ON
# DRIVING IN THE CORRECT DIRECTION. THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
# DRIVING IN THE CORRECT DIRECTION. THE Q(R)GIMTIMR IS SET TO TERMINATE THE DRIVE AND Q(R)ACCDOT
# IS STORED TO REFLECT THE NEW ACCELERATION DERIVATIVE. NEGUQ(R) WILL CONTAIN +1,+0,-1 FOR A Q(R)ACCDOT VALUE
# WHICH IS NEGATIVE, ZERO, OR POSITIVE.
#
@ -323,15 +323,15 @@ ACDT+C12 CS NEGUQ
# INTERRUPT INHIBITED.
#
# ERASABLE STORAGE CONFIGURATION (NEEDED BY THE INDEXING METHODS):
# NEGUQ ERASE +2 # NEGATIVE OF Q-AXIS GIMBAL DRIVE
# (SPWORD) EQUALS NEGUQ +1 # ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
# NEGUR EQUALS NEGUQ +2 # NEGATIVE OF R-AXIS GIMBAL DRIVE
# ACCDOTQ ERASE +2 # Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
# (SPWORD) EQUALS ACCDOTQ +1 # ANY S.P. ERASABLE NUMBER NOW QACCDOT
# ACCDOTR EQUALS ACCDOTQ +2 # R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
# # ACCDOTQ, ACCDOTR ARE MAGNITUDES.
# AOSQ ERASE +4 # Q-AXIS ACC., D.P. AT PI/2 R/SEC(2)
# AOSR EQUALS AOSQ +2 # R-AXIS ACCELERATION SCALED AT PI/2 R/S2
# NEGUQ ERASE +2 # NEGATIVE OF Q-AXIS GIMBAL DRIVE
# (SPWORD) EQUALS NEGUQ +1 # ANY S.P. ERASABLE NUMBER, NOW THRSTCMD
# NEGUR EQUALS NEGUQ +2 # NEGATIVE OF R-AXIS GIMBAL DRIVE
# ACCDOTQ ERASE +2 # Q-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
# (SPWORD) EQUALS ACCDOTQ +1 # ANY S.P. ERASABLE NUMBER NOW QACCDOT
# ACCDOTR EQUALS ACCDOTQ +2 # R-JERK TERM SCALED AT PI/2(7) RAD/SEC(3)
# # ACCDOTQ,ACCDOTR ARE MAGNITUDES.
# AOSQ ERASE +4 # Q-AXIS ACC., D.P. AT PI/2 R/SEC(2)
# AOSR EQUALS AOSQ +2 # R-AXIS ACCELERATION SCALED AT PI/2 R/S2
QRNDXER EQUALS ITEMP6
OCT23146 OCTAL 23146 # DECIMAL .6
@ -358,10 +358,10 @@ ALPHATRY INDEX QRNDXER
EXTEND
BZF TGOFFNOW # IS ALPHA ZERO?
TS Q # SAVE A COPY OF -AOS.
TS Q # SAVE A COPY OF -AOS.
EXTEND # NO. RESCALE FOR TIMEGMBL USE.
MP OCT23146 # OCTAL 23146 IS DECIMAL .6
AD Q # -1.6*AOS AT PI/2 = -.4*AOS AT PI/8
AD Q # -1.6*AOS AT PI/2 = -.4*AOS AT PI/8.
TS L # WAS THERE OVERFLOW?
TCF SETNEGU # NO. COMPUTE DRIVE TIME.
@ -433,14 +433,14 @@ DONEYET CCS QRNDXER
OCT00240 OCTAL 00240 # DECIMAL 10/1024
# Page 1481
# THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY. THE QUANTITY NEGUSUM
# THE FOLLOWING SECTION IS A CONTINUATION OF THE TRIM GIMBAL CONTROL FROM THE LAST GTS ENTRY. THE QUANTITY NEGUSUM
# IS COMPUTED FOR EACH AXIS (Q,R), .707*DEL*FUNCTION(3/2) + K2THETA = NEGUSUM. NEW DRIVES ARE ENTERED TO CH 12.
#
# THE SUBROUTINE GTSQRT ACCEPTS A DOUBLE PRECISION VALUE IN FUNCTION, FUNCTION +1 AND RETURNS A SINGLE-PRECISION
# SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF THE ARGUMENT. ALSO, THE CELL SHFTFLAG CONTAINS A BINARY
# EXPONENT S, SUCH THAT THE SQUARE ROOT (RETURNED IN THE A REGISTER) MUST BE SHIFTED RIGHT (MULTIPLIED BY 2 TO THE
# POWER (-S)) IN ORDER TO BE THE TRUE SQUARE ROOT OF THE FOURTEEN MOST SIGNIFICANT BITS OF FUNCTION, FUNCTION +1.
# SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT. CELLS CLOBBERED ARE A,L,SHFTFLAG.ININDEX,
# SQUARE ROOT ERROR IS NOT MORE THAN 2 IN THE 14TH SIGNIFICANT BIT. CELLS CLOBBERED ARE A,L,SHFTFLAG,ININDEX,
# HALFARG,SCRATCH,SR,FUNCTION, FUNCTION +1. GTSQRT IS CALLED BY TC GTSQRT AND RETURNS VIA TC Q OR TC FUNCTION +1.
# ZERO OR NEGATIVE ARGUMENTS YIELD ZERO FOR SQUARE ROOTS.
@ -506,14 +506,14 @@ SCALDONE EXTEND
TC ROOTCYCL
TC ROOTCYCL
TC FUNCTION +1
# ***************************************************************************
# ****************************************************************************************************************
RSTOFGTS TC GTSQRT
PRODUCT XCH K2CNTRAL
EXTEND
MP K2CNTRAL
DXCH K2CNTRAL
EXTEND # THE PRODUCT OF
EXTEND # THE PRODUCT OF
MP L # 1/2 2 1/2
ADS K2CNTRAL +1 # K *(DEL*OMEGA + ALPHA /(2*K))
TS L # AND
@ -596,14 +596,14 @@ CLOSEADR 2CADR CLOSEOUT # TERMINATE THE JASK.
TWELVE EQUALS OCT14
ROOTHALF OCTAL 26501 # SQUARE ROOT OF 1/2
GMBLBITA OCTAL 01400 # INDEXED WRT GMBLBITB DO NOT MOVE *******
GMBLBITA OCTAL 01400 # INDEXED WRT GMBLBITB DO NOT MOVE******
OCT11276 OCTAL 11276 # POSMAX - ROOTHALF
GMBLBITB OCTAL 06000 # INDEXED WRT GMBLBITA DO NOT MOVE *******
GMBLBITB OCTAL 06000 # INDEXED WRT GMBLBITA DO NOT MOVE******
# SUBROUTINE ROOTCYCL: BY CRAIG WORK, 3 APRIL 68
# SUBROUTINE ROOTCYCL: BY CRAIG WORK,3 APRIL 68
# ROOTCYCL IS A SUBROUTINE WHICH EXECUTES ONE NEWTON SQUARE ROOT ALGORITHM ITERATION. THE INITIAL GUESS AT THE
# SQUARE ROOT IS PRESUMED TO BE IN THE A REGISTER AND ONE-HALF THE SQUARE IS TAKEN FROM HALFARG. THE NEW APPROXI-
# MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER. DEBRIS: A,L,SR,SCRATCH. ROOTCYCL IS CALLED FROM
# MATION TO THE SQUARE ROOT IS RETURNED IN THE A REGISTER. DEBRIS: A,L,SR,SCRATCH. ROOTCYCL IS CALLED FROM
# LOCATION (LOC) BY A TC ROOTCYCL, AND RETURNS (TC Q) TO LOC +1.
# WARNING: IF THE INITIAL GUESS IS NOT GREATER THAN THE SQUARE, DIVIDE OR ADD OVERFLOW IS A REAL POSSIBILITY.