IMU

This tutorial is additional to Stephan Hotto's "LM Simulator Tutorial" [1] and describe implementation specific parts.

IMU power on

As Stephan Hotto wrote:
"IMU OPR" is connected to the IMU power supply and therefore the button to activate the IMU physically whereas "ISS TURN ON REQUESTED" also called "ISS TURN ON DELAY REQUESTED" is a secondary signal generated by a small electronic responsible to give the IMU enough time to start up.

The electronic gets after 90sec an AGC output signal called "ISS TURN ON DELAY COMPLETE" (Channel 12/Bit 15) which activates the IMU turn on relay.
Since there is no possibility to connect a switch to the simulation at the moment we have to use a "Pulse" component to generate the "iss-turn-on-requested" signal.
<module type="Pulse" name="iss-power" >
	<cycle-time   unit="µs" >160000000</cycle-time>
	<pulse-length unit="µs" >100000000</pulse-length>
	
	<read   name="power-in" path="/main-a-28V/high" />
</module>
And connect it to AGC
<module type="AGC" name="agc" >
...
	<read   name="iss-turn-on-requested"                             path="/iss-power/pulse" />
...
	<source name="coarse-align-enable"        debug="2" />
	<source name="zero-imu-cdus"              debug="2" />
	<source name="iss-turn-on-delay-complete" debug="2" />
...
</module>

Note: It is needed to start yaDSKY with the --cfg=LM.ini option. Without the indicator lighting is not correct.

It is also importand to set the pulse longer than 90 seconds, just 90 seconds is not long enough. The pulse starts after "cycle-time" - "pulse-length" = 60 seconds and lasts for 100 seconds. After 60 + 90 seconds After 60 + 100 seconds The 10 seconds pulse length of the "iss-turn-on-delay-complete" signal is constant and does not depend on the pulse length of the "iss-turn-on-requested" signal.

Coarse align

V41N20E
+03000E
+00000E
+00000E

Format is 000.00 degrees.

Hint: enable debug output for cdu commands.
<module type="AGC" name="agc" >
...
	<source name="cduxcmd" debug="2" />
...
</module>

The "NO ATT" indicator is lightened and AGC start to send pulse bursts.

[/agc/coarse-align-enable] 1140899343s 514076µs apply Low->High
[/agc/error-counter-enable] 1140899343s 569552µs apply Low->High

[/agc/cduxcmd] 1140899343s 590288µs apply 0s 0µs 3200 0->1140899343s 590288µs 3200 192
[/agc/drive-cdu-z] 1140899343s 590384µs apply Low->High
[/agc/drive-cdu-y] 1140899343s 590384µs apply Low->High
[/agc/drive-cdu-x] 1140899343s 590384µs apply Low->High
[/agc/cduxcmd] 1140899343s 650288µs apply 1140899343s 590288µs 3200 192->1140899343s 650288µs 3200 0

[/agc/cduxcmd] 1140899344s 190288µs apply 1140899343s 650288µs 3200 0->1140899344s 190288µs 3200 192
[/agc/cduxcmd] 1140899344s 250288µs apply 1140899344s 190288µs 3200 192->1140899344s 250288µs 3200 0

[/agc/cduxcmd] 1140899344s 790288µs apply 1140899344s 250288µs 3200 0->1140899344s 790288µs 3200 192
[/agc/cduxcmd] 1140899344s 850288µs apply 1140899344s 790288µs 3200 192->1140899344s 850288µs 3200 0

[/agc/cduxcmd] 1140899345s 390288µs apply 1140899344s 850288µs 3200 0->1140899345s 390288µs 3200 107
[/agc/cduxcmd] 1140899345s 450288µs apply 1140899345s 390288µs 3200 107->1140899345s 450288µs 3200 0

Without feedback from the CDU counter registers AGC now get a program alarm.

V05N09E
00211
file:yaAGC/Contributed/LM_Simulator/doc/alarm_codes.txt
#  00211		COARSE ALIGN ERROR				IMU MODE SWITCH

In opposition to the command pulse bursts the IMU feedback is not described on an abstract level in the documentation [2]. Fortunately Luminary already calculates the expected CDU counter values in an array named THETAD.

file:yaAGC/Luminary131/Luminary131.lst

                                                                                        	#  Page 1309
                                                                                        	#  IMU COARSE ALIGN MODE.
...
07,3063           34752                          CAF      TWO                           	#  AT END OF COMMAND, CHECK TO SEE THAT
07,3064           54061        CHKCORS           TS       ITEMP1                        	#  GIMBALS ARE WITHIN 2 DEGREES OF THETAD.
07,3065           50000                          INDEX    A                             	#
07,3066           30032                          CA       CDUX                          	#
...
07,3071           20321                          MSU      THETAD                        	#
>break 07,3064
>cont

V41N20E
+33333E
+33333E
+33333E

>show 0321 + 2
000321 EF,0321 073204 073204 073204

The following table shows some commanded IMU angles and expected CDU feedback.

