forked from virtualagc/virtualagc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathS-BAND_ANTENNA_FOR_LM.agc
190 lines (175 loc) · 8 KB
/
S-BAND_ANTENNA_FOR_LM.agc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
### FILE="Main.annotation"
## Copyright: Public domain.
## Filename: S-BAND_ANTENNA_FOR_LM.agc
## Purpose: A section of Luminary revision 163.
## It is part of the reconstructed source code for the first
## (unflown) release of the flight software for the Lunar
## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
## The code has been recreated from a reconstructed copy of
## Luminary 173, as well as Luminary memos 157 amd 158.
## It has been adapted such that the resulting bugger words
## exactly match those specified for Luminary 163 in NASA
## drawing 2021152N, which gives relatively high confidence
## that the reconstruction is correct.
## Reference: pp. 494-497
## Assembler: yaYUL
## Contact: Ron Burkey <[email protected]>.
## Website: www.ibiblio.org/apollo/index.html
## Mod history: 2019-08-21 MAS Created from Luminary 173.
## Page 494
# SUBROUTINE NAME: R05 - S-BAND ANTENNA FOR LM
# MOD0 BY T. JAMES
# MOD1 BY P. SHAKIR
# FUNCTIONAL DESCRIPTION
# THE S-BAND ANTENNA ROUTINE, R05, COMPUTES AND DISPLAYS THE PITCH AND
# YAW ANTENNA GIMBAL ANGLES REQUIRED TO POINT THE LM STEERABLE ANTENNA
# TOWARD THE CENTER OF THE EARTH. THIS ROUTINE IS SELECTED BY THE ASTRO-
# NAUT VIA DSKY ENTRY DURING COASTING FLIGHT OR WHEN THE LM IS ON THE MOON
# SURFACE. THE EARTH OR MOON REFERENCE COORDINATE SYSTEM IS USED DEPENDING
# ON WHETHER THE LM IS ABOUT TO ENTER OR HAS ALREADY ENTERED THE MOON
# SPHERE OF INFLUENCE, RESPECTIVELY. CAN BE CALLED ANY TIME EXCEPT WHEN
# ANOTHER EXTENDED VERB IS IN USE. DISPLAY IS MEANINGLESS WITH IMU OFF.
# TO CALL SUBROUTINE, ASTRONAUT KEYS IN V 64 E
# SUBROUTINES CALLED-
# INTPRET
# LOADTIME
# LEMCONIC
# LUNPOS
# CDUTRIG
# *SMNB*
# BANKCALL
# B5OFF
# ENDOFJOB
# BLANKET
# RETURNS WITH
# PITCH ANGLE IN PITCHANG REV. B0
# YAW ANGLE IN YAWANG REV. B0
# ERASABLES USED
# PITCHANG
# YAWANG
# RLM
# VAC AREA
BANK 41
SETLOC SBAND
BANK
EBANK= WHOCARES
COUNT* $$/R05
SBANDANT TC INTPRET
## Page 495
SETPD RTB
0D
LOADTIME # PICK UP CURRENT TIME
STCALL TDEC1 # ADVANCE INTEGRATION TO TIME IN TDEC1
LEMCONIC # USING CONIC INTEGRATION
SLOAD BHIZ
X2 # X2 =0 EARTH SPHERE, X2 =2 MOON SPHERE
CONV4
VLOAD
RATT
STODL RLM
TAT
CONV3 CALL
LUNPOS # UNIT POSITION VECTOR FROM EARTH TO MOON
VLOAD VXSC
VMOON
REMDIST # MEAN DISTANCE FROM EARTH TO MOON
VSL1 VAD
RLM
GOTO
CONV5
CONV4 VLOAD
RATT # UE = -UNIT(RATT) EARTH SPHERE
CONV5 SETPD UNIT # UE = -UNIT((REM)(UEM) + RL) MOON SPHERE
0D # SET PL POINTER TO 0
VCOMP CALL
CDUTRIG # COMPUTE SINES AND COSINES OF CDU ANGLES
MXV VSL1 # TRANSFORM REF. COORDINATE SYSTEM TO
REFSMMAT # STABLE MEMBER B-1 X B-1 X B+1 = B-1
PUSH DLOAD # 8D
HI6ZEROS
STORE PITCHANG
STOVL YAWANG # ZERO OUT ANGLES
CALL
*SMNB*
STODL RLM # PRE-MULTIPLY RLM BY (NBSA) MATRIX(B0)
RLM +2
PUSH DSU
RLM
DMP
1OVSQRT2
STODL RLM +2
DAD DMP
RLM
1OVSQRT2
STOVL RLM # R B-1
RLM
UNIT PDVL
RLM
VPROJ VSL2 # PROJECTION OF R ONTO LM XZ PLANE
## Page 496
HIUNITY
BVSU BOV # CLEAR OVERFLOW INDICATOR IF ON
RLM
COVCNV
COVCNV UNIT BOV # EXIT ON OVERFLOW
SBANDEX
PUSH VXV # URP VECTOR B-1
HIUNITZ
VSL1 VCOMP # UZ X URP = -(URP X UZ)
STORE RLM # X VEC B-1
DOT PDVL # SGN(X.UY) UNSCALED
HIUNITY
RLM
ABVAL SIGN
ASIN # ASIN((SGN(X.UY))ABV(X)) REV B0
STOVL PITCHANG
URP
DOT BPL
HIUNITZ
NOADJUST # YES, -90 TO +90
DLOAD DSU
HIDPHALF
PITCHANG
STORE PITCHANG
NOADJUST VLOAD VXV
UR # Z = (UR X URP)
URP
VSL1
STODL RLM # Z VEC B-1
PITCHANG
SIN VXSC
HIUNITZ
PDDL COS
PITCHANG
VXSC VSU
HIUNITX # (UX COS ALPHA) - (UZ SIN ALPHA)
DOT PDVL # YAW.Z
RLM
RLM
ABVAL SIGN
ASIN
STORE YAWANG
SBANDEX EXIT
CA EXTVBACT
MASK BIT5 # IS BIT5 STILL ON
EXTEND
BZF ENDEXT # NO
CAF PRIO5
TC PRIOCHNG
CAF V06N51 # DISPLAY ANGLES
## Page 497
TC BANKCALL
CADR GOMARKFR
TC B5OFF # TERMINATE
TC B5OFF # PROCEED
TC ENDOFJOB # RECYCLE
CAF BIT3 # IMMEDIATE RETURN
TC BLANKET # BLANK R3
CAF PRIO4
TC PRIOCHNG
TC SBANDANT # YES, CONTINUE DISPLAYING ANGLES.
V06N51 VN 0651
1OVSQRT2 2DEC .7071067815 # 1/SQRT(2)
UR EQUALS 0D
URP EQUALS 6D
SBANK= LOWSUPER