forked from chrislgarry/Apollo-11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
REENTRY_CONTROL.s
1609 lines (1355 loc) · 31.1 KB
/
REENTRY_CONTROL.s
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
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright: Public domain.
# Filename: REENTRY_CONTROL.agc
# Purpose: Part of the source code for Colossus 2A, AKA Comanche 055.
# It is part of the source code for the Command Module's (CM)
# Apollo Guidance Computer (AGC), for Apollo 11.
# Assembler: yaYUL
# Contact: Ron Burkey <info@sandroid.org>.
# Website: www.ibiblio.org/apollo.
# Pages: 844-882
# Mod history: 2009-05-08 RSB Adapted from the Colossus249/ file of the
# same name, using Comanche055 page images.
# 2009-05-23 RSB In a couple of 2OCT statements, removed the
# space between the first and second octal words.
#
# This source code has been transcribed or otherwise adapted from digitized
# images of a hardcopy from the MIT Museum. The digitization was performed
# by Paul Fjeld, and arranged for by Deborah Douglas of the Museum. Many
# thanks to both. The images (with suitable reduction in storage size and
# consequent reduction in image quality as well) are available online at
# www.ibiblio.org/apollo. If for some reason you find that the images are
# illegible, contact me at info@sandroid.org about getting access to the
# (much) higher-quality images which Paul actually created.
#
# Notations on the hardcopy document read, in part:
#
# Assemble revision 055 of AGC program Comanche by NASA
# 2021113-051. 10:28 APR. 1, 1969
#
# This AGC program shall also be referred to as
# Colossus 2A
# Page 844
# ENTRY INITIALIZATION ROUTINE
# ----------------------------
BANK 25
SETLOC REENTRY
BANK
COUNT* $$/ENTRY
EBANK= RTINIT
EBENTRY = EBANK7
EBAOG EQUALS EBANK6
NTRYPRIO EQUALS PRIO20 # (SERVICER)
CM/FLAGS EQUALS STATE +6
STARTENT EXIT # MM = 63
# COME HERE FROM CM/POSE. RESTARTED IN CM/POSE.
CS ENTMASK # INITIALIZE ALL SWITCHES TO ZERO
# EXCEPT LATSW, ENTRYDSP, AND GONEPAST.
# GONEBY 112D BIT8 FLAG7, SELF-INITIALIZING.
INHINT
MASK CM/FLAGS
# ENTRYDSP = 92D B13
# GONEPAST=95D B10 RELVELSW=96D B9
# EGSW = 97D B8
# HIND=99D B6 INRLSW=100D B5
# LATSW=101D B4 .05GSW=102D B3
AD ENTRYSW
TS CM/FLAGS
RELINT
TC INTPRET
SLOAD
LODPAD
STORE LOD
SLOAD
LADPAD
STORE LAD
DMP # L/DCMINR = LAD COS(15)
COS15
STODL L/DCMINR
LATSLOPE
DMP SR1 # KLAT = LAD/24
LAD
# Page 845
STODL KLAT
Q7F
STODL Q7 # Q7 = Q7F
NEARONE # 1.0 -1BIT
STODL FACTOR
LAD
SIGN DCOMP
HEADSUP # MAY BE NOISE FOR DISPLAY P61
STCALL L/D # L/D = - LAD SGN(HEADSUP)
STARTEN1 # RETURN VIA GOTOADDR
VLOAD VXV
VN # (-7) M/CS
UNITR # .5 UNIT REF COORDS
UNIT DOT
RT # RT/2 TARGET VECTOR REF COORDS
STORE LATANG # LATANG = UNI.RT /4
DCOMP RTB
SIGNMPAC
STODL K2ROLL # K2ROLL = -SGN(LATANG)
LAD
DMP DAD
Q21
Q22
STORE Q2 # Q2 = -1152 + 500 LAD
SSP SSP
GOTOADDR # SET SELECTOR FOR INITIAL PASS
INITROLL
POSEXIT
SCALEPOP # SET CM/POSE TO CONTINUE AT SCALEPOP
RTB
SERVNOUT # OMIT INITIAL DISPLAY, SINCE 1ST GUESSBAD
# CALCULATE THE INITIAL TARGET VECTOR: RTINIT, ALSO RTEAST, RTNORM, AND RT. ALL ARE .5 UNIT AND IN
# REFERENCE COORDINATES.
STARTEN1 STQ VLOAD
GOTOADDR
LAT(SPL) # TARGET COORDINATES
CLEAR CLEAR # DO CALL USING PAD RADIUS. WILL UNIT IT.
ERADFLAG # ANYWAY.
LUNAFLAG
STODL LAT
3ZEROS
STODL LAT +4 # SET ALT=0.
PIPTIME # ESTABLISH RTINIT AT TIME OF PRESENT
# Page 846
# RN AND VN.
STCALL TIME/RTO # SAVE TIME BASE OF RTINIT.
LALOTORV # C(MPAC) =TIME (PIPTIME)
UNIT # ANSWER IN ALPHAV ALSO
STODL RTINIT # .5 UNIT TARGET REF COORDS
500SEC # NOMINAL ENTRY TIME FOR P63
# TIME/RTO = PIPTIME, STILL.
STCALL DTEAROT # INITIALIZE EARROT
EARROT1 # GET R5
DOT SL1
UNITR # RT/2 IN MPAC
ACOS
STCALL THETAH # RANGE ANGLE /360
GOTOADDR # RETURN TO CALLER
500SEC 2DEC 50000 B-28 # CS.
ENTMASK OCT 11774
ENTRYSW OCT 11010 # ENTRYDSP B13. GONEPAST B10. LATSW B4
# Page 847
SCALEPOP CALL
TARGETNG
EXIT
REFAZE10 TC PHASCHNG
OCT 10035 # SERVICER 5.3 RESTART AT REFAZE10
TC INTPRET
# JUMP TO PARTICULAR RE-ENTRY PHASE:
# SEQUENCE
GOTO
GOTOADDR
# GOTOADDR CONTAINS THE ADDRESS OF THE ROLL COMMAND EQUATIONS TO THE CURRENT PHASE OF
# RE-ENTRY. SEQUENCING IS AS FOLLOWS:
#
# INITROLL ADDRESS IS SET HERE INITIALLY. HOLDS INITIAL ROLL ATTITUDE UNTIL KAT IS EXCEEDED. THEN HOLDS NEW ROLL
# ATTITUDE UNTIL VRTHRESH IS EXCEEDED. THEN BRANCHES TO
#
# HUNTEST THIS SECTION CHECKS TO SEE IF THE PREDICTED RANGE AT NOMINAL L/D FROM PRESENT CONDITIONS IS LESS
# THAN THE DESIRED RANGE.
# IF NOT --- A ROLL COMMAND IS GENERATED BY THE CONSTANT DRAG CONTROLLER.
# IF SO --- CONTROL AND GOTOADDR ARE SET TO UPCONTRL.
# USUALLY NO ITERATION IS INVOLVED EXCEPT IF THE RANGE DESIRED IS TOO LONG ON THE FIRST PASS THROUGH
# HUNTEST.
#
# UPCONTRL CONTROLS ROLL DURING THE SUPER-CIRCULAR PHASE. UPCONTRL IS TERMINATED EITHER
# (A) WHEN THE DRAG (AS MEASURED BY THE PIPAS) FALLS BELOW Q7, OR
# (B) IF RDOT IS NEGATIVE AND REFERENCE VL EXCEEDS V.
# IN CASE (A), GOTOADDR IS SET TO KEP2 AND IN CASE (B), TO PREDICT3 SKIPPING THE KEPLER PHASE OF
# ENTRY.
#
# KEP2 GOTOADDR IS SET HERE DURING THE KEPLER PHASE TO MONITOR DRAG. THE SPACECRAFT IS INSTANTANEOUSLY
# TRIMMED IN PITCH AND YAW TO THE COMPUTED RELATIVE VELOCITY. THE LAST COMPUTED ROLL ANGLE IS MAINTAINED.
# WHEN THE MEASURED DRAG EXCEEDS Q7 +0.5, GOTOADDR IS SET TO
#
# PREDICT3 THIS CONTROLS THE FINAL SUB-ORBITAL PHASE. ROLL COMMANDS CEASE
# WHEN V IS LESS THAN VQUIT . AN EXIT IS MADE TO
#
# P67.1 THE LAST COMPUTED ROLL ANGLE IS MAINTAINED. RATE DAMPING IS DONE IN PITCH AND YAW. PRESENT LATITUDE
# AND LONGITUDE ARE COMPUTED FOR DISPLAY.
# ENTRY IS TERMINATED WHEN DISKY RESPONSE IS MADE TO THIS FINAL FLASHING DISPLAY.
# Page 848
# PROCESS AVERAGE G OUTPUT...SCALE IT AND GET INPUT DATA
# * START TARGETING ...
EBANK= RTINIT
# TARGETNG IS CALLED BY P61, FROM GROUP 4.
# TARGETNG IS CALLED BY ENTRY, FROM GROUP 5.
# ALL MM COME HERE.
TARGETNG BOFF VLOAD # ENTER WITH PROPER EB FROM CM/POSE(TEST)
RELVELSW # RELVELSW = 96D BIT9
GETVEL # WANT INERTIAL VEL. GO GET IT.
-VREL # NEW V IS RELATIVE, CONTINUE
VCOMP GOTO # (VREL) = (V) + KWE UNITR*UNITW
GETUNITV -1 # - VREL WAS LEFT BY CM/POSE
GETVEL VLOAD VXSC # INERTIAL V WANTED
VN # KVSCALE = (12800 / .3048) / 2VS
KVSCALE # KVSCALE = .81491944
STORE VEL # V/2 VS
GETUNITV UNIT STQ
60GENRET
STODL UNITV
34D
STORE VSQUARE # VSQ/4
DSU # LEQ = VSQUARE - 1
FOURTH # 4 G'S FULL SCALE
STODL LEQ # LEQ/4
36D
STOVL V # V/2 VS = VEL/2 VS
VEL
DOT SL1 # RDOT= V.UNITR
UNITR
STOVL RDOT # RDOT /2 VS
DELV # PIPA COUNTS IN PLATFORM COORDS.
ABVAL DMP
KASCALE
SL1 BZE
SETMIND
DSTORE STOVL D # ACCELERATION USED TO APPROX DRAG
VEL
VXV UNIT # UNI = UNIT(V*R)
# Page 849
UNITR
STORE UNI # .5 UNI REF COORDS.
BOFF DLOAD
RELVELSW
GETETA
3ZEROS
UPDATERT DSU DAD # PIPTIME-TIME/RTO =ELAPSED TIME SINCE
# RTINIT WAS ESTABLISHED.
TIME/RTO
PIPTIME
STCALL DTEAROT # GET PREDICTED TARGET VECTOR RT
EARROT2
DOT SETPD # SINCE (RT) UNIT VECT, THIS IS 1/4 MAX
UNI # LATANG = RT.UNI
0
STOVL LATANG # LATANG = MAC LATANG / 4
RT
CLEAR
GONEBY # SHOW HAVE NOT GONE PAST TARGET.
VXV DOT # IF RT*UNITR.UNI NEG, GONEBY=1
UNITR # GONEPAST IS CONDITIONAL SW SET IN
UNI # FINAL PHASE.
BPL SET
+2
GONEBY # SHOW HAVE GONE PAST TARGET.
VLOAD
RT
GETANGLE DOT DSU # THETA = ARCCOS(RT.UNITR)
UNITR
NEAR1/4 # TO IMPROVE ACCURACY, CALC RANGE BY
BPL DAD # TINYTHET IF HIGH ORDER PART OF
TINYTHET # ARCCOS ARGUMENT IS ZERO
NEAR1/4
SL1 ACOS
THETDONE STORE THETAH # THETAH/360
# HI WORD, LO BIT =1.32 NM=360 60/16384
BON DCOMP
GONEBY # =1 IF HAVE GONE PAST TARGET.
# (SIGN MAY BECOME ERRATIC VERY NEAR
# TARGET DUE TO LOSS OF PRECISION.)
+1
STODL RTGON67 # RANGE ERROR: NEG IF WILL FALL SHORT.
D
DSU BMN
# Page 850
.05G
NO.05G
SET VLOAD
.05GSW
DELVREF
PUSH DOT
UXA/2
SL1 DSQ
PDVL VSQ # EXCHANGE WITH PDL.
DSU DDV
0
BOV SQRT
NOLDCALC # OVFL LAST CLEARED IN EARROT2 ABOVE.
STORE L/DCALC
NOLDCALC GOTO
60GENRET
NO.05G CLEAR GOTO # THIS WAY FOR DAP. (MAY INTERRUPT)
.05GSW # .05GSW = 102D B3
NOLDCALC # KEEP SINGLE EXIT FOR TARGETING
# Page 851
# SUBROUTINES CALLED BY SCALEPOP (TARGETING):
BANK 26
SETLOC REENTRY1
BANK
COUNT* $$/ENTRY
GETETA DLOAD DDV # D = D +D(-RDOT/HS -2D/V) DT/2
# DT/2 = 2/2 =1
RDOT
-HSCALED
PDDL DMP
D
-KSCALE
DDV DAD
V
# -RDOT/HS FROM PDL.
DMP DAD
D
D
STORE D
BON DLOAD # EGSW INDICATES FINAL PHASE
EGSW
SUBETA
THETAH
DMP GOTO
KTETA # = 1000x2PI/(2)E14 163.84
UPDATERT
SUBETA DLOAD DSU # SWITCH FROM INERTIAL TO RELATIVE VEL.
V
VMIN
BPL SET
SUBETA2
RELVELSW
SUBETA2 DLOAD DMP
THETAH
KT1 # KT1 = KT
DDV GOTO
V # KT = RE(2 PI)/2 VS 16384 163.84/ 2 VSAT
UPDATERT
SETMIND DLOAD GOTO
1BITDP
DSTORE
# Page 852
TINYTHET DSU ABS # ENTER WITH X-.249
1BITDP +1 # GET 1/4 - MPAC
SL SQRT # SCALE UP BEFORE SQRT
13D # HAS FACTOR FOR UP SCALING
DMP GOTO
KACOS
THETDONE
# Page 853
# * START INITIAL ROLL ...
BANK 25
SETLOC REENTRY
BANK
COUNT* $$/ENTRY
# MM = 63, 64, ...
INITROLL BON BOFF # IF D- .05G NEG, GO TO LIMITL/D
INRLSW
INITRL1
.05GSW
LIMITL/D
# MM = 64, NOW
# 3
# KA = KA1 LEG + KA2
DLOAD DSQ
LEQ
DMP DDV
LEQ
1/KA1 # = 25 /(64 1.8)
DAD RTB
KA2 # = .2
P64 # ROLLC VI RDOT
# XXX.XX DEG XXXXX. FPS XXXXX. FPS
STORE KAT
DSU BMN
KALIM
+4
DLOAD
KALIM
STORE KAT
DLOAD DSU # IF V-VFINAL1 NEG, GO TO FINAL PHASE.
V
VFINAL1
CLEAR BPL # (CAN'T CLEAR INRLSW AFTER HERE: RESTARTS)
GONEPAST # GONEPAST WAS INITIALLY SET=1 TO FORCE
# ROLLC TO REMAIN AS DEFINED BY HEADSUP
# UNTIL START OF P64. (UNTIL D > .05G)
D0EQ
SSP GOTO
GOTOADDR
KEP2 # AND IDLE UNTIL D > 0.2 G. (NO P66 HERE)
INROLOUT # GO TO LIMITL/D AFTER SETTING INRLSW.
D0EQ DLOAD DMP # D0 = KA3 LEQ + KA4
# Page 854
LEQ
KA3
DAD
KA4
STORE D0 # D0/805
BDDV BOV
C001 # (-4/25 G) B-8
+1 # CLEAR OVFIND, IF ON.
STODL C/D0 # (-4/D0) B-8
LAD # IF V-VFINAL +K(RDOT/V)CUBED POS,L/D=-LAD
STODL L/D
RDOT
DDV PUSH
V
DSQ DMP
DDV DSU
1/K44
VFINAL
# 3
# V-VFINAL +(RDOT/V) / K44 OVFL $
DAD BOV
V
INROLOUT # GO TO LIMITL/D AFTER SETTING INRLSW.
BMN DLOAD
INROLOUT # GO TO LIMITL/D AFTER SETTING INRLSW.
LAD
DCOMP
STORE L/D
# SET INRLSW AT END FOR RESTART PROTECTION
INROLOUT BOFSET # END OF PRE .05G PATH OF INITROLL.
INRLSW # SWITCH IS ZERO INITIALLY.
LIMITL/D # (GO TO)
KATEST DLOAD DSU # IF KAT - D POS, GO TO CONSTD
KAT
D # IF POS, OUT WITH COMMAND VIA LIMITL/D
BPL GOTO
LIMITL/D
CONSTD
INITRL1 DLOAD DAD # IF RDOT + VRCONT POS, GO TO HUNTEST
RDOT
VRCONT
BMN CALL # IF POSITIVE, FALL INTO HUNTEST.
KATEST
FOREHUNT # INITIALIZE HUNTEST.
# Page 855
# * START HUNT TEST ...
# MM = 64
SSP # INITIALIZE HUNTEST ON FIRST PASS
GOTOADDR
HUNTEST # MUST GO AFTER FOREHUNT FOR RESTARTS.
HUNTEST DLOAD
D
STODL A1 # A1/805 = A1/25G
LAD
STODL TEM1B
RDOT
BMN DLOAD # IF RDOT NEG,TEM1B=LAD, OTHERWISE = LEWD
A0CALC
LEWD
STODL TEM1B
RDOT
A0CALC DDV DAD # V1 = V + RDOT/TEM1B
TEM1B
V
STODL V1 # V1/2 VS
RDOT
DSQ DDV # A0=(V1/V)SQ(D+RDOT SQ/(TEM1B 2 C1 HS)
TEM1B
DDV DAD
2C1HS
D
DMP DMP
V1
V1
DDV
VSQUARE
STODL A0 # A0/805 = A0/25G
RDOT
BPL DLOAD
V1LEAD
A0
STORE A1 # A1/25G
V1LEAD DLOAD BPL # IF L/D NEG, V1=V1 - 1000
L/D
HUNTEST1
DLOAD DSU
V1
# Page 856
VQUIT
STORE V1
HUNTEST1 DLOAD DMP # ALP = 2 C1 HS A0/LEWD V1 V1
A0
2C1HS
DDV SETPD
V1
0
DDV DDV
V1
LEWD
STORE ALP
BDSU BDDV # FACT1 = V1 / (1 - ALP)
BARELY1
V1
STODL FACT1 # FACT1 / 2VS
ALP
DSU DMP # FACT2 = ALP(ALP - 1) / A0
BARELY1
ALP
DDV
A0
STORE FACT2 # FACT2 (25G)
DMP DAD
Q7 # Q7 / 805 = Q7 / 25G
ALP # VL=FACT1 (1-SQRT(Q7 FACT2 +ALP) )
SQRT BDSU
BARELY1
DMP
FACT1
STORE VL # VL / 2 VS
BDSU DMP # GAMMAL1 = LEWD (V1-VL)/VL
V1
LEWD
DDV
VL
STODL GAMMAL1 # GAMMAL1 USED IN UPCONTROL.
# GAMMAL1 = PDL 22D.
VL
DSU BMN # IF VL-VLMIN NEG, GO TO PREFINAL
VLMIN
PREFINAL
DLOAD DSQ
# Page 857
VL
STODL VBARS # VBARS / 4 VS VS
HALVE # IF VSAT-VL NEG, GO TO CONSTD
DSU BMN
VL
BECONSTD # SET MODE=HUNTEST, CONTINUE IN CONSTD
STODL DVL # DVL / 2VS
HALVE
STORE VS1 # VS1 = VSAT
DSU BMN # IF V1 GREATER THAN VSAT, GO ON
V1
GETDHOOK
BDSU
DVL
STODL DVL # DVL = DVL - (VSAT-V1) = V1 - VL
V1
STORE VS1 # VS1 = V1, IN THIS CASE
GETDHOOK DLOAD CALL # DHOOK=((1-VS1/FACT1) SQ -ALP)/FACT2
VS1 # VS1 / 2 VS
DHOOKYQ7 # GO CALC DHOOK
STORE DHOOK # DHOOK / 25G
SR DDV
6 # CHOOK
Q7
DSU
CHOOK # = .25/16 = (-6)
STORE AHOOKDV
DAD DMP # GAMMAL= GAMMAL1-CH1 DVL SQ(1+AHOOK DVL)
1/16TH
CH1
DMP DMP
DVL
DVL
DDV DDV
DHOOK
VBARS
BDSU BMN
GAMMAL1
NEGAMA
HUNTEST3 STORE GAMMAL
DSU # GAMMAL1=GAMMAL1 +Q19 (GAMMAL-GAMMAL1)
GAMMAL1
DMP DAD
# Page 858
Q19
GAMMAL1
STODL GAMMAL1
GAMMAL
# Page 859
# *START RANGE PREDICTION ...
# C(MPAC) = GAMMAL.
RANGER DSQ SR2 # COSG = 1-GAMMAL SQ/2, TRUNCATED SERIES
BDSU
HALVE
STODL COSG/2
VBARS # E=SQRT(1+VBARS........
DSU DMP
HALVE
VBARS
DMP DMP
COSG/2
COSG/2
SL2 DAD
C1/16 # C1/16 = 1/16
SQRT PDDL # E/4 INTO PDL
VBARS
DMP DMP # ASKEP/2 = ARCSIN(VBARS COSG SING/E)
COSG/2
GAMMAL
DDV ASIN
SL1 PUSH # ASKEP TO PDL 0.
STODL ASKEP # BALLISTIC RANGE ASKEP/2PI
# FOR TM, STORE RANGE COMPONENTS OVERLAPPING (SP)
VL
DMP DAD # ASP1 = Q2 + Q3 VL
Q3
Q2
STORE ASP1 # FINAL PHASE RANGE ASP1/2 PI
PDDL DSQ # ASP1 TO PDL 2.
V1
# 2
# ASPUP= -C12 LOG(V1 Q7/VBARS A0)/GAMMAL1
DMP DDV
Q7
VBARS
DDV CALL
A0
LOG # RETURN WITH -LOG IN MPAC
DMP DDV
C12
GAMMAL1
STORE ASPUP # UP PHASE RANGE ASPUP / 2 PI
# Page 860
PDDL DMP # ASPUP TO PDL 4.
KC3 # KC3 = -4 VS VS / 2 PI 805 RE
# ASPDWN = KC3 RDOT V / A0
RDOT
DMP DDV
V
A0
DDV PUSH # ASPDWN TO PDL 6.
LAD
STODL ASPDWN # RANGE TO PULL OUT ASPDWN /2 PI
Q6
DSU DMP # ASP3 = Q5(Q6-GAMMAL)
GAMMAL
Q5
STOVL ASP3 # GAMMA CORRECTION ASP3/2PI
ASKEP # GET HI-WD AND
STODL ASPS(TM) # SAVE HI-WORD OF ASP'S FOR TM.
ASP3
DAD DAD
# ASPDWN FROM PDL 6.
# ASPUP FROM PDL 4.
DAD DAD
# ASP1 FROM PDL 2.
# ASKEP FROM PDL 0.
DSU BOVB # CLEAR OVFIND.
THETAH
TCDANZIG
STORE DIFF # DIFF = (ASP-THETAH) / 2 PI
# ASP=ASKEP+ASP1+ASPUP+ASP3+ASPDWN = TOTAL RANGE
ABS DSU # IF ABS(THETAH-ASP) -25NM NEG, GO TO UPSY
25NM
BMN BON
GOTOUPSY
HIND
GETLEWD
DLOAD BPL
DIFF
DCONSTD # EVENTUALLY SETS MODE = HUNTEST.
GETLEWD DLOAD DMP
# DLEWD = DLEWD (DIFF/(DIFFOLD-DIFF))
DLEWD
DIFF
PDDL DSU
DIFFOLD
DIFF
# Page 861
BDDV
LWDSTORE STADR
STORE DLEWD
DAD BMN # IF LEWD+DLEWD NEG, DLEWD=-LEWD/2
LEWD
LEWDPTR
BOV
LEWDOVFL
STORE LEWD
SIDETRAK EXIT
CA EBENTRY
TS EBANK
CA PRIO16 # DROP GRP 5 RESTART PRIO TO 1 LESS THAN
TS PHSPRDT5 # GRP 4.
TC PHASCHNG
OCT 00474 # RESTART GRP 4 AT PRE-HUN.
# FORCE RESTART TO PICK UP IN GRP 4:
# USE PRIO 17 FOR GRP 4 (< SERVICER PRIO)
CA PRIO16 # CONTINUE GRP 5 AT LOWER PRIO THAN EITHER
# GRP 4 OR SERVICER.
TC PRIOCHNG
CAF ADENDEXT # SIDETRACK NEXT PASS UNTIL THIS ONE DONE.
TS GOTOADDR # ONLY AFTER RESTART IS LEFT AFTER DETOUR.
TC INTPRET
DLOAD SET
DIFF
HIND
STODL DIFFOLD # DIFFOLD / 2 PI
Q7F
STCALL Q7 # Q7 / 805 FPSS
HUNTEST # (GO TO)
LEWDOVFL DLOAD
NEARONE
STCALL LEWD
DCONSTD # (GO TO) ALSO WILL SET MODE = HUNTEST
LEWDPTR DLOAD SR1
LEWD
DCOMP GOTO
LWDSTORE
# Page 862
NEGAMA DMP DMP # ENTER WITH GAMMAL IN MPAC
VL
1/3RD
PDDL DMP # PUSH GAMMAL VL/3
LEWD
1/3RD
PDDL DAD # PUSH LEWD/3
AHOOKDV
1/24TH
DMP DMP # DEL VL = (GAMMAL VL/3)/(LEWD/3-DVL
DVL # (2/3 + AHOOKDV)(CH1 GS/DHOOK VL))
CH1
DDV DDV
DHOOK
VL
BDSU BDDV
# LEWD/3
# GAMMAL VL /3
DAD
VL
STCALL VL # VL/2 VS
DHOOKYQ7 # GO CALC Q7
# Q7=((1-VL/FACT1)SQ - ALP)/FACT2
STODL Q7 # Q7 / 25G
VL
DSQ
STODL VBARS # VBARS / 4 VS VS
3ZEROS
GOTO # SET GAMMAL = 0
HUNTEST3
DHOOKYQ7 SR1 DDV # SUBROUTINE TO CALC DHOOK OR Q7
FACT1
BDSU SL1
HALVE
DSQ DSU
ALP
DDV RVQ
FACT2
# Page 863
# COME TO PRE-HUNT WHEN RESTART OCCURS AFTER
# HUNTEST IS SIDE-TRACKED AT SIDETRAK.
# PICK UP IN GROUP 4.
PRE-HUNT TC INTPRET
CLEAR CALL
HIND # HIND 99D BIT 6 FLAG 6
FOREHUNT # RE-INITIALIZE HUNTEST AFTER RE-START.
GOTO
HUNTEST
FOREHUNT DLOAD # INITIALIZE HUNTEST.
3ZEROS
STODL DIFFOLD
DLEWD0
STODL DLEWD
LEWD1
STORE LEWD
RVQ
ADENDEXT CADR ENDEXIT
# Page 864
# * START UP CONTROL ...
# MM = 65
GOTOUPSY RTB # END OF HUNTEST
P65 # HUNTEST USE OF GRP4 IS DISABLED BY P65
# USE FOR DISPLAY.
# SET MODE = UPCONTRL.
# RETURN FROM P65 DIRECTLY TO UPDONTRL
# VIA THE GOTOADDR AT REFAZE10.
UPCONTRL DLOAD DSU # IF D-140 POS, NOSWITCH =1
D # (SUPPRESS LATERAL SWITCH)
C21
BMN SET
+2
NOSWITCH
DLOAD DSU # IF V-V1 POS, GO TO DOWN CONTROL.
V
V1
BPL DLOAD
DOWNCNTL
D
DSU BMN # IF D- Q7 NEG, GO TO KEP
Q7
KEP
DLOAD BPL # IF RDOT NEG, DO VLTEST
RDOT
CONT1
VLTEST DLOAD DSU # IF V-VL-C18 NEG,EGSW=1,MODE=PREDICT3
V
VL
DSU BMN
C18
PREFINAL
CONT1 DLOAD # IF D-A0 POS, L/D = LAD, GO TO LIMITL/D
D
DSU BMN
A0
CONT3
DLOAD GOTO
LAD
STOREL/D
CONT3 DLOAD DMP # VREF=FACT1(1-SQRT(FACT2 D + ALP))
D
FACT2
# Page 865
DAD SQRT
ALP
BDSU DMP
BARELY1
FACT1
STORE VREF # VREF / 2VS
BDSU DMP # RDOTREF = LEWD(V1-VREF)
V1
LEWD
STODL RDOTREF # RDOTREF / 2VS
VS1
DSU BMN # IF VSAT-VREF NEG, GO TO CONTINU2
VREF
CONTINU2
PUSH PUSH # VS1-VREF TO PDL TWICE
DMP DDV # RDHOOK=CHI1(1+DV AHOOKDV/DVL) DV DV
AHOOKDV # /DHOOK VREF
DVL # WHERE DV = (VS1-VREF)
DAD DMP
1/16TH
CH1
DMP DMP
# VS1-VREF FROM PDL TWICE.
DDV
DHOOK
DDV BDSU
VREF
RDOTREF # C(RDOTREF)= LEWD (V1-VREF)
STORE RDOTREF # RDOTREF = RDOTREF - RDHOOK
CONTINU2 DLOAD DSU
D
Q7MIN
BOVB BMN
TCDANZIG # CLEAR OVFL IND, IF ON.
UPCNTRL3
DLOAD DSU
A1
Q7
PDDL DSU
D
Q7
DDV STADR
STORE FACTOR # FACTOR / 25G
# Page 866
# SKIPPER
# DELTA L/D=-((RDOT-RDOTREF)F1 KB1+V-VREF)F1 KB2
# WHERE F1 = FACTOR
UPCNTRL3 DLOAD
RDOT
DSU DMP # L/D = LEWD
RDOTREF # -((RDOT-RDOTREF)F1/KB1+V-VREF)F1/KB2
FACTOR
DDV DAD
1/KB1
V
DSU DMP
VREF
FACTOR
DDV PUSH
-1/KB2 # DELTA L/D INTO PDL
BOV ABS # NONLINEAR CIRCUIT FOR REDUCING HIGH GAIN
GOMAXL/D
DSU BMN
PT1/16
NEXT1
DMP DAD
POINT1
PT1/16
SIGN PUSH # ATTACH SIGN OF PUSH TO MPAC THEN PUSH
NEXT1 DLOAD SL4
# DELTA L/D FROM PDL.
DAD
LEWD
NEGTESTS BOV PUSH # L/D TO PDL FOR USE IN NEGTESTS.
GOMAXL/D
STODL L/D
# IF D-C20 POS, LATSW =0
# AND IF L/D NEG, L/D = 0.
D