angle pulses THETAD
+00000 0 000000
+00840 191 001375
+03000 683 005253
+09000 2048 020000 8192
+18000 4096 04000016384
+19000 -3869 041616
+20000 -3641 043434
+27000 -2048 060000
+33333 -607 073204
+35999 0 077777
+36000 op err

Finally a test of the 2° tolerance.

91 * 2 = 182 = 0266 pulses

017511 pa 0211
020000 - 0266 017512 ok
020000 + 0266 020266 ok
020267 ok
020270 pa 0211

Note: This test was done writing directly into the CDU registers with the debugger. Since the actual simulator version overwrites the CDU registers with IMU feedback this is not possible anymore.

>break 07,3064
>cont

V41N20E
+09000E
+00000E
+00000E

>show THETAD + 2
000321 EF,0321 020000 000000 000000
>show CDUX + 2
000032 EF,0032 000000 000000 000000
>set 020000 CDUX
EF,0032 020000
>show CDUX + 2
000032 EF,0032 020000 000000 000000

Fine align

V42E
+00000E
+00000E
+00000E

The "NO ATT" indicator turned off.

[/agc/coarse-align-enable] 1141159627s 304456µs apply High->Low
[/agc/gyro-enable-power-for-pulses] 1141159629s 307748µs apply Low->High

If I enter some angle bigger then ? AGC abends.

V42E
+03000E
+00000E
+00000E
[/agc/coarse-align-enable] 1141159220s 987236µs apply High->Low
[/agc/gyro-enable-power-for-pulses] 1141159222s 985896µs apply Low->High
[/agc/gyro-select-b] 1141159223s 25268µs apply Low->High
[/agc/gyro-activity] 1141159223s 27404µs apply Low->High
 update HISCALAR
RUPT 3
Something was modified during interrupt processing
BRUPT 64010 2976
ZRUPT 2465 2465
   BB 1026 1027
index 0 4501
where 64010 64010
processing_interrupt 1
real 1141159225s 906289µs
time 1141159225s 906289µs
until 1141159225s 902040µs
diff 14249
step 10000
Obtained 7 stack frames.
/home/garfield/FlightLM/FlightAGC/src/agc/.libs/libagc.so.0(_ZN3AGC9Processor4stepERN7Support7TimeValE+0xf94) [0x4001ad44]
/home/garfield/FlightLM/FlightAGC/src/sim/.libs/libsim.so.0(_ZN3Sim8cmpntAGC3runERN3HDL5ModelERKN7Support7TimeValE+0x3e2) [0x400692f2]
/home/garfield/FlightLM/FlightAGC/src/HDL/.libs/libhdl.so.0(_ZN3HDL6Module4_runERNS_5ModelERKN7Support7TimeValE+0x17) [0x40024607]
/home/garfield/FlightLM/FlightAGC/src/HDL/.libs/libhdl.so.0(_ZN3HDL5Model3runERKN7Support7TimeValE+0x179) [0x40024ae9]
/home/garfield/FlightLM/FlightAGC/src/sim/.libs/lt-sim [0x804a83f]
/lib/tls/libc.so.6(__libc_start_main+0xd0) [0x40531ea0]
/home/garfield/FlightLM/FlightAGC/src/sim/.libs/lt-sim(__gxx_personality_v0+0x89) [0x8049ed1]
- Gyro Torque Enable, 102.4 kHz (issued by computer 20 ms prior to gyro select).
- Gyro Select Command, 102.4 kHz ...
- Gyro Set, 3.2 kHz occurs 2 ms after gyro select; ...
- Gyro Reset, ...

+00100

[/agc/coarse-align-enable] 1141385842s 898053µs apply High->Low
[/agc/gyro-enable-power-for-pulses] 1141385844s 900289µs apply Low->High
[/agc/gyro-select-b] 1141385844s 939493µs apply Low->High
[/agc/gyrocmd] 1141385844s 940081µs apply 1141385817s 715057µs 3200 0->1141385844s 940081µs 3200 582
[/agc/gyro-activity] 1141385844s 941593µs apply Low->High
[/agc/gyrocmd] 1141385845s 81µs apply 1141385844s 940081µs 3200 582->1141385845s 81µs 3200 0
[/agc/gyro-select-b] 1141385845s 147405µs apply High->Low
[/agc/gyro-activity] 1141385845s 147405µs apply High->Low

-00900

[/agc/coarse-align-enable] 1141386184s 132544µs apply High->Low
[/agc/gyro-enable-power-for-pulses] 1141386186s 129764µs apply Low->High
[/agc/gyro-select-b] 1141386186s 168956µs apply Low->High
[/agc/gyro-torquing-command-in-negative-direction] 1141386186s 168956µs apply Low->High
[/agc/gyrocmd] 1141386186s 169652µs apply 1141386157s 701620µs 3200 0->1141386186s 169652µs 3200 5243
[/agc/gyro-activity] 1141386186s 171164µs apply Low->High
[/agc/gyrocmd] 1141386186s 229652µs apply 1141386186s 169652µs 3200 5243->1141386186s 229652µs 3200 0
[/agc/gyro-select-b] 1141386187s 826864µs apply High->Low
[/agc/gyro-torquing-command-in-negative-direction] 1141386187s 826864µs apply High->Low
[/agc/gyro-activity] 1141386187s 826864µs apply High->Low
#  Page 280
#  IMUFINEK	VERB 42		DESCRIPTION
# 	FINE ALIGN IMU

