forked from chrislgarry/Apollo-11
-
Notifications
You must be signed in to change notification settings - Fork 3
/
LUNAR_LANDING_GUIDANCE_EQUATIONS.s
1474 lines (1277 loc) · 31.2 KB
/
LUNAR_LANDING_GUIDANCE_EQUATIONS.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: LUNAR_LANDING_GUIDANCE_EQUATIONS.agc
# Purpose: Part of the source code for Luminary 1A build 099.
# It is part of the source code for the Lunar Module's (LM)
# Apollo Guidance Computer (AGC), for Apollo 11.
# Assembler: yaYUL
# Contact: HARTMUTH GUTSCHE <[email protected]>.
# Website: www.ibiblio.org/apollo.
# Pages: 798-828
# Mod history: 2009-05-23 HG Transcribed from page images.
# 2009-06-05 RSB Fixed a goofy thing that was apparently
# legal in GAP but not in yaYUL. Eliminated
# a couple of lines of code that shouldn't
# have survived from Luminary 131 to here.
# 2009-06-07 RSB Fixed a typo.
#
# 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 [email protected]
# about getting access to the (much) higher-quality images which Paul
# actually created.
#
# Notations on the hardcopy document read, in part:
#
# Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
# 16:27 JULY 14, 1969
# Page 798
EBANK= E2DPS
COUNT* $$/F2DPS
# ********************************************************
# LUNAR LANDING FLIGHT SEQUENCE TABLES
# ********************************************************
# FLIGHT SEQUENCE TABLES ARE ARRANGED BY FUNCTION. THEY ARE REFERENCED USING AS AN INDEX THE REGISTER WCHPHASE:
# WCHPHASE = -1 ---> IGNALG
# WCHPHASE = 0 ---> BRAKQUAD
# WCHPHASE = 1 ---> APPRQUAD
# WCHPHASE = 2 ---> VERTICAL
#*********************************************************
# ROUTINES FOR STARTING NEW GUIDANCE PHASES:
TCF TTFINCR # IGNALG
NEWPHASE TCF TTFINCR # BRAKQUAD
TCF STARTP64 # APPRQUAD
TCF P65START # VERTICAL
# PRE-GUIDANCE COMPUTATIONS:
TCF CALCRGVG # IGNALG
PREGUIDE TCF RGVGCALC # BRAKQUAD
TCF REDESIG # APPRQUAD
TCF RGVGCALC # VERTICAL
# GUIDANCE EQUATIONS:
TCF TTF/8CL # IGNALG
WHATGUID TCF TTF/8CL # BRAKQUAD
TCF TTF/8CL # APPRQUAD
TCF VERTGUID # VERTICAL
# POST GUIDANCE EQUATION COMPUTATIONS:
TCF CGCALC # IGNALG
AFTRGUID TCF CGCALC # BRAKQUAD
TCF CGCALC # APPRQUAD
TCF STEER? # VERTICAL
# Page 799
# WINDOW VECTOR COMPUTATIONS:
TCF EXGSUB # IGNALG
WHATEXIT TCF EXBRAK # BRAKQUAD
TCF EXNORM # APPRQUAD
# DISPLAY ROUTINES:
WHATDISP TCF P63DISPS # BRAKQUAD
TCF P64DISPS # APPRQUAD
TCF VERTDISP # VERTICAL
# ALARM ROUTINE FOR TTF COMPUTATION:
TCF 1406P00 # IGNALG
WHATALM TCF 1406ALM # BRAKQUAD
TCF 1406ALM # APPRQUAD
# INDICES FOR REFERENCING TARGET PARAMETERS
OCT 0 # IGNALG
TARGTDEX OCT 0 # BRAKQUAD
OCT 34 # APPRQUAD
#************************************************************************
# ENTRY POINTS: ?GUIDSUB FOR THE IGNITION ALGORITHM, LUNLAND FOR SERVOUT
#************************************************************************
# IGNITION ALGORITHM ENTRY: DELIVERS N PASSES OF QUADRATIC GUIDANCE
?GUIDSUB EXIT
CAF TWO # N = 3
TS NGUIDSUB
TCF GUILDRET +2
GUIDSUB TS NGUIDSUB # ON SUCCEEDING PASSES SKIP TTFINCR
TCF CALCRGVG
# NORMAL ENTRY: CONTROL COMES HERE FROM SERVOUT
LUNLAND TC PHASCHNG
OCT 00035 # GROUP 5: RETAIN ONLY PIPA TASK
TC PHASCHNG
OCT 05023 # GROUP 3: PROTECT GUIDANCE WITH PRIO 21
OCT 21000 # JUST HIGHER THAN SERVICER'S PRIORITY
# Page 800
#*******************************************************************
# GUILDENSTERN: AUTO-MODES MONITOR (R13)
#*******************************************************************
COUNT* $$/R13
# HERE IS THE PHILOSOPHY OF GUILDENSTERN: ON EVERY APPEARANCE OR DISAPPEARANCE OF THE MANUAL THROTTLE
# DISCRETE TO SELECT P67 OR P66 RESPECTIVELY: ON EVERY APPEARANCE OF THE ATTITUDE-HOLD DISCRETE TO SELECT P66
# UNLESS THE CURRENT PROGRAM IS P67 IN WHICH CASE THERE IS NO CHANGE
GUILDEN EXTEND # IS UN-AUTO-THROTTLE DISCRETE PRESENT?
# STERN # RSB 2009: Not originally a comment.
READ CHAN30
MASK BIT5
CCS A
TCF STARTP67 # YES
P67NOW? TC CHECKMM # NO: ARE WE IN P67 NOW?
DEC 67
TCF STABL? # NO
STARTP66 TC FASTCHNG # YES
TC NEWMODEX
DEC66 DEC 66
EXTEND
DCA HDOTDISP # SET DESIRED ALTITUDE RATE = CURRENT
DXCH VDGVERT # ALTITUDE RATE.
STRTP66A TC INTPRET
SLOAD PUSH
PBIASZ
SLOAD PUSH
PBIASY
SLOAD VDEF
PBIASX
VXSC SET
BIASFACT
RODFLAG
STOVL VBIAS
TEMX
VCOMP
STOVL OLDPIPAX
ZEROVECS
STODL DELVROD
RODSCALE
STODL RODSCAL1
PIPTIME
STORE LASTTPIP
EXIT
CAF ZERO
TS FCOLD
TS FWEIGHT
TS FWEIGHT +1
VRTSTART TS WCHVERT
# Page 801
CAF TWO # WCHPHASE = 2 ---> VERTICAL: P65,P66,P67
TS WCHPHOLD
TS WCHPHASE
TC BANKCALL # TEMPORARY, I HOPE HOPE HOPE
CADR STOPRATE # TEMPORARY, I HOPE HOPE HOPE
TC DOWNFLAG # PERMIT X-AXIS OVERRIDE
ADRES XOVINFLG
TC DOWNFLAG
ADRES REDFLAG
TCF VERTGUID
STARTP67 TC NEWMODEX # NO HARM IN "STARTING" P67 OVER AND OVER
DEC 67 # SO NO NEED FOR A FASTCHNG AND NO NEED
CAF ZERO # TO SEE IF ALREADY IN P67.
TS RODCOUNT
CAF TEN
TCF VRTSTART
STABL? CAF BIT13 # IS UN-ATTITUDE-HOLD DISCRETE PRESENT?
EXTEND
RAND CHAN31
CCS A
TCF GUILDRET # YES ALL'S WELL
P66NOW? CS MODREG
AD DEC66
EXTEND
BZF RESTART?
CA RODCOUNT # NO. HAS THE ROD SWITCH BEEN "CLICKED"?
EXTEND
BZF GUILDRET # NO. CONTINUE WITH AUTOMATIC LANDING
TCF STARTP66 # YES. SWITCH INTO THE ROD MODE.
RESTART? CA FLAGWRD1 # HAS THERE BEEN A RESTART?
MASK RODFLBIT
EXTEND
BZF STRTP66A # YES. REINITIALIZE BUT LEAVE VDGVERT AS
# IS.
TCF VERTGUID # NO: CONTINUE WITH R.O.D.
# *******************************************************************************
# INITIALIZATION FOR THIS PASS
# *******************************************************************************
COUNT* $$/F2DPS
GUILDRET CAF ZERO
TS RODCOUNT
# Page 802
+2 EXTEND
DCA TPIP
DXCH TPIPOLD
TC FASTCHNG
EXTEND
DCA PIPTIME1
DXCH TPIP
EXTEND
DCA TTF/8
DXCH TTF/8TMP
CCS FLPASS0
TCF TTFINCR
BRSPOT1 INDEX WCHPHASE
TCF NEWPHASE
# ******************************************************************
# ROUTINES TO START NEW PHASES
# ******************************************************************
P65START TC NEWMODEX
DEC 65
CS TWO
TS WCHVERT
TC DOWNFLAG # PERMIT X-AXIS OVERRIDE
ADRES XOVINFLG
TCF TTFINCR
STARTP64 TC NEWMODEX
DEC 64
CA DELTTFAP # AUGMENT TTF/8
ADS TTF/8TMP
CA BIT12 # ENABLE RUPT10
EXTEND
WOR CHAN13
TC DOWNFLAG # INITIALIZE REDESIGNATION FLAG
ADRES REDFLAG
# (CONTINUE TO TTFINCR)
# *********************************************************************************
# INCREMENT TTF/8, UPDATE LAND FOR LUNAR ROTATION, DO OTHER USEFUL THINGS
# *********************************************************************************
#
# TTFINCR COMPUTATIONS ARE AS FOLLOWS --
# Page 803
# TTF/8 UPDATED FOR TIME SINCE LAST PASS:
# TTF/8 = TTF/8 + (TPIP - TPIPOLD)/8
# LANDING SITE VECTOR UPDATED FOR LUNAR ROTATION:
# ____ ____ ____ __
# LAND = /LAND/ UNIT(LAND - LAND(TPIP - TPIPOLD) * WM)
# SLANT RANGE TO LANDING SITE, FOR DISPLAY:
# ____ _
# RANGEDSP = ABVAL(LAND - R)
TTFINCR TC INTPRET
DLOAD DSU
TPIP
TPIPOLD
SLR PUSH # SHIFT SCALES DELTA TIME TO 2(17) CSECS
11D
VXSC VXV
LAND
WM
BVSU RTB
LAND
NORMUNIT
VXSC VSL1
/LAND/
STODL LANDTEMP
EXIT
DXCH MPAC
DAS TTF/8TMP # NOW HAVE INCREMENTED TTF/8 IN TTF/8TMP
TC FASTCHNG
EXTEND
DCA TTF/8TMP
DXCH TTF/8
EXTEND
DCA LANDTEMP
DXCH LAND
EXTEND
DCA LANDTEMP +2
DXCH LAND +2
EXTEND
DCA LANDTEMP +4
DXCH LAND +4
# Page 804
TC TDISPSET
TC FASTCHNG # SINCE REDESIG MAY CHANGE LANDTEMP
BRSPOT2 INDEX WCHPHASE
TCF PREGUIDE
# *********************************************************************
# LANDING SITE PERTURBATION EQUATIONS
# *********************************************************************
REDESIG CA FLAGWRD6 # IS REDFLAG SET?
MASK REDFLBIT
EXTEND
BZF RGVGCALC # NO: SKIP REDESIGNATION LOGIC
CA TREDES # YES: HAS TREDES REACHED ZERO?
EXTEND
BZF RGVGCALC # YES: SKIP REDESIGNATION LOGIC
INHINT
CA ELINCR1
TS ELINCR
CA AZINCR1
TS AZINCR
TC FASTCHNG
CA ZERO
TS ELINCR1
TS AZINCR1
TS ELINCR +1
TS AZINCR +1
CA FIXLOC # SET PD TO 0
TS PUSHLOC
TC INTPRET
VLOAD VSU
LAND
R # ____ _
RTB PUSH # PUSH DOWN UNIT (LAND - R)
NORMUNIT
VXV VSL1
YNBPIP # ___ ____ _
VXSC PDDL # PUSH DOWN - ELINCR(YNB * UNIT(LAND - R))
ELINCR
AZINCR
VXSC VSU
YNBPIP
VAD PUSH # RESULTING VECTOR IS 1/2 REAL SIZE
# Page 805
DLOAD DSU # MAKE SURE REDESIGNATION IS NOT
0 # TOO CLOSE TO THE HORIZON.
DEPRCRIT
BMN DLOAD
REDES1
DEPRCRIT
STORE 0
REDES1 DLOAD DSU
LAND
R
DDV VXSC
0
VAD UNIT
R
VXSC VSL1
/LAND/
STORE LANDTEMP
EXIT # LOOKANGL WILL BE COMPUTED AT RGVGCALC
TC FASTCHNG
EXTEND
DCA LANDTEMP
DXCH LAND
EXTEND
DCA LANDTEMP +2
DXCH LAND +2
EXTEND
DCA LANDTEMP +4
DXCH LAND +4
TCF RGVGCALC
# *********************************************************************
# COMPUTE STATE IN GUIDANCE COORDINATES
# *********************************************************************
#
# RGVGCALC COMPUTATIONS ARE AS FOLLOWS:--
# VELOCITY RELATIVE TO THE SURFACE
# _______ _ _ __
# ANGTERM = V + R * WM
# STATE IN GUIDANCE COORDINTES:
# ___ * _ ____
# RGU = CG (R - LAND)
# ___ * _ __ _
# VGU = CG (V - WM * R)
# Page 806 actually starts one line earlier but that would separate the markers from their variables
#
# HORIZONTAL VELOCITY FOR DISPLAY
#
# VHORIZ = 8 ABVAL (0, VG , VG )
# 2 1
# DEPRESSION ANGLE FOR DISPLAY:
# _ ____ ______
# LOOKANGL = ARCSIN(UNIT(R - LAND).XMBPIP)
CALCRGVG TC INTPRET # IN IGNALG, COMPUTE V FROM INTEGRATION
VLOAD MXV # OUTPUT AND TRIM CORRECTION TERM
VATT1 # COMPUTED LAST PASS AND LEFT IN UNFC/2
REFSMMAT
VSR1 VAD
UNFC/2
STORE V
EXIT
RGVGCALC TC INTPRET # ENTER HERE TO RECOMPUTE RG AND VG
VLOAD VXV
R
WM
VAD VSR2 # RESCALE TO UNITS OF 2(9) M/CS
V
STORE ANGTERM
MXV
CG # NO SHIFT SINCE ANGTERM IS DOUBLE SIZED
STORE VGU
PDDL VDEF # FORM (0,VG ,VG ) IN UNITS OF 2(10) M/CS
ZEROVECS # 2 1
ABVAL SL3
STOVL VHORIZ # VHORIZ FOR DISPLAY DURING P65.
R # _ ____
VSU PUSH # PUSH DOWN R - LAND
LAND
MXV VSL1
CG
STORE RGU
ABVAL
STOVL RANGEDSP
RTB DOT # NOW IN MPAC IS SINE(LOOKANGL)/4
NORMUNIT
XNBPIP
EXIT
CA FIXLOC # RESET PUSH DOWN POINTER
TS PUSHLOC
# Page 807
CA MPAC # COMPUTE LOOKANGLE ITSELF
DOUBLE
TC BANKCALL
CADR SPARCSIN -1
AD 1/2DEG
EXTEND
MP 180DEGS
TS LOOKANGL # LOOKANGL FOR DISPLAY DURING P64
BRSPOT3 INDEX WCHPHASE
TCF WHATGUID
# **************************************************************************
# TTF/8 COMPUTATION
# **************************************************************************
TTF/8CL TC INTPRETX
DLOAD*
JDG2TTF,1
STODL* TABLTTF +6 # A(3) = 8 JDG TO TABLTTF
ADG2TTF,1 # 2
STODL TABLTTF +4 # A(2) = 6 ADG TO TABLTTF
VGU +4 # 2
DMP DAD*
3/4DP
VDG2TTF,1
STODL* TABLTTF +2 # A(1) = (6 VGU + 18 VDG )/8 TO TABLTTF
RDG +4,1 # 2 2
DSU DMP
RGU +4
3/8DP
STORE TABLTTF # A(0) = -24 (RGU - RDG )/64 TO TABLTTF
EXIT # 2 2
CA BIT8
TS TABLTTF +10 # FRACTIONAL PRECISION FOR TTF TO TABLE
EXTEND
DCA TTF/8
DXCH MPAC # LOADS TTF/8 (INITIAL GUESS) INTO MPAC
CAF TWO # DEGREE - ONE
TS L
CAF TABLTTFL
TC ROOTPSRS # YIELDS TTF/8 IN MPAC
INDEX WCHPHASE
TCF WHATALM
EXTEND # GOOD RETURN
DCA MPAC # FETCH TTF/8 KEEPING IT IN MPAC
DXCH TTF/8 # CORRECTED TTF/8
# Page 808
TC TDISPSET
# (CONTINUE TO QUADGUID)
# *********************************************************************************
# MAIN GUIDANCE EQUATION
# *********************************************************************************
#
# AS PUBLISHED --
# ___ __ ___ __
# ___ ___ 6(VDG + VG) 12(RDG - RG)
# ACG = ADG + ----------- + ------------
# TTF (TTF)(TTF)
# AS HERE PROGRAMMED --
# ___ __
# 3 (1/4(RDG - RG) ___ __)
# - (------------- + VDG + VG)
# ___ 4 ( TTF/8 ) ___
# ACG = ---------------------------- + ADG
# TTF/8
QUADGUID CS TTF/8
AD LEADTIME # LEADTIME IS A NEGATIVE NUMBER
AD POSMAX # SAFEGUARD THE COMPUTATIONS THAT FOLLOW
TS L # BY FORCING -TTF*LEADTIME > OR = ZERO
CS L
AD L
ZL
EXTEND
DV TTF/8
TS BUF # - RATIO OF LAG-DIMINISHED TTF TO TTF
EXTEND
SQUARE
TS BUF +1
AD BUF
XCH BUF +1 # RATIO SQUARED - RATIO
AD BUF +1
TS MPAC # COEFFICIENT FOR VGU TERM
AD BUF +1
INDEX FIXLOC
TS 26D # COEFFICIENT FOR RDG-RGU TERM
AD BUF +1
INDEX FIXLOC
TS 28D # COEFFICIENT FOR VDG TERM
AD BUF
AD POSMAX
# Page 809
AD BUF +1
AD BUF +1
INDEX FIXLOC
TS 30D # COEFFICIENT FOR ADG TERM
CAF ZERO
TS MODE
TC INTPRETX
VXSC PDDL
VGU
28D
VXSC* PDVL*
VDG,1
RDG,1
VSU V/SC
RGU
TTF/8
VSR2 VXSC
26D
VAD VAD
V/SC VXSC
TTF/8
3/4DP
PDDL VXSC*
30D
ADG,1
VAD
AFCCALC1 VXM VSL1 # VERGUID COMES HERE
CG
PDVL V/SC
GDT/2
GSCALE
BVSU STADR
STORE UNFC/2 # UNFC/2 NEED NOT BE UNITIZED
ABVAL
AFCCALC2 STODL /AFC/ # MAGNITUDE OF AFC FOR THROTTLE
UNFC/2 # VERTICAL COMPONENT
DSQ PDDL
UNFC/2 +2 # OUT-OF-PLANE
DSQ PDDL
HIGHESTF
DDV DSQ
MASS # 2 2 2
DSU DSU # AMAXHORIZ = SQRT(ATOTAL - A - A )
BPL DLOAD # 1 0
AFCCALC3
ZEROVECS
AFCCALC3 SQRT DAD
UNFC/2 +4
# Page 810
BPL BDSU
AFCCLEND
UNFC/2 +4
STORE UNFC/2 +4
AFCCLEND EXIT
TC FASTCHNG
CA WCHPHASE # PREPARE FOR PHASE SWITCHING LOGIC
TS WCHPHOLD
INCR FLPASS0 # INCREMENT PASS COUNTER
BRSPOT4 INDEX WCHPHASE
TCF AFTRGUID
# ***********************************************************************
# ERECT GUIDANCE-STABLE MEMBER TRANSFORMATION MATRIX
# ***********************************************************************
CGCALC CAF EBANK5
TS EBANK
EBANK= TCGIBRAK
EXTEND
INDEX WCHPHASE
INDEX TARGTDEX
DCA TCGFBRAK
INCR BBANK
INCR BBANK
EBANK= TTF/8
AD TTF/8
XCH L
AD TTF/8
CCS A
CCS L
TCF EXTLOGIC
TCF EXTLOGIC
NOOP
TC INTPRETX
VLOAD UNIT
LAND
STODL CG
TTF/8
DMP* VXSC
GAINBRAK,1 # NUMERO MYSTERIOSO
ANGTERM
VAD
LAND
VSU RTB
R
NORMUNIT
# Page 811
VXV RTB
LAND
NORMUNIT
STOVL CG +6 # SECOND ROW
CG
VXV VSL1
CG +6
STORE CG +14
EXIT
# (CONTINUE TO EXTLOGIC)
#
# ***********************************************************************
# PREPARE TO EXIT
# ***********************************************************************
#
# DECIDE (1) HOW TO EXIT, AND (2) WHETHER TO SWITCH PHASES
#
EXTLOGIC INDEX WCHPHASE # WCHPHASE = 1 APPRQUAD
CA TENDBRAK # WCHPHASE = 0 BRAKQUAD
AD TTF/8
EXSPOT1 EXTEND
INDEX WCHPHASE
BZMF WHATEXIT
TC FASTCHNG
CA WCHPHOLD
AD ONE
TS WCHPHASE
CA ZERO
TS FLPASS0 # RESET FLPASS0
INDEX WCHPHOLD
TCF WHATEXIT
# ***********************************************************************
# ROUTINES FOR EXITING FROM LANDING GUIDANCE
# ***********************************************************************
#
# 1. EXGSUB IS THE RETURN WHEN GUIDSUB IS CALLED BY THE IGNITION ALGORITHM.
# 2. EXBRAK IN THE EXIT USED DURING THE BRAKING PHASE. IN THIS CASE UNIT(R) IS THE WINDOW POINTING VECTOR.
# 3. EXNORM IS THE EXIT USED AT OTHER TIMES DURING THE BURN.
# (EXOVFLOW IS A SUBROUTINE OF EXBRAK AND EXNORM CALLED WHEN OVERFLOW OCCURRED ANYWHERE IN GUIDANCE.)
EXGSUB TC INTPRET # COMPUTE TRIM VELOCITY CORRECTION TERM.
# Page 812
VLOAD RTB
UNFC/2
NORMUNIT
VXSC VXSC
ZOOMTIME
TRIMACCL
STORE UNFC/2
EXIT
CCS NGUIDSUB
TCF GUIDSUB
CCS NIGNLOOP
TCF +3
TC ALARM
OCT 01412
+3 TC POSTJUMP
CADR DDUMCALC
EXBRAK TC INTPRET
VLOAD
UNIT/R/
STORE UNWC/2
EXIT
TCF STEER?
EXNORM TC INTPRET
VLOAD VSU
LAND
R
RTB
NORMUNIT
STORE UNWC/2 # UNIT(LAND - R) IS TENTATIVE CHOICE
VXV DOT
XNBPIP
CG +6
EXIT # WITH PROJ IN MPAC 1/8 REAL SIZE
CS MPAC # GET COEFFICIENT FOR CG +14
AD PROJMAX
AD POSMAX
TS BUF
CS BUF
ADS BUF # RESULT IS 0 IF PROJMAX - PROJ NEGATIVE
CS PROJMIN # GET COEFFICIENT FOR UNIT(LAND - R)
AD MPAC
AD POSMAX
TS BUF +1
CS BUF +1
# Page 813
ADS BUF +1 # RESULT IS 0 IF PROJ - PROJMIN NEGATIVE
CAF FOUR
UNWCLOOP MASK SIX
TS Q
CA EBANK5
TS EBANK
EBANK= CG
CA BUF
EXTEND
INDEX Q
MP CG +14
INCR BBANK
EBANK= UNWC/2
INDEX Q
DXCH UNWC/2
EXTEND
MP BUF +1
INDEX Q
DAS UNWC/2
CCS Q
TCF UNWCLOOP
INCR BBANK
EBANK= PIF
STEER? CA FLAGWRD2 # IF STEERSW DOWN NO OUTPUTS
MASK STEERBIT
EXTEND
BZF RATESTOP
EXVERT CA OVFIND # IF OVERFLOW ANYWHERE IN GUIDANCE
EXTEND # DON'T CALL THROTTLE OR FINDCDUW
BZF +13
EXOVFLOW TC ALARM # SOUND THE ALARM NON-ABORTIVELY
OCT 01410
RATESTOP CAF BIT13 # ARE WE IN ATTITUDE-HOLD?
EXTEND
RAND CHAN31
EXTEND
BZF DISPEXIT # YES
TC BANKCALL # NO: DO A STOPRATE
CADR STOPRATE
TCF DISPEXIT
GDUMP1 TC THROTTLE
# Page 814
TC INTPRET
CALL
FINDCDUW -2
EXIT
# (CONTINUE TO DISPEXIT)
# ***********************************************************************
# GUIDANCE LOOP DISPLAYS
# ***********************************************************************
DISPEXIT EXTEND # KILL GROUP 3: DISPLAYS WILL BE
DCA NEG0 # RESTORED BY NEXT GUIDANCE CYCLE.
DXCH -PHASE3
+3 CS FLAGWRD8 # IF FLUNDISP IS SET, NO DISPLAY THIS PASS
MASK FLUNDBIT
EXTEND
BZF ENDLLJOB # TO PICK UP THE TAG
INDEX WCHPHOLD
TCF WHATDISP
-2 TC PHASCHNG # KILL GROUP 5
OCT 00035
P63DISPS CAF V06N63
DISPCOMN TC BANKCALL
CADR REGODSPR
ENDLLJOB TCF ENDOFJOB
P64DISPS CA TREDES # HAS TREDES REACHED ZERO?
EXTEND
BZF RED-OVER # YES: CLEAR REDESIGNATION FLAG
CS FLAGWRD6 # NO: IS REDFLAG SET?
MASK REDFLBIT
EXTEND
BZF REDES-OK # YES: DO STATIC DISPLAY
CAF V06N64 # OTHERWISE USE FLASHING DISPLAY
TC BANKCALL
CADR REFLASHR
TCF GOTOP00H # TERMINATE
TCF P64CEED # PROCEED PERMIT REDESIGNATIONS
TCF P64DISPS # RECYCLE
# Page 815
TCF ENDLLJOB
P64CEED CAF ZERO
TS ELINCR1
TS AZINCR1
TC UPFLAG # ENABLE REDESIGNATION LOGIC
ADRES REDFLAG
TCF ENDOFJOB
RED-OVER TC DOWNFLAG
ADRES REDFLAG
REDES-OK CAF V06N64
TCF DISPCOMN
VERTDISP CAF V06N60
TCF DISPCOMN
# **************************************************************************
# GUIDANCE FOR P65
# **************************************************************************
VERTGUID CCS WCHVERT
TCF P67VERT # POSITIVE NON-ZERO ---> P67
TCF P66VERT # +0
#
# THE P65 GUIDANCE EQUATION IS AS FOLLOWS --
# ____ ___
# V2FG - VGU
# ACG = ----------
# TAUVERT
P65VERT TC INTPRET
VLOAD VSU
V2FG
VGU
V/SC GOTO
TAUVERT
AFCCALC1
# Page 816
# **********************************************************
# GUIDANCE FOR P66
# **********************************************************
P66VERT TC POSTJUMP
CADR P66VERTA
P67VERT TC PHASCHNG # TERMINATE GROUP 3.
OCT 00003
TC INTPRET
VLOAD GOTO
V
VHORCOMP
SETLOC P66LOC
BANK
COUNT* $$/F2DPS
RODTASK CAF PRIO22
TC FINDVAC
EBANK= DVCNTR
2CADR RODCOMP
TCF TASKOVER
P66VERTA TC PHASCHNG # TERMINATE GROUP 3.
OCT 00003
CAF 1SEC
TC TWIDDLE
ADRES RODTASK
RODCOMP INHINT
CAF ZERO
XCH RODCOUNT
EXTEND
MP RODSCAL1
DAS VDGVERT # UPDATE DESIRED ALTITUDE RATE.
EXTEND # SET OLDPIPAX,Y,Z = PIPAX,Y,Z
DCA PIPAX
DXCH OLDPIPAX
DXCH RUPTREG1 # SET RUPTREG1,2,3 = OLDPIPAX,Y,Z
CA PIPAZ
XCH OLDPIPAZ
XCH RUPTREG3
EXTEND # SHAPSHOT TIME OF PIPA READING.
DCA TIME2
# Page 817
DXCH THISTPIP
CA OLDPIPAX
AD PIPATMPX
TS MPAC # MPAC(X) = PIPAX + PIPATMPX
CA OLDPIPAY
AD PIPATMPY
TS MPAC +3 # MPAC(Y) = PIPAY + PIPATMPY
CA OLDPIPAZ
AD PIPATMPZ
TS MPAC +5 # MPAC(Z) = PIPAZ + PIPATMPZ
CS OLDPIPAX
AD TEMX
AD RUPTREG1
TS DELVROD
CS OLDPIPAY
AD TEMY
AD RUPTREG2
TS DELVROD +2
CS OLDPIPAZ
AD TEMZ
AD RUPTREG3
TS DELVROD +4
CAF ZERO
TS MPAC +1 # ZERO LO-ORDER MPAC COMPONENTS
TS MPAC +4
TS MPAC +6
TS TEMX # ZERO TEMX, TEMY, AND TEMZ SO WE WILL
TS TEMY # KNOW WHEN READACCS CHANGES THEM.
TS TEMZ
CS ONE
TS MODE
TC INTPRET