altos: Perform time comparisons using 16-bit arithmetic to handle wrap
[fw/altos] / doc / pyro-channels.inc
1
2 Acceleration:: Select a value, and then choose
3 whether acceleration should be above or below
4 that value. Acceleration is positive upwards,
5 so accelerating towards the ground would
6 produce negative numbers. Acceleration during
7 descent is noisy and inaccurate, so be careful
8 when using it during these phases of the
9 flight.
10
11 Vertical speed:: Select a value, and then
12 choose whether vertical speed should be above
13 or below that value. Speed is positive
14 upwards, so moving towards the ground would
15 produce negative numbers. Speed during descent
16 is a bit noisy and so be careful when using it
17 during these phases of the flight.
18
19 Height:: Select a value, and then choose
20 whether the height above the launch pad should
21 be above or below that value.
22
23 Orientation:: TeleMega and EasyMega contain a
24 3-axis gyroscope and accelerometer which is
25 used to measure the current angle. Note that
26 this angle is not the change in angle from the
27 launch pad, but rather absolute relative to
28 gravity; the 3-axis accelerometer is used to
29 compute the angle of the rocket on the launch
30 pad and initialize the system.
31
32   [NOTE]
33   ====
34   Because this value is computed by integrating
35   rate gyros, it gets progressively less
36   accurate as the flight goes on. It should have
37   an accumulated error of less than 0.2°/second
38   (after 10 seconds of flight, the error should
39   be less than 2°).
40
41   The usual use of the orientation configuration
42   is to ensure that the rocket is traveling
43   mostly upwards when deciding whether to ignite
44   air starts or additional stages. For that,
45   choose a reasonable maximum angle (like 20°)
46   and set the motor igniter to require an angle
47   of less than that value.
48   ====
49
50 Flight Time:: Time since boost was detected. Select a value and choose
51 whether to activate the pyro channel before or after that amount of
52 time.
53
54 Ascending:: A simple test saying whether the rocket is going up or
55 not. This is exactly equivalent to testing whether the speed is > 0.
56
57 Descending:: A simple test saying whether the rocket is going down or
58 not. This is exactly equivalent to testing whether the speed is < 0.
59
60 After Motor:: The flight software counts each time the rocket starts
61 accelerating and then decelerating (presumably due to a motor or
62 motors burning). Use this value for multi-staged or multi-airstart
63 launches.
64
65 Delay:: This value doesn't perform any checks, instead it inserts a
66 delay between the time when the other parameters become true and when
67 the pyro channel is activated.
68
69 Flight State:: The flight software tracks the flight
70 through a sequence of states:
71
72  * Boost. The motor has lit and the rocket is
73    accelerating upwards.
74
75  * Fast. The motor has burned out and the
76    rocket is decelerating, but it is going
77    faster than 200m/s.
78
79  * Coast. The rocket is still moving upwards
80    and decelerating, but the speed is less
81    than 200m/s.
82
83  * Drogue. The rocket has reached apogee and
84    is heading back down, but is above the
85    configured Main altitude.
86
87  * Main. The rocket is still descending, and
88    is below the Main altitude
89
90  * Landed. The rocket is no longer moving.
91
92 You can select a state to limit when the pyro channel may activate;
93 note that the check is based on when the rocket transitions *into* the
94 state, and so checking for “greater than Boost” means that the rocket
95 is currently in boost or some later state.
96
97 When a motor burns out, the rocket enters either Fast or Coast state
98 (depending on how fast it is moving). If the computer detects upwards
99 acceleration again, it will move back to Boost state.