# 	1.	REQUIRE EXT VERB DISPLAY AVAILABLE AND SET BUSY FLAG OR TURN ON OPER ERROR AND GO TO PINBRNCH.
# 	2.	DISPLAY FLASHING V25,N93....LOAD DELTA GYRO ANGLES....
# 		RESPONSES
# 		A.	TERMINATE
# 			1.	RELEASE EXT VERB DISPLAY SYSTEM.
# 		B.	PROCEED OR ENTER
# 			1.	RE-DISPLAY VERB 42
# 			2.	EXECUTE IMUFINE (IMU FIVE ALIGN MODE SWITCHING).
# 			3.	EXECUTE IMUSTALL (ALLOW FOR DATA TRANSFER)
# 				A.	FAILED
# 					1. 	RELEASE EXT VERB DISPLAY SYSTEM.
# 				B.	GOOD
# 					1.	EXECUTE IMUPULSE (TORQUE IRIGS).
# 					2.	EXECUTE IMUSTALL AND RELEASE EXT VERB DISPLAY SYSTEM.
>watch GYROCMD
angle GYROCMD
+00100 001106 582
+00200 002215 1165
+00300 003323 1747
+00400 004432 2330
+00800 011064 4660
+00900 012173 5243
+01000 013301 5825

010000000 pulses / 360°

[/agc/gyro-enable-power-for-pulses] 1141393400s 725371µs apply Low->High
[/agc/gyro-select] 1141393400s 763255µs apply 0->2
[/agc/gyro-select-a] 1141393400s 763255µs apply Low->High
[/agc/gyrocmd] 1141393400s 763843µs apply 0s 0µs 3200 0->1141393400s 763843µs 3200 582
[/agc/gyro-activity] 1141393400s 765343µs apply Low->High
[/agc/gyrocmd] 1141393400s 823843µs apply 1141393400s 763843µs 3200 582->1141393400s 823843µs 3200 0
[/agc/gyro-select] 1141393400s 975127µs apply 2->0
[/agc/gyro-select-a] 1141393400s 975127µs apply High->Low
[/agc/gyro-activity] 1141393400s 975127µs apply High->Low
[/agc/gyro-select] 1141393400s 975943µs apply 0->3
[/agc/gyro-select-b] 1141393400s 975943µs apply Low->High
[/agc/gyro-select-a] 1141393400s 975943µs apply Low->High
[/agc/gyrocmd] 1141393400s 976543µs apply 1141393400s 823843µs 3200 0->1141393400s 976543µs 3200 582
[/agc/gyro-activity] 1141393400s 978043µs apply Low->High
[/agc/gyrocmd] 1141393401s 36543µs apply 1141393400s 976543µs 3200 582->1141393401s 36543µs 3200 0
[/agc/gyro-select] 1141393401s 182427µs apply 3->0
[/agc/gyro-select-b] 1141393401s 182427µs apply High->Low
[/agc/gyro-select-a] 1141393401s 182427µs apply High->Low
[/agc/gyro-activity] 1141393401s 182427µs apply High->Low
[/agc/gyro-select] 1141393401s 183303µs apply 0->1
[/agc/gyro-select-b] 1141393401s 183303µs apply Low->High
[/agc/gyrocmd] 1141393401s 183891µs apply 1141393401s 36543µs 3200 0->1141393401s 183891µs 3200 582
[/agc/gyro-activity] 1141393401s 185391µs apply Low->High
[/agc/gyrocmd] 1141393401s 243891µs apply 1141393401s 183891µs 3200 582->1141393401s 243891µs 3200 0
[/agc/gyro-select] 1141393401s 392427µs apply 1->0
[/agc/gyro-select-b] 1141393401s 392427µs apply High->Low
[/agc/gyro-activity] 1141393401s 392427µs apply High->Low

Zero IMU

At AGC startup

[/agc/zero-imu-cdus] 1140899316s 745232µs apply Low->High
[/agc/zero-imu-cdus] 1140899317s 62272µs apply High->Low

Recources

  1. Stephan Hotto
    LM Simulator Tutorial

  2. APOLLO 15 Delco Electronics
    www.hq.nasa.gov/office/pao/History/alsj/a15/A15Delco.pdf
    www.hq.nasa.gov/alsj/a15/A15Delco.pdf
    HW-1 (Page 456)
    HARDWARE
    COARSE ALIGN - FINE ALIGN

  3. APOLLO 15 Delco Electronics
    www.hq.nasa.gov/office/pao/History/alsj/a15/A15Delco.pdf
    www.hq.nasa.gov/alsj/a15/A15Delco.pdf
    HW-22 (Page 481)
    GYRO PULSE TORQUING

  4. Apollo Guidance and Navigation Lunar Module Student Study Guide
    hrst.mit.edu/hrs/apollo/public/archive/1709.pdf
    3.4 ISS MODE SWITCHING ROUTINES
    Page 3-70 (159)