forked from virtualagc/virtualagc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPRELAUNCH_ALIGNMENT_PROGRAM.agc
660 lines (510 loc) · 10 KB
/
PRELAUNCH_ALIGNMENT_PROGRAM.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
### FILE="Main.annotation"
## Copyright: Public domain.
## Filename: PRELAUNCH_ALIGNMENT_PROGRAM.agc
## Purpose: A section of Sunrise 45.
## It is part of the reconstructed source code for the penultimate
## release of the Block I Command Module system test software. No
## original listings of this program are available; instead, this
## file was created via disassembly of dumps of Sunrise core rope
## memory modules and comparison with the later Block I program
## Solarium 55.
## Assembler: yaYUL --block1
## Contact: Ron Burkey <[email protected]>.
## Website: www.ibiblio.org/apollo/index.html
## Mod history: 2022-12-09 MAS Initial reconstructed source.
## Names in this section are largely taken from AGC Information Series Issue 22,
## Prelaunch Alignment.
# THE PRELAUNCH ALIGNMENT PROGRAM CONSISTS OF TWO PARTS- VERTICAL ERECTION AND GYROCOMPASSING. IN THE FIRST CASE
# THE Z PIPA INPUTS ARE USED TO CONTROL THE Y GYRO IN SUCH A WAY THAT THESE INPUTS ARE NULLED. A SIMILAR SIT-
# UATION APPLIES TO THE Y PIPA INPUTS AND THE Z GYRO.IN THE GYROCOMPASSING CASE, THE Y PIPA INPUTS ARE USED IN
# EXACTLY THE SAME FASHION AS IN VERTICAL ERECTION. THE Z PIPA INPUTS ARE SPLIT BETWEEN THE Y GYRO TO HOLD THE
# VERTICAL AND THE X GYRO TO POINT THE Z AXIS ALONG SOME DESIRED AZIMUTH.
# WHILE PRELAUNCH IS ACTIVE IT STAYS IN THE EXECUTIVE AND USES THE SLEEP/WAKE FEATURES. BY THIS MEANS MOST
# ERASABLE USAGE IS CONFINED TO A VAC AREA. THE ASSIGNMENT IS AS FOLLOWS-
SINAZ = 2 # SIN OF AZIMUTH
COSAZ = 4 # COSINE OF AZIMUTH
FILTER = 6
DELZ = 8D
DELY = 10D
DELE = 12D
FILDELZ = DELE
DELS = 14D
FILDELY = DELS
INT = 16D
PREVTIME = 20D
THETAY = 24D
THETAZ = 26D
THETAX = 28D
THETASTH = 30D
THETAE = 32D
SINLAM = 34D # SIN OF LATITUDE
COSLAM = 36D # COSINE OF LATITUDE
BANK 23
TOP1 CAF QUARTER
TS AZIMUTH
CAF ZERO
TS AZIMUTH +1
TS PRELYGA
TS PRELZGA
TS PRELXGA
TS DRIFTY
TS DRIFTZ
TS DRIFTX
CAF LABLAT
TS LATITUDE
CAF LABLAT +1
TS LATITUDE +1
# ENTER AT TOP2 IF GIMBAL ANGLES, AZIMUTH, LATITUDE ALREADY KEYED IN
TOP2 TC BANKCALL # GO AND START CDU ZEROING
CADR IMUZERO
CAF SIXHNDRD # INITIALIZE FOR 5 MIN VERTICAL
TS GYROCSW
CAF PRELKG
TS KG
CAF ZERO # INITIALIZE ERASABLE MEMORY TO ZEROS
TS GYROD
TS GYROD +2
TS GYROD +4
TS KH
TC BANKCALL # INITIALIZATION COMPLETE SO STALL
CADR IMUSTALL
TC PRELEXIT
TC PHASCHNG # GO INTO COARSE ALIGN PHASE.
OCT 01100
TC PRELEXIT
TC PLSTCHK
REPL11 TC BANKCALL
CADR IMUCOARS
TC BANKCALL # NOTHING TO DO BUT SPEEP
CADR IMUSTALL
TC PRELEXIT
STARTPL2 TC PHASCHNG # START FINE ALIGN - INITIALIZATION PHASE.
OCT 01200
TC PRELEXIT
TC PLSTCHK
REPL12 TC BANKCALL
CADR IMUFINE
TC BANKCALL # SLEEP
CADR IMUSTALL
TC PRELEXIT
TC PHASCHNG
OCT 01300
TC PRELEXIT
TC PLSTCHK
PLREFINE TC INTPRET
RTB 1
SIN
ZEROVAC
LATITUDE
STORE SINLAM
COS 0
LATITUDE
STORE COSLAM
SMOVE 1
DSU
90DEGAZ
AZIMUTH
SIN 0
0
STORE SINAZ
COS 0
STORE COSAZ
RTB 0
LOADTIME
STORE PREVTIME
EXIT 0
CAF ZERO
TS PIPAY # SET ALL PIPAS TO ZERO
TS PIPAZ
INHINT
CAF PRELDT # SET WAITLIST TO WAKE JOB
TC WAITLIST
CADR PRELALTS
CAF WAKEPRAD
TC JOBSLEEP
# PRELAUNCH WAITLIST TASK - EXECUTED EVERY .5 SEC. IN LOOP.
PRELALTS CAF ZERO
XCH PIPAY
TS RUPTREG1
CAF ZERO
XCH PIPAZ
TS RUPTREG2
TC GETPHASE
OCT 0
TC NOPLWAIT
CAF PRELDT # SELF-SUSTAINING WAITLIST CALL
TC WAITLIST
CADR PRELALTS
NOPLWAIT CAF WAKEPRAD
TC JOBWAKE
CCS PHASDATA
TC +2
TC TASKOVER
XCH RUPTREG1
INDEX PHASDATA
TS MPAC
XCH RUPTREG2
INDEX PHASDATA
TS MPAC +1
TC TASKOVER # RESUME
PRAWAKE XCH MPAC
INDEX FIXLOC
TS DELY
XCH MPAC +1
INDEX FIXLOC
TS DELZ
TC INTPRET
SMOVE 0 # ZERO TO THEAT-SOUTH
ZEROPR
STORE THETASTH
NOLOD 0
STORE THETAE # ZERO TO THETA EAST
EXIT 0
TC GETPHASE # CHECK IF VERTICAL ERECTION (UNCONDIT.)
OCT 0
TC PRELEXIT
TS MPAC
TC PLSTCHK
INDEX MPAC
TC -12
TC NOGYROCM
TC TJL
DOGYROC TC INTPRET
ITC 0
GYROCOM
ITC 0
EARTHRAT
ENDOFPR EXIT 0
CCS WASKSET
TC +4
TC PRELEXIT
TC +2
TC PRELEXIT
CAF ZERO # INITIALIZE TORQUING REGISTERS AND RESET
INDEX FIXLOC
XCH THETAX
TC PLLIMIT
TS GYROD +1
CAF ZERO
INDEX FIXLOC
XCH THETAY
TC PLLIMIT
TS GYROD +3
CAF ZERO
INDEX FIXLOC
XCH THETAZ
TC PLLIMIT
TS GYROD +5
TC BANKCALL
CADR IMUPULSE
TC BANKCALL
CADR IMUSTALL
TC PRELEXIT
CAF WAKEPRAD
TC JOBSLEEP
PLLIMIT TS OVCTR
XCH Q
TS TEM2
CCS OVCTR
AD -320PLS
TC +2
AD -320PLS
CCS A
TC +5
TC TEM2
NOOP
XCH OVCTR
TC TEM2
CCS OVCTR
CS -320PLS
TC TEM2
CAF -320PLS
TC TEM2
-320PLS DEC -320
# VERTICAL ERECTION PROCEDURES.
NOGYROCM CCS GYROCSW # COUNT DOWN FOR 5 MIN OF VERTICAL ERECT.
TC MORE # IF MORE TO COME.
TC PHASCHNG # IF NOT, GO INTO GYROCOMP
OCT 01500
TC PRELEXIT
TC PLSTCHK
TC +2
MORE TS GYROCSW
TJL TC INTPRET
ITC 0
EARTHRAT
DSU 1
DMP DAD
DELY
FILDELY
VERECTC3
FILDELY
STORE FILDELY
AXC,1 1
AXC,2 ITC
2
0
VERECT
DSU 1
DMP DAD
DELZ
FILDELZ
VERECTC3
FILDELZ
STORE FILDELZ
AXC,1 2
NOLOD COMP
ITC
0
VERECT
ITC 0
ENDOFPR
# CALCULATION OF EARTH RATE
EARTHRAT RTB 0
LOADTIME
STORE S1
NOLOD 2
DSU TSLT
DMPR
PREVTIME
14D
LOMEGA
DMOVE 0
S1
STORE PREVTIME
DMP 1 # SIN(LAMBDE).DT.LENGTH OMEGA + THETA X
TSLT DAD
0
SINLAM
1
THETAX
STORE THETAX
DMP 1 # -COS(LAMBDA).DT.LENGTH OMEGA + THETA STH
TSLT BDSU
-
COSLAM
1
THETASTH
STORE THETASTH
DMP 1 # COS(AZIMUTH). SOUTH COMPONENT
TSLT
THETASTH # TO P.D. LIST
COSAZ
1
DMP 2 # Y COMPONENT = SIN(AZIMUTH).EAST COMP
TSLT DAD # + COS(AZIMUTH). SOUTH
DAD
THETAE # COMP
SINAZ
1
THETAY
STORE THETAY
DMP 1 # SIN(AZIMUTH). SOUTH COMPONENT
TSLT
SINAZ # TO P.D. LIST
THETASTH
1
DMP 2 # Z COMPONENT = COS(AZIMUTH.EAST COMP
TSLT DSU
DAD
COSAZ # -SIN(AZIMUTH).SOUTH COMP
THETAE
1
-
THETAZ
STORE THETAZ
SMOVE 1
TSRT DAD
DRIFTX
14D
THETAX
STORE THETAX
SMOVE 1
TSRT DAD
DRIFTY
14D
THETAY
STORE THETAY
SMOVE 1
TSRT DAD
DRIFTZ
14D
THETAZ
STORE THETAZ
ITCQ 0
# COMPUTATION OF GYROCOMPASS COMMAND
GYROCOM ITA 1
DMP TSLT
PRELTEMP
DELZ
COSAZ
1
DMP 1 # DELTA-V(EAST)= COS(AZ).DELTA-V(Z)
TSLT DAD
DELY
SINAZ
1
STORE DELE
AXC,1 2
AXC,2 NOLOD
COMP ITC
6
2
VERECT
DMP 1 # SIN(AZ).DELTA-V(Z)
TSLT
DELZ
SINAZ
1
DMP 1 # DELTA-V(SOUTH= COS(AZ.DELTA-V(Y)
TSLT DSU
DELY
COSAZ
1
STORE DELS
DMP 0
DELS # C1. DELTA-V(SOUTH) TO P.D. LIST
GYRCMC1
DMP 1 # FILTER = C1. DELTA-V(SOUTH)
DAD # +C2. FILTER
FILTER
GYRCMC2
STORE FILTER
DMP 1
TSLT DAD
FILTER
GYRCMC3
5
THETAX
STORE THETAX
DMP 1 # EAST-TORQUING ANGLE = C4.FILTER
TSLT
FILTER
GYRCMC4
2
STORE THETAE
ITCI 0
PRELTEMP
# VERTICAL ERECTION SUBROUTINE
#
# VERECT - VERTICAL ERECTION ENTERED IN INT. MODE WITH
# SUBROUTINE C(X1)= 2 FOR C(MPAC)= DEL-V Y
# = 0 C(MPAC)=-DEL-V Z
# = 6 FOR C(MPAC)=-DEL-V E
# FOR THESE THREE CASES OUTPUT WILL BE
# THETA-Z
# THETA-Y
# THETA-S RESPECTIVELY.
# LOOP CONSTANTS ARE DETERMINED BY
# C(X2)= 0 NO GYROCOMPASSING
# 2 GYROCOMPASSING
VERECT NOLOD 0
STORE S1
NOLOD 1
DAD*
INT,1 # COMPUTE INTEGRAL OF DEL-V = INT
STORE INT,1
DMOVE 1
DMP* TSLT
S1
VERECTC1,2
5
DMP* 1
DAD* DAD
INT,1 # THETA = THETA + C1 DEL-V + C2 INT
VERECTC2,2
THETAY,1
STORE THETAY,1
ITCQ 0
# PRELAUNCH MANUAL REQUEST PROCESSOR.
STARTPL CAF PLPRIO # ENTER EXECUTIVE REQUEST ON START-UP.
TC FINDVAC
CADR STARTPL2
TC SWRETURN
PLSTCHK CS EIGHT # PRELAUNCH COMES HERE WHENEVER A PHASE
AD MPAC # REFERENCE IS MADE TO SEE IF A MANUAL
CCS A # REQUEST HAS BEEN ENTERED THROUGH MASTER
TC Q # CONTROL. ALL SUCH PHASES ARE LESS THAN 8
PLPRIO OCT 24000
TC +1
INDEX MPAC # SEE WHICH MANUAL MODE REQUESTED.
TC +0
TC TOP1 # 1 - INITIALIZATION 1.
TC TOP2 # 2 - INITIALIZATION 2.
TC PLFINCHK
TC PLFINCHK
TC TOP1
TC TOP1
TC TOP1
PLFINCHK CCS WASKSET # SEE IF IN FINE ALIGN.
TC 3CHECK
TC PRELEXIT # SYSTEM IN BAD SHAPE.
TC DOPLCHNG # DO THE CHANGE ANYWAY.
TC PRELEXIT # SYSTEM IN BAD SHAPE.
3CHECK AD -CCSFINE
CCS A
TC TOP1
-CCSFINE OCT -47 # WASKSET IS 50 FOR FINE ALIGN.
TC TOP1
DOPLCHNG INDEX MPAC
TC -2
TC DOPL14
DOPL15 TC PHASCHNG # SET PHASE TO GYROCOMPASSING
OCT 01500
TC PRELEXIT
TC DOGYROC
DOPL14 TC PHASCHNG # SET PHASE TO UNCONDITIONAL VERT-
OCT 01400 # ICAL ERECTION
TC PRELEXIT
TC TJL
# PRELAUNCH GO-SEQUENCE PROCESSOR.
#
PRELGO CAF PLPRIO
TC FINDVAC
CADR PLRESTT
TC SWRETURN
PLRESTT TC GETPHASE
OCT 0
TC PRELEXIT
TS MPAC
TC PLSTCHK
CS MAXPHASE
AD MPAC
CCS A
TC PRELEXIT
MAXPHASE OCT 15
TC PLGOFAN
REPLLOOP CAF FINECODE
TS DESKSET
TC PLREFINE
PLGOFAN INDEX MPAC
TC -10
TC REPL11
TC REPL12
TC REPLLOOP
TC REPLLOOP
TC REPLLOOP
FINECODE OCT 50 # FINE ALIGN AND COMPUTER CONTROL.
# PRELAUNCH TERMINATION.
PRELEXIT CS ZERO # RETURN IMU TO MANUAL CONTROL.
TS CDUIND
TC MAJEXIT
OCT 0
# PRELAUNCH BANK STORED CONSTANTS
VERECTC1 2DEC 20. B-5 # VERTICAL LOOP CONSTANTS
2DEC 1 B-5
VERECTC2 2DEC .4
2DEC .001
VERECTC3 2DEC .1
GYRCMC1 2DEC .999999999
GYRCMC2 2DEC 0.0
GYRCMC3 2DEC -68 B-7
GYRCMC4 2DEC 4 B-3
LABLAT 2DEC .117678252 # LATITUDE OF IL-7
90DEGAZ 2DEC .25 # 90 DEG. FROM NORTH = EAST
PRELKG DEC .18
PRELDT DEC .5 E2 # HALF SECOND PRELAUNCH CYCLE
WAKEPRAD CADR PRAWAKE # WAKING ADDRESS FOR PRELAUNCH
ZEROPR OCT 0 # OUR OWN PERSONAL COPY OF ZERO
SIXHNDRD DEC 600
LOMEGA 2DEC .12169524 # EARTH RATE IN IRIG PULSES PER .01 SEC.