4503f525e0f9c495ec8da7c96b482299c7079601
[fw/altos] / doc / system-operation.inc
1 [appendix]
2 == System Operation
3
4         === Firmware Modes
5
6                 The AltOS firmware build for the altimeters has two
7                 fundamental modes, “idle” and “flight”.  Which of these modes
8                 the firmware operates in is determined at start up time. For
9                 TeleMetrum, TeleMega and EasyMega, which have accelerometers, the mode is
10                 controlled by the orientation of the
11                 rocket (well, actually the board, of course...) at the time
12                 power is switched on.  If the rocket is “nose up”, then
13                 the flight computer assumes it's on a rail or rod being prepared for
14                 launch, so the firmware chooses flight mode.  However, if the
15                 rocket is more or less horizontal, the firmware instead enters
16                 idle mode.  Since TeleMini v2.0 and EasyMini don't have an
17                 accelerometer we can use to determine orientation, “idle” mode
18                 is selected if the board is connected via USB to a computer,
19                 otherwise the board enters “flight” mode. TeleMini v1.0
20                 selects “idle” mode if it receives a command packet within the
21                 first five seconds of operation.
22
23                 At power on, the altimeter will beep out the battery voltage
24                 to the nearest tenth of a volt.  Each digit is represented by
25                 a sequence of short “dit” beeps, with a pause between
26                 digits. A zero digit is represented with one long “dah”
27                 beep. Then there will be a short pause while the altimeter
28                 completes initialization and self test, and decides which mode
29                 to enter next.
30
31                 In flight or “pad” mode, the altimeter engages the flight
32                 state machine, goes into transmit-only mode to send telemetry,
33                 and waits for launch to be detected.  Flight mode is indicated
34                 by an “di-dah-dah-dit” (“P” for pad) on the beeper or lights,
35                 followed by beeps or flashes indicating the state of the
36                 pyrotechnic igniter continuity.  One beep/flash indicates
37                 apogee continuity, two beeps/flashes indicate main continuity,
38                 three beeps/flashes indicate both apogee and main continuity,
39                 and one longer “brap” sound which is made by rapidly
40                 alternating between two tones indicates no continuity.  For a
41                 dual deploy flight, make sure you're getting three beeps or
42                 flashes before launching!  For apogee-only or motor eject
43                 flights, do what makes sense.
44
45                 If idle mode is entered, you will hear an audible “di-dit” or
46                 see two short flashes (“I” for idle), and the flight state
47                 machine is disengaged, thus no ejection charges will fire.
48                 The altimeters also listen for the radio link when in idle
49                 mode for requests sent via TeleDongle.  Commands can be issued
50                 in idle mode over either USB or the radio link
51                 equivalently. TeleMini v1.0 only has the radio link.  Idle
52                 mode is useful for configuring the altimeter, for extracting
53                 data from the on-board storage chip after flight, and for
54                 ground testing pyro charges.
55
56                 In “Idle” and “Pad” modes, once the mode indication
57                 beeps/flashes and continuity indication has been sent, if
58                 there is no space available to log the flight in on-board
59                 memory, the flight computer will emit a warbling tone (much
60                 slower than the “no continuity tone”)
61
62                 See <<_understanding_beeps>> for a summary of all of
63                 the audio signals used.
64
65                 Once landed, the flight computer will signal that by emitting
66                 the “Landed” sound described above, after which it will beep
67                 out the apogee height (in meters). Each digit is represented
68                 by a sequence of short “dit” beeps, with a pause between
69                 digits. A zero digit is represented with one long “dah”
70                 beep. The flight computer will continue to report landed mode
71                 and beep out the maximum height until turned off.
72
73                 One “neat trick” of particular value when TeleMetrum, TeleMega
74                 or EasyMega are used with
75                 very large air-frames, is that you can power the board up while the
76                 rocket is horizontal, such that it comes up in idle mode.  Then you can
77                 raise the air-frame to launch position, and issue a 'reset' command
78                 via TeleDongle over the radio link to cause the altimeter to reboot and
79                 come up in flight mode.  This is much safer than standing on the top
80                 step of a rickety step-ladder or hanging off the side of a launch
81                 tower with a screw-driver trying to turn on your avionics before
82                 installing igniters!
83
84                 TeleMini v1.0 is configured solely via the radio link. Of course, that
85                 means you need to know the TeleMini radio configuration values
86                 or you won't be able to communicate with it. For situations
87                 when you don't have the radio configuration values, TeleMini v1.0
88                 offers an 'emergency recovery' mode. In this mode, TeleMini is
89                 configured as follows:
90
91
92                  * Sets the radio frequency to 434.550MHz
93                  * Sets the radio calibration back to the factory value.
94                  * Sets the callsign to N0CALL
95                  * Does not go to 'pad' mode after five seconds.
96
97                 To get into 'emergency recovery' mode, first find the row of
98                 four small holes opposite the switch wiring. Using a short
99                 piece of small gauge wire, connect the outer two holes
100                 together, then power TeleMini up. Once the red LED is lit,
101                 disconnect the wire and the board should signal that it's in
102                 'idle' mode after the initial five second startup period.
103
104         === GPS
105
106                 TeleMetrum and TeleMega include a complete GPS receiver.  A
107                 complete explanation of how GPS works is beyond the scope of
108                 this manual, but the bottom line is that the GPS receiver
109                 needs to lock onto at least four satellites to obtain a solid
110                 3 dimensional position fix and know what time it is.
111
112                 The flight computers provide backup power to the GPS chip any time a
113                 battery is connected.  This allows the receiver to “warm start” on
114                 the launch rail much faster than if every power-on were a GPS
115                 “cold start”.  In typical operations, powering up
116                 on the flight line in idle mode while performing final air-frame
117                 preparation will be sufficient to allow the GPS receiver to cold
118                 start and acquire lock.  Then the board can be powered down during
119                 RSO review and installation on a launch rod or rail.  When the board
120                 is turned back on, the GPS system should lock very quickly, typically
121                 long before igniter installation and return to the flight line are
122                 complete.
123
124         === Controlling An Altimeter Over The Radio Link
125
126                 One of the unique features of the Altus Metrum system is the
127                 ability to create a two way command link between TeleDongle
128                 and an altimeter using the digital radio transceivers
129                 built into each device. This allows you to interact with the
130                 altimeter from afar, as if it were directly connected to the
131                 computer.
132
133                 Any operation which can be performed with a flight computer can
134                 either be done with the device directly connected to the
135                 computer via the USB cable, or through the radio
136                 link. TeleMini v1.0 doesn't provide a USB connector and so it is
137                 always communicated with over radio.  Select the appropriate
138                 TeleDongle device when the list of devices is presented and
139                 AltosUI will interact with an altimeter over the radio link.
140
141                 One oddity in the current interface is how AltosUI selects the
142                 frequency for radio communications. Instead of providing
143                 an interface to specifically configure the frequency, it uses
144                 whatever frequency was most recently selected for the target
145                 TeleDongle device in Monitor Flight mode. If you haven't ever
146                 used that mode with the TeleDongle in question, select the
147                 Monitor Flight button from the top level UI, and pick the
148                 appropriate TeleDongle device.  Once the flight monitoring
149                 window is open, select the desired frequency and then close it
150                 down again. All radio communications will now use that frequency.
151
152                  * Save Flight Data—Recover flight data from the
153                    rocket without opening it up.
154
155                  * Configure altimeter apogee delays, main deploy
156                    heights and additional pyro event conditions to
157                    respond to changing launch conditions. You can also
158                    'reboot' the altimeter. Use this to remotely enable
159                    the flight computer by turning TeleMetrum or
160                    TeleMega on in “idle” mode, then once the air-frame
161                    is oriented for launch, you can reboot the
162                    altimeter and have it restart in pad mode without
163                    having to climb the scary ladder.
164
165                  * Fire Igniters—Test your deployment charges without snaking
166                    wires out through holes in the air-frame. Simply assemble the
167                    rocket as if for flight with the apogee and main charges
168                    loaded, then remotely command the altimeter to fire the
169                    igniters.
170
171                 Operation over the radio link for configuring an
172                 altimeter, ground testing igniters, and so forth uses
173                 the same RF frequencies as flight telemetry.  To
174                 configure the desired TeleDongle frequency, select the
175                 monitor flight tab, then use the frequency selector
176                 and close the window before performing other desired
177                 radio operations.
178
179                 The flight computers only enable radio commanding in
180                 'idle' mode.  TeleMetrum and TeleMega use the
181                 accelerometer to detect which orientation they start
182                 up in, so make sure you have the flight computer lying
183                 horizontally when you turn it on. Otherwise, it will
184                 start in 'pad' mode ready for flight, and will not be
185                 listening for command packets from TeleDongle.
186
187                 TeleMini listens for a command packet for five seconds
188                 after first being turned on, if it doesn't hear
189                 anything, it enters 'pad' mode, ready for flight and
190                 will no longer listen for command packets. The easiest
191                 way to connect to TeleMini is to initiate the command
192                 and select the TeleDongle device. At this point, the
193                 TeleDongle will be attempting to communicate with the
194                 TeleMini. Now turn TeleMini on, and it should
195                 immediately start communicating with the TeleDongle
196                 and the desired operation can be performed.
197
198                 You can monitor the operation of the radio link by watching the
199                 lights on the devices. The red LED will flash each time a packet
200                 is transmitted, while the green LED will light up on TeleDongle when
201                 it is waiting to receive a packet from the altimeter.
202
203         === Ground Testing
204
205                 An important aspect of preparing a rocket using electronic deployment
206                 for flight is ground testing the recovery system.  Thanks
207                 to the bi-directional radio link central to the Altus Metrum system,
208                 this can be accomplished in a TeleMega, TeleMetrum or TeleMini equipped rocket
209                 with less work than you may be accustomed to with other systems.  It
210                 can even be fun!
211
212                 Just prep the rocket for flight, then power up the altimeter
213                 in “idle” mode (placing air-frame horizontal for TeleMetrum or TeleMega, or
214                 selecting the Configure Altimeter tab for TeleMini).  This will cause
215                 the firmware to go into “idle” mode, in which the normal flight
216                 state machine is disabled and charges will not fire without
217                 manual command.  You can now command the altimeter to fire the apogee
218                 or main charges from a safe distance using your computer and
219                 TeleDongle and the Fire Igniter tab to complete ejection testing.
220
221         === Radio Link
222
223                 TeleMetrum, TeleMini and TeleMega all incorporate an
224                 RF transceiver, but it's not a full duplex system;
225                 each end can only be transmitting or receiving at any
226                 given moment. So we had to decide how to manage the
227                 link.
228
229                 By design, the altimeter firmware listens for the
230                 radio link when it's in “idle mode”, which allows us
231                 to use the radio link to configure the rocket, do
232                 things like ejection tests, and extract data after a
233                 flight without having to crack open the air-frame.
234                 However, when the board is in “flight mode”, the
235                 altimeter only transmits and doesn't listen at all.
236                 That's because we want to put ultimate priority on
237                 event detection and getting telemetry out of the
238                 rocket through the radio in case the rocket crashes
239                 and we aren't able to extract data later.
240
241                 We don't generally use a 'normal packet radio' mode
242                 like APRS because they're just too inefficient.  The
243                 GFSK modulation we use is FSK with the base-band
244                 pulses passed through a Gaussian filter before they go
245                 into the modulator to limit the transmitted bandwidth.
246                 When combined with forward error correction and
247                 interleaving, this allows us to have a very robust
248                 19.2 kilobit data link with only 10-40 milliwatts of
249                 transmit power, a whip antenna in the rocket, and a
250                 hand-held Yagi on the ground.  We've had flights to
251                 above 21k feet AGL with great reception, and
252                 calculations suggest we should be good to well over
253                 40k feet AGL with a 5-element yagi on the ground with
254                 our 10mW units and over 100k feet AGL with the 40mW
255                 devices.  We hope to fly boards to higher altitudes
256                 over time, and would of course appreciate customer
257                 feedback on performance in higher altitude flights!
258
259         :aprsdevices: TeleMetrum v2.0 and TeleMega
260         :configure_section: _configure_altimeter
261         include::aprs-operation.raw[]
262
263         === Configurable Parameters
264
265                 Configuring an Altus Metrum altimeter for flight is
266                 very simple.  Even on our baro-only TeleMini and
267                 EasyMini boards, the use of a Kalman filter means
268                 there is no need to set a “mach delay”.  All of the
269                 configurable parameters can be set using AltosUI
270                 over USB or or radio link via TeleDongle. Read
271                 <<_configure_altimeter>> for more information.