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