altos: Clean up some debug stuff in ao_flight.c
[fw/altos] / doc / altusmetrum.xsl
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3   "/usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd">
4 <book>
5   <title>The Altus Metrum System</title>
6   <subtitle>An Owner's Manual for TeleMetrum and TeleDongle Devices</subtitle>
7   <bookinfo>
8     <author>
9       <firstname>Bdale</firstname>
10       <surname>Garbee</surname>
11     </author>
12     <author>
13       <firstname>Keith</firstname>
14       <surname>Packard</surname>
15     </author>
16     <author>
17       <firstname>Bob</firstname>
18       <surname>Finch</surname>
19     </author>
20     <author>
21       <firstname>Anthony</firstname>
22       <surname>Towns</surname>
23     </author>
24     <copyright>
25       <year>2011</year>
26       <holder>Bdale Garbee and Keith Packard</holder>
27     </copyright>
28     <legalnotice>
29       <para>
30         This document is released under the terms of the
31         <ulink url="http://creativecommons.org/licenses/by-sa/3.0/">
32           Creative Commons ShareAlike 3.0
33         </ulink>
34         license.
35       </para>
36     </legalnotice>
37     <revhistory>
38       <revision>
39         <revnumber>0.9</revnumber>
40         <date>18 January 2011</date>
41         <revremark>
42           Updated for software version 0.9.  Note that 0.9 represents a
43           telemetry format change, meaning both ends of a link (TeleMetrum and
44           TeleDongle) must be updated or communications will fail.
45         </revremark>
46       </revision>
47     </revhistory>
48     <revhistory>
49       <revision>
50         <revnumber>0.8</revnumber>
51         <date>24 November 2010</date>
52         <revremark>Updated for software version 0.8 </revremark>
53       </revision>
54     </revhistory>
55   </bookinfo>
56   <acknowledgements>
57     <para>
58       Thanks to Bob Finch, W9YA, NAR 12965, TRA 12350 for writing "The
59       Mere-Mortals Quick Start/Usage Guide to the Altus Metrum Starter
60       Kit" which has turned into the Getting Started chapter in this
61       book. Bob was one of our first customers for a production
62       TeleMetrum, and the enthusiasm that led to his contribution of
63       this section is immensely gratifying and highy appreciated!
64     </para>
65     <para>
66       And thanks to Anthony (AJ) Towns for contributing the
67       AltosUI graphing and site map code and documentation. Free
68       software means that our customers and friends can become our
69       collaborators, and we certainly appreciate this level of
70       contribution.
71     </para>
72     <para>
73       Have fun using these products, and we hope to meet all of you
74       out on the rocket flight line somewhere.
75       <literallayout>
76 Bdale Garbee, KB0G
77 NAR #87103, TRA #12201
78
79 Keith Packard, KD7SQG
80 NAR #88757, TRA #12200
81       </literallayout>
82     </para>
83   </acknowledgements>
84   <chapter>
85     <title>Introduction and Overview</title>
86     <para>
87       Welcome to the Altus Metrum community!  Our circuits and software reflect
88       our passion for both hobby rocketry and Free Software.  We hope their
89       capabilities and performance will delight you in every way, but by
90       releasing all of our hardware and software designs under open licenses,
91       we also hope to empower you to take as active a role in our collective
92       future as you wish!
93     </para>
94     <para>
95       The focal point of our community is TeleMetrum, a dual deploy altimeter
96       with fully integrated GPS and radio telemetry as standard features, and
97       a "companion interface" that will support optional capabilities in the
98       future.
99     </para>
100     <para>
101       Complementing TeleMetrum is TeleDongle, a USB to RF interface for
102       communicating with TeleMetrum.  Combined with your choice of antenna and
103       notebook computer, TeleDongle and our associated user interface software
104       form a complete ground station capable of logging and displaying in-flight
105       telemetry, aiding rocket recovery, then processing and archiving flight
106       data for analysis and review.
107     </para>
108     <para>
109       More products will be added to the Altus Metrum family over time, and
110       we currently envision that this will be a single, comprehensive manual
111       for the entire product family.
112     </para>
113   </chapter>
114   <chapter>
115     <title>Getting Started</title>
116     <para>
117       The first thing to do after you check the inventory of parts in your
118       "starter kit" is to charge the battery by plugging it into the
119       corresponding socket of the TeleMetrum and then using the USB A to
120       mini B
121       cable to plug the Telemetrum into your computer's USB socket. The
122       TeleMetrum circuitry will charge the battery whenever it is plugged
123       in, because the TeleMetrum's on-off switch does NOT control the
124       charging circuitry.  When the GPS chip is initially searching for
125       satellites, TeleMetrum will consume more current than it can pull
126       from the usb port, so the battery must be attached in order to get
127       satellite lock.  Once GPS is locked, the current consumption goes back
128       down enough to enable charging while
129       running. So it's a good idea to fully charge the battery as your
130       first item of business so there is no issue getting and maintaining
131       satellite lock.  The yellow charge indicator led will go out when the
132       battery is nearly full and the charger goes to trickle charge. It
133       can take several hours to fully recharge a deeply discharged battery.
134     </para>
135     <para>
136       The other active device in the starter kit is the TeleDongle USB to
137       RF interface.  If you plug it in to your Mac or Linux computer it should
138       "just work", showing up as a serial port device.  Windows systems need
139       driver information that is part of the AltOS download to know that the
140       existing USB modem driver will work.  If you are using Linux and are
141       having problems, try moving to a fresher kernel (2.6.33 or newer), as
142       the USB serial driver had ugly bugs in some earlier versions.
143     </para>
144     <para>
145       Next you should obtain and install the AltOS utilities.  These include
146       the AltosUI ground station program, current firmware images for
147       TeleMetrum and TeleDongle, and a number of standalone utilities that
148       are rarely needed.  Pre-built binary packages are available for Debian
149       Linux, Microsoft Windows, and recent MacOSX versions.  Full sourcecode
150       and build instructions for some other Linux variants are also available.
151       The latest version may always be downloaded from
152       <ulink url="http://altusmetrum.org/AltOS"/>.
153     </para>
154     <para>
155       Both Telemetrum and TeleDongle can be directly communicated
156       with using USB ports. The first thing you should try after getting
157       both units plugged into to your computer's usb port(s) is to run
158       'ao-list' from a terminal-window to see what port-device-name each
159       device has been assigned by the operating system.
160       You will need this information to access the devices via their
161       respective on-board firmware and data using other command line
162       programs in the AltOS software suite.
163     </para>
164     <para>
165       To access the device's firmware for configuration you need a terminal
166       program such as you would use to talk to a modem.  The software
167       authors prefer using the program 'cu' which comes from the UUCP package
168       on most Unix-like systems such as Linux.  An example command line for
169       cu might be 'cu -l /dev/ttyACM0', substituting the correct number
170       indicated from running the
171       ao-list program.  Another reasonable terminal program for Linux is
172       'cutecom'.  The default 'escape'
173       character used by CU (i.e. the character you use to
174       issue commands to cu itself instead of sending the command as input
175       to the connected device) is a '~'. You will need this for use in
176       only two different ways during normal operations. First is to exit
177       the program by sending a '~.' which is called a 'escape-disconnect'
178       and allows you to close-out from 'cu'. The
179       second use will be outlined later.
180     </para>
181     <para>
182       Both TeleMetrum and TeleDongle share the concept of a two level
183       command set in their firmware.
184       The first layer has several single letter commands. Once
185       you are using 'cu' (or 'cutecom') sending (typing) a '?'
186       returns a full list of these
187       commands. The second level are configuration sub-commands accessed
188       using the 'c' command, for
189       instance typing 'c?' will give you this second level of commands
190       (all of which require the
191       letter 'c' to access).  Please note that most configuration options
192       are stored only in DataFlash memory, and only TeleMetrum has this
193       memory to save the various values entered like the channel number
194       and your callsign when powered off.  TeleDongle requires that you
195       set these each time you plug it in, which ao-view can help with.
196     </para>
197     <para>
198       Try setting these config ('c' or second level menu) values.  A good
199       place to start is by setting your call sign.  By default, the boards
200       use 'N0CALL' which is cute, but not exactly legal!
201       Spend a few minutes getting comfortable with the units, their
202       firmware, and 'cu' (or possibly 'cutecom').
203       For instance, try to send
204       (type) a 'c r 2' and verify the channel change by sending a 'c s'.
205       Verify you can connect and disconnect from the units while in your
206       terminal program by sending the escape-disconnect mentioned above.
207     </para>
208     <para>
209       Note that the 'reboot' command, which is very useful on TeleMetrum,
210       will likely just cause problems with the dongle.  The *correct* way
211       to reset the dongle is just to unplug and re-plug it.
212     </para>
213     <para>
214       A fun thing to do at the launch site and something you can do while
215       learning how to use these units is to play with the rf-link access
216       of the TeleMetrum from the TeleDongle.  Be aware that you *must* create
217       some physical separation between the devices, otherwise the link will
218       not function due to signal overload in the receivers in each device.
219     </para>
220     <para>
221       Now might be a good time to take a break and read the rest of this
222       manual, particularly about the two "modes" that the TeleMetrum
223       can be placed in and how the position of the TeleMetrum when booting
224       up will determine whether the unit is in "pad" or "idle" mode.
225     </para>
226     <para>
227       You can access a TeleMetrum in idle mode from the Teledongle's USB
228       connection using the rf link
229       by issuing a 'p' command to the TeleDongle. Practice connecting and
230       disconnecting ('~~' while using 'cu') from the TeleMetrum.  If
231       you cannot escape out of the "p" command, (by using a '~~' when in
232       CU) then it is likely that your kernel has issues.  Try a newer version.
233     </para>
234     <para>
235       Using this rf link allows you to configure the TeleMetrum, test
236       fire e-matches and igniters from the flight line, check pyro-match
237       continuity and so forth. You can leave the unit turned on while it
238       is in 'idle mode' and then place the
239       rocket vertically on the launch pad, walk away and then issue a
240       reboot command.  The TeleMetrum will reboot and start sending data
241       having changed to the "pad" mode. If the TeleDongle is not receiving
242       this data, you can disconnect 'cu' from the Teledongle using the
243       procedures mentioned above and THEN connect to the TeleDongle from
244       inside 'ao-view'. If this doesn't work, disconnect from the
245       TeleDongle, unplug it, and try again after plugging it back in.
246     </para>
247     <para>
248       Eventually the GPS will find enough satellites, lock in on them,
249       and 'ao-view' will both auditorially announce and visually indicate
250       that GPS is ready.
251       Now you can launch knowing that you have a good data path and
252       good satellite lock for flight data and recovery.  Remember
253       you MUST tell ao-view to connect to the TeleDongle explicitly in
254       order for ao-view to be able to receive data.
255     </para>
256     <para>
257       Both RDF (radio direction finding) tones from the TeleMetrum and
258       GPS trekking data are available and together are very useful in
259       locating the rocket once it has landed. (The last good GPS data
260       received before touch-down will be on the data screen of 'ao-view'.)
261     </para>
262     <para>
263       Once you have recovered the rocket you can download the eeprom
264       contents using either 'ao-dumplog' (or possibly 'ao-eeprom'), over
265       either a USB cable or over the radio link using TeleDongle.
266       And by following the man page for 'ao-postflight' you can create
267       various data output reports, graphs, and even kml data to see the
268       flight trajectory in google-earth. (Moving the viewing angle making
269       sure to connect the yellow lines while in google-earth is the proper
270       technique.)
271     </para>
272     <para>
273       As for ao-view.... some things are in the menu but don't do anything
274       very useful.  The developers have stopped working on ao-view to focus
275       on a new, cross-platform ground station program.  So ao-view may or
276       may not be updated in the future.  Mostly you just use
277       the Log and Device menus.  It has a wonderful display of the incoming
278       flight data and I am sure you will enjoy what it has to say to you
279       once you enable the voice output!
280     </para>
281     <section>
282       <title>FAQ</title>
283       <para>
284         The altimeter (TeleMetrum) seems to shut off when disconnected from the
285         computer.  Make sure the battery is adequately charged.  Remember the
286         unit will pull more power than the USB port can deliver before the
287         GPS enters "locked" mode.  The battery charges best when TeleMetrum
288         is turned off.
289       </para>
290       <para>
291         It's impossible to stop the TeleDongle when it's in "p" mode, I have
292         to unplug the USB cable?  Make sure you have tried to "escape out" of
293         this mode.  If this doesn't work the reboot procedure for the
294         TeleDongle *is* to simply unplug it. 'cu' however will retain it's
295         outgoing buffer IF your "escape out" ('~~') does not work.
296         At this point using either 'ao-view' (or possibly
297         'cutemon') instead of 'cu' will 'clear' the issue and allow renewed
298         communication.
299       </para>
300       <para>
301         The amber LED (on the TeleMetrum/altimeter) lights up when both
302         battery and USB are connected. Does this mean it's charging?
303         Yes, the yellow LED indicates the charging at the 'regular' rate.
304         If the led is out but the unit is still plugged into a USB port,
305         then the battery is being charged at a 'trickle' rate.
306       </para>
307       <para>
308         There are no "dit-dah-dah-dit" sound like the manual mentions?
309         That's the "pad" mode.  Weak batteries might be the problem.
310         It is also possible that the unit is horizontal and the output
311         is instead a "dit-dit" meaning 'idle'.
312       </para>
313       <para>
314         It's unclear how to use 'ao-view' and other programs when 'cu'
315         is running. You cannot have more than one program connected to
316         the TeleDongle at one time without apparent data loss as the
317         incoming data will not make it to both programs intact.
318         Disconnect whatever programs aren't currently being used.
319       </para>
320       <para>
321         How do I save flight data?
322         Live telemetry is written to file(s) whenever 'ao-view' is connected
323         to the TeleDongle.  The file area defaults to ~/altos
324         but is easily changed using the menus in 'ao-view'. The files that
325         are written end in '.telem'. The after-flight
326         data-dumped files will end in .eeprom and represent continuous data
327         unlike the rf-linked .telem files that are subject to the
328         turnarounds/data-packaging time slots in the half-duplex rf data path.
329         See the above instructions on what and how to save the eeprom stored
330         data after physically retrieving your TeleMetrum.  Make sure to save
331         the on-board data after each flight, as the current firmware will
332         over-write any previous flight data during a new flight.
333       </para>
334     </section>
335   </chapter>
336   <chapter>
337     <title>Specifications</title>
338     <itemizedlist>
339       <listitem>
340         <para>
341           Recording altimeter for model rocketry.
342         </para>
343       </listitem>
344       <listitem>
345         <para>
346           Supports dual deployment (can fire 2 ejection charges).
347         </para>
348       </listitem>
349       <listitem>
350         <para>
351           70cm ham-band transceiver for telemetry downlink.
352         </para>
353       </listitem>
354       <listitem>
355         <para>
356           Barometric pressure sensor good to 45k feet MSL.
357         </para>
358       </listitem>
359       <listitem>
360         <para>
361           1-axis high-g accelerometer for motor characterization, capable of
362           +/- 50g using default part.
363         </para>
364       </listitem>
365       <listitem>
366         <para>
367           On-board, integrated GPS receiver with 5hz update rate capability.
368         </para>
369       </listitem>
370       <listitem>
371         <para>
372           On-board 1 megabyte non-volatile memory for flight data storage.
373         </para>
374       </listitem>
375       <listitem>
376         <para>
377           USB interface for battery charging, configuration, and data recovery.
378         </para>
379       </listitem>
380       <listitem>
381         <para>
382           Fully integrated support for LiPo rechargeable batteries.
383         </para>
384       </listitem>
385       <listitem>
386         <para>
387           Uses LiPo to fire e-matches, can be modiied to support 
388           optional separate pyro battery if needed.
389         </para>
390       </listitem>
391       <listitem>
392         <para>
393           2.75 x 1 inch board designed to fit inside 29mm airframe coupler tube.
394         </para>
395       </listitem>
396     </itemizedlist>
397   </chapter>
398   <chapter>
399     <title>Handling Precautions</title>
400     <para>
401       TeleMetrum is a sophisticated electronic device.  When handled gently and
402       properly installed in an airframe, it will deliver impressive results.
403       However, like all electronic devices, there are some precautions you
404       must take.
405     </para>
406     <para>
407       The Lithium Polymer rechargeable batteries used with TeleMetrum have an
408       extraordinary power density.  This is great because we can fly with
409       much less battery mass than if we used alkaline batteries or previous
410       generation rechargeable batteries... but if they are punctured
411       or their leads are allowed to short, they can and will release their
412       energy very rapidly!
413       Thus we recommend that you take some care when handling our batteries
414       and consider giving them some extra protection in your airframe.  We
415       often wrap them in suitable scraps of closed-cell packing foam before
416       strapping them down, for example.
417     </para>
418     <para>
419       The TeleMetrum barometric sensor is sensitive to sunlight.  In normal
420       mounting situations, it and all of the other surface mount components
421       are "down" towards whatever the underlying mounting surface is, so
422       this is not normally a problem.  Please consider this, though, when
423       designing an installation, for example, in a 29mm airframe with a
424       see-through plastic payload bay.
425     </para>
426     <para>
427       The TeleMetrum barometric sensor sampling port must be able to
428       "breathe",
429       both by not being covered by foam or tape or other materials that might
430       directly block the hole on the top of the sensor, but also by having a
431       suitable static vent to outside air.
432     </para>
433     <para>
434       As with all other rocketry electronics, TeleMetrum must be protected
435       from exposure to corrosive motor exhaust and ejection charge gasses.
436     </para>
437   </chapter>
438   <chapter>
439     <title>Hardware Overview</title>
440     <para>
441       TeleMetrum is a 1 inch by 2.75 inch circuit board.  It was designed to
442       fit inside coupler for 29mm airframe tubing, but using it in a tube that
443       small in diameter may require some creativity in mounting and wiring
444       to succeed!  The default 1/4
445       wave UHF wire antenna attached to the center of the nose-cone end of
446       the board is about 7 inches long, and wiring for a power switch and
447       the e-matches for apogee and main ejection charges depart from the
448       fin can end of the board.  Given all this, an ideal "simple" avionics
449       bay for TeleMetrum should have at least 10 inches of interior length.
450     </para>
451     <para>
452       A typical TeleMetrum installation using the on-board GPS antenna and
453       default wire UHF antenna involves attaching only a suitable
454       Lithium Polymer battery, a single pole switch for power on/off, and
455       two pairs of wires connecting e-matches for the apogee and main ejection
456       charges.
457     </para>
458     <para>
459       By default, we use the unregulated output of the LiPo battery directly
460       to fire ejection charges.  This works marvelously with standard
461       low-current e-matches like the J-Tek from MJG Technologies, and with
462       Quest Q2G2 igniters.  However, if you
463       want or need to use a separate pyro battery, the board can be factory
464       modified to do so.  This involves cutting two traces and adding a jumper
465       in a densely populated part of the board on TeleMetrum v1.0 and v1.1,
466       along with installation of a pyro battery connector at location B2.
467     </para>
468     <para>
469       We offer two choices of pyro and power switch connector, or you can
470       choose neither and solder wires directly to the board.  All three choices
471       are reasonable depending on the constraints of your airframe.  Our
472       favorite option when there is sufficient room above the board is to use
473       the Tyco pin header with polarization and locking.  If you choose this
474       option, you crimp individual wires for the power switch and e-matches
475       into a mating connector, and installing and removing the TeleMetrum
476       board from an airframe is as easy as plugging or unplugging two
477       connectors.  If the airframe will not support this much height or if
478       you want to be able to directly attach e-match leads to the board, we
479       offer a screw terminal block.  This is very similar to what most other
480       altimeter vendors provide and so may be the most familiar option.
481       You'll need a very small straight blade screwdriver to connect
482       and disconnect the board in this case, such as you might find in a
483       jeweler's screwdriver set.  Finally, you can forego both options and
484       solder wires directly to the board, which may be the best choice for
485       minimum diameter and/or minimum mass designs.
486     </para>
487     <para>
488       For most airframes, the integrated GPS antenna and wire UHF antenna are
489       a great combination.  However, if you are installing in a carbon-fiber
490       electronics bay which is opaque to RF signals, you may need to use
491       off-board external antennas instead.  In this case, you can order
492       TeleMetrum with an SMA connector for the UHF antenna connection, and
493       you can unplug the integrated GPS antenna and select an appropriate
494       off-board GPS antenna with cable terminating in a U.FL connector.
495     </para>
496   </chapter>
497   <chapter>
498     <title>System Operation</title>
499     <section>
500       <title>Firmware Modes </title>
501       <para>
502         The AltOS firmware build for TeleMetrum has two fundamental modes,
503         "idle" and "flight".  Which of these modes the firmware operates in
504         is determined by the orientation of the rocket (well, actually the
505         board, of course...) at the time power is switched on.  If the rocket
506         is "nose up", then TeleMetrum assumes it's on a rail or rod being
507         prepared for launch, so the firmware chooses flight mode.  However,
508         if the rocket is more or less horizontal, the firmware instead enters
509         idle mode.
510       </para>
511       <para>
512         At power on, you will hear three beeps
513         ("S" in Morse code for startup) and then a pause while
514         TeleMetrum completes initialization and self tests, and decides which
515         mode to enter next.
516       </para>
517       <para>
518         In flight or "pad" mode, TeleMetrum turns on the GPS system,
519         engages the flight
520         state machine, goes into transmit-only mode on the RF link sending
521         telemetry, and waits for launch to be detected.  Flight mode is
522         indicated by an audible "di-dah-dah-dit" ("P" for pad) on the
523         beeper, followed by
524         beeps indicating the state of the pyrotechnic igniter continuity.
525         One beep indicates apogee continuity, two beeps indicate
526         main continuity, three beeps indicate both apogee and main continuity,
527         and one longer "brap" sound indicates no continuity.  For a dual
528         deploy flight, make sure you're getting three beeps before launching!
529         For apogee-only or motor eject flights, do what makes sense.
530       </para>
531       <para>
532         In idle mode, you will hear an audible "di-dit" ("I" for idle), and
533         the normal flight state machine is disengaged, thus
534         no ejection charges will fire.  TeleMetrum also listens on the RF
535         link when in idle mode for packet mode requests sent from TeleDongle.
536         Commands can be issued to a TeleMetrum in idle mode over either
537         USB or the RF link equivalently.
538         Idle mode is useful for configuring TeleMetrum, for extracting data
539         from the on-board storage chip after flight, and for ground testing
540         pyro charges.
541       </para>
542       <para>
543         One "neat trick" of particular value when TeleMetrum is used with very
544         large airframes, is that you can power the board up while the rocket
545         is horizontal, such that it comes up in idle mode.  Then you can
546         raise the airframe to launch position, use a TeleDongle to open
547         a packet connection, and issue a 'reset' command which will cause
548         TeleMetrum to reboot, realize it's now nose-up, and thus choose
549         flight mode.  This is much safer than standing on the top step of a
550         rickety step-ladder or hanging off the side of a launch tower with
551         a screw-driver trying to turn on your avionics before installing
552         igniters!
553       </para>
554     </section>
555     <section>
556       <title>GPS </title>
557       <para>
558         TeleMetrum includes a complete GPS receiver.  See a later section for
559         a brief explanation of how GPS works that will help you understand
560         the information in the telemetry stream.  The bottom line is that
561         the TeleMetrum GPS receiver needs to lock onto at least four
562         satellites to obtain a solid 3 dimensional position fix and know
563         what time it is!
564       </para>
565       <para>
566         TeleMetrum provides backup power to the GPS chip any time a LiPo
567         battery is connected.  This allows the receiver to "warm start" on
568         the launch rail much faster than if every power-on were a "cold start"
569         for the GPS receiver.  In typical operations, powering up TeleMetrum
570         on the flight line in idle mode while performing final airframe
571         preparation will be sufficient to allow the GPS receiver to cold
572         start and acquire lock.  Then the board can be powered down during
573         RSO review and installation on a launch rod or rail.  When the board
574         is turned back on, the GPS system should lock very quickly, typically
575         long before igniter installation and return to the flight line are
576         complete.
577       </para>
578     </section>
579     <section>
580       <title>Ground Testing </title>
581       <para>
582         An important aspect of preparing a rocket using electronic deployment
583         for flight is ground testing the recovery system.  Thanks
584         to the bi-directional RF link central to the Altus Metrum system,
585         this can be accomplished in a TeleMetrum-equipped rocket without as
586         much work as you may be accustomed to with other systems.  It can
587         even be fun!
588       </para>
589       <para>
590         Just prep the rocket for flight, then power up TeleMetrum while the
591         airframe is horizontal.  This will cause the firmware to go into
592         "idle" mode, in which the normal flight state machine is disabled and
593         charges will not fire without manual command.  Then, establish an
594         RF packet connection from a TeleDongle-equipped computer using the
595         P command from a safe distance.  You can now command TeleMetrum to
596         fire the apogee or main charges to complete your testing.
597       </para>
598       <para>
599         In order to reduce the chance of accidental firing of pyrotechnic
600         charges, the command to fire a charge is intentionally somewhat
601         difficult to type, and the built-in help is slightly cryptic to
602         prevent accidental echoing of characters from the help text back at
603         the board from firing a charge.  The command to fire the apogee
604         drogue charge is 'i DoIt drogue' and the command to fire the main
605         charge is 'i DoIt main'.
606       </para>
607     </section>
608     <section>
609       <title>Radio Link </title>
610       <para>
611         The chip our boards are based on incorporates an RF transceiver, but
612         it's not a full duplex system... each end can only be transmitting or
613         receiving at any given moment.  So we had to decide how to manage the
614         link.
615       </para>
616       <para>
617         By design, TeleMetrum firmware listens for an RF connection when
618         it's in "idle mode" (turned on while the rocket is horizontal), which
619         allows us to use the RF link to configure the rocket, do things like
620         ejection tests, and extract data after a flight without having to
621         crack open the airframe.  However, when the board is in "flight
622         mode" (turned on when the rocket is vertical) the TeleMetrum only
623         transmits and doesn't listen at all.  That's because we want to put
624         ultimate priority on event detection and getting telemetry out of
625         the rocket and out over
626         the RF link in case the rocket crashes and we aren't able to extract
627         data later...
628       </para>
629       <para>
630         We don't use a 'normal packet radio' mode because they're just too
631         inefficient.  The GFSK modulation we use is just FSK with the
632         baseband pulses passed through a
633         Gaussian filter before they go into the modulator to limit the
634         transmitted bandwidth.  When combined with the hardware forward error
635         correction support in the cc1111 chip, this allows us to have a very
636         robust 38.4 kilobit data link with only 10 milliwatts of transmit power,
637         a whip antenna in the rocket, and a hand-held Yagi on the ground.  We've
638         had flights to above 21k feet AGL with good reception, and calculations
639         suggest we should be good to well over 40k feet AGL with a 5-element yagi on
640         the ground.  We hope to fly boards to higher altitudes soon, and would
641         of course appreciate customer feedback on performance in higher
642         altitude flights!
643       </para>
644     </section>
645     <section>
646       <title>Configurable Parameters</title>
647       <para>
648         Configuring a TeleMetrum board for flight is very simple.  Because we
649         have both acceleration and pressure sensors, there is no need to set
650         a "mach delay", for example.  The few configurable parameters can all
651         be set using a simple terminal program over the USB port or RF link
652         via TeleDongle.
653       </para>
654       <section>
655         <title>Radio Channel</title>
656         <para>
657           Our firmware supports 10 channels.  The default channel 0 corresponds
658           to a center frequency of 434.550 Mhz, and channels are spaced every
659           100 khz.  Thus, channel 1 is 434.650 Mhz, and channel 9 is 435.550 Mhz.
660           At any given launch, we highly recommend coordinating who will use
661           each channel and when to avoid interference.  And of course, both
662           TeleMetrum and TeleDongle must be configured to the same channel to
663           successfully communicate with each other.
664         </para>
665         <para>
666           To set the radio channel, use the 'c r' command, like 'c r 3' to set
667           channel 3.
668           As with all 'c' sub-commands, follow this with a 'c w' to write the
669           change to the parameter block in the on-board DataFlash chip on
670           your TeleMetrum board if you want the change to stay in place across reboots.
671         </para>
672       </section>
673       <section>
674         <title>Apogee Delay</title>
675         <para>
676           Apogee delay is the number of seconds after TeleMetrum detects flight
677           apogee that the drogue charge should be fired.  In most cases, this
678           should be left at the default of 0.  However, if you are flying
679           redundant electronics such as for an L3 certification, you may wish
680           to set one of your altimeters to a positive delay so that both
681           primary and backup pyrotechnic charges do not fire simultaneously.
682         </para>
683         <para>
684           To set the apogee delay, use the 'c d' command.
685           As with all 'c' sub-commands, follow this with a 'c w' to write the
686           change to the parameter block in the on-board DataFlash chip.
687         </para>
688         <para>
689           Please note that the TeleMetrum apogee detection algorithm always
690           fires a fraction of a second *after* apogee.  If you are also flying
691           an altimeter like the PerfectFlite MAWD, which only supports selecting
692           0 or 1 seconds of apogee delay, you may wish to set the MAWD to 0
693           seconds delay and set the TeleMetrum to fire your backup 2 or 3
694           seconds later to avoid any chance of both charges firing
695           simultaneously.  We've flown several airframes this way quite happily,
696           including Keith's successful L3 cert.
697         </para>
698       </section>
699       <section>
700         <title>Main Deployment Altitude</title>
701         <para>
702           By default, TeleMetrum will fire the main deployment charge at an
703           elevation of 250 meters (about 820 feet) above ground.  We think this
704           is a good elevation for most airframes, but feel free to change this
705           to suit.  In particular, if you are flying two altimeters, you may
706           wish to set the
707           deployment elevation for the backup altimeter to be something lower
708           than the primary so that both pyrotechnic charges don't fire
709           simultaneously.
710         </para>
711         <para>
712           To set the main deployment altitude, use the 'c m' command.
713           As with all 'c' sub-commands, follow this with a 'c w' to write the
714           change to the parameter block in the on-board DataFlash chip.
715         </para>
716       </section>
717     </section>
718     <section>
719       <title>Calibration</title>
720       <para>
721         There are only two calibrations required for a TeleMetrum board, and
722         only one for TeleDongle.
723       </para>
724       <section>
725         <title>Radio Frequency</title>
726         <para>
727           The radio frequency is synthesized from a clock based on the 48 Mhz
728           crystal on the board.  The actual frequency of this oscillator must be
729           measured to generate a calibration constant.  While our GFSK modulation
730           bandwidth is wide enough to allow boards to communicate even when
731           their oscillators are not on exactly the same frequency, performance
732           is best when they are closely matched.
733           Radio frequency calibration requires a calibrated frequency counter.
734           Fortunately, once set, the variation in frequency due to aging and
735           temperature changes is small enough that re-calibration by customers
736           should generally not be required.
737         </para>
738         <para>
739           To calibrate the radio frequency, connect the UHF antenna port to a
740           frequency counter, set the board to channel 0, and use the 'C'
741           command to generate a CW carrier.  Wait for the transmitter temperature
742           to stabilize and the frequency to settle down.
743           Then, divide 434.550 Mhz by the
744           measured frequency and multiply by the current radio cal value show
745           in the 'c s' command.  For an unprogrammed board, the default value
746           is 1186611.  Take the resulting integer and program it using the 'c f'
747           command.  Testing with the 'C' command again should show a carrier
748           within a few tens of Hertz of the intended frequency.
749           As with all 'c' sub-commands, follow this with a 'c w' to write the
750           change to the parameter block in the on-board DataFlash chip.
751         </para>
752       </section>
753       <section>
754         <title>Accelerometer</title>
755         <para>
756           The accelerometer we use has its own 5 volt power supply and
757           the output must be passed through a resistive voltage divider to match
758           the input of our 3.3 volt ADC.  This means that unlike the barometric
759           sensor, the output of the acceleration sensor is not ratiometric to
760           the ADC converter, and calibration is required.  We also support the
761           use of any of several accelerometers from a Freescale family that
762           includes at least +/- 40g, 50g, 100g, and 200g parts.  Using gravity,
763           a simple 2-point calibration yields acceptable results capturing both
764           the different sensitivities and ranges of the different accelerometer
765           parts and any variation in power supply voltages or resistor values
766           in the divider network.
767         </para>
768         <para>
769           To calibrate the acceleration sensor, use the 'c a 0' command.  You
770           will be prompted to orient the board vertically with the UHF antenna
771           up and press a key, then to orient the board vertically with the
772           UHF antenna down and press a key.
773           As with all 'c' sub-commands, follow this with a 'c w' to write the
774           change to the parameter block in the on-board DataFlash chip.
775         </para>
776         <para>
777           The +1g and -1g calibration points are included in each telemetry
778           frame and are part of the header extracted by ao-dumplog after flight.
779           Note that we always store and return raw ADC samples for each
780           sensor... nothing is permanently "lost" or "damaged" if the
781           calibration is poor.
782         </para>
783         <para>
784          In the unlikely event an accel cal that goes badly, it is possible
785          that TeleMetrum may always come up in 'pad mode' and as such not be
786          listening to either the USB or radio interfaces.  If that happens,
787          there is a special hook in the firmware to force the board back
788          in to 'idle mode' so you can re-do the cal.  To use this hook, you
789          just need to ground the SPI clock pin at power-on.  This pin is
790          available as pin 2 on the 8-pin companion connector, and pin 1 is
791          ground.  So either carefully install a fine-gauge wire jumper
792          between the two pins closest to the index hole end of the 8-pin
793          connector, or plug in the programming cable to the 8-pin connector
794          and use a small screwdriver or similar to short the two pins closest
795          to the index post on the 4-pin end of the programming cable, and
796          power up the board.  It should come up in 'idle mode' (two beeps).
797         </para>
798       </section>
799     </section>
800
801
802
803   <section>
804     <title>Updating Device Firmware</title>
805     <para>
806       The big conceptual thing to realize is that you have to use a
807       TeleDongle as a programmer to update a TeleMetrum, and vice versa.
808       Due to limited memory resources in the cc1111, we don't support
809       programming either unit directly over USB.
810     </para>
811     <para>
812       You may wish to begin by ensuring you have current firmware images.
813       These are distributed as part of the AltOS software bundle that
814       also includes the AltosUI ground station program.  Newer ground
815       station versions typically work fine with older firmware versions,
816       so you don't need to update your devices just to try out new
817       software features.  You can always download the most recent
818       version from <ulink url="http://www.altusmetrum.org/AltOS/"/>.
819     </para>
820     <para>
821       We recommend updating TeleMetrum first, before updating TeleDongle.
822     </para>
823     <section>
824       <title>Updating TeleMetrum Firmware</title>
825       <orderedlist inheritnum='inherit' numeration='arabic'>
826         <listitem>
827           Find the 'programming cable' that you got as part of the starter
828           kit, that has a red 8-pin MicroMaTch connector on one end and a
829           red 4-pin MicroMaTch connector on the other end.
830         </listitem>
831         <listitem>
832           Take the 2 screws out of the TeleDongle case to get access
833           to the circuit board.
834         </listitem>
835         <listitem>
836           Plug the 8-pin end of the programming cable to the
837           matching connector on the TeleDongle, and the 4-pin end to the
838           matching connector on the TeleMetrum.
839           Note that each MicroMaTch connector has an alignment pin that
840           goes through a hole in the PC board when you have the cable
841           oriented correctly.
842         </listitem>
843         <listitem>
844           Attach a battery to the TeleMetrum board.
845         </listitem>
846         <listitem>
847           Plug the TeleDongle into your computer's USB port, and power
848           up the TeleMetrum.
849         </listitem>
850         <listitem>
851           Run AltosUI, and select 'Flash Image' from the File menu.
852         </listitem>
853         <listitem>
854           Pick the TeleDongle device from the list, identifying it as the
855           programming device.
856         </listitem>
857         <listitem>
858           Select the image you want put on the TeleMetrum, which should have a
859           name in the form telemetrum-v1.0-0.7.1.ihx.  It should be visible
860         in the default directory, if not you may have to poke around
861         your system to find it.
862         </listitem>
863         <listitem>
864           Make sure the configuration parameters are reasonable
865           looking. If the serial number and/or RF configuration
866           values aren't right, you'll need to change them.
867         </listitem>
868         <listitem>
869           Hit the 'OK' button and the software should proceed to flash
870           the TeleMetrum with new firmware, showing a progress bar.
871         </listitem>
872         <listitem>
873           Confirm that the TeleMetrum board seems to have updated ok, which you
874           can do by plugging in to it over USB and using a terminal program
875           to connect to the board and issue the 'v' command to check
876           the version, etc.
877         </listitem>
878         <listitem>
879           If something goes wrong, give it another try.
880         </listitem>
881       </orderedlist>
882     </section>
883     <section>
884       <title>Updating TeleDongle Firmware</title>
885       <para>
886         Updating TeleDongle's firmware is just like updating TeleMetrum
887         firmware, but you switch which board is the programmer and which
888         is the programming target.
889         </para>
890       <orderedlist inheritnum='inherit' numeration='arabic'>
891         <listitem>
892           Find the 'programming cable' that you got as part of the starter
893           kit, that has a red 8-pin MicroMaTch connector on one end and a
894           red 4-pin MicroMaTch connector on the other end.
895         </listitem>
896         <listitem>
897           Find the USB cable that you got as part of the starter kit, and
898           plug the "mini" end in to the mating connector on TeleMetrum.
899         </listitem>
900         <listitem>
901           Take the 2 screws out of the TeleDongle case to get access
902           to the circuit board.
903         </listitem>
904         <listitem>
905           Plug the 8-pin end of the programming cable to the (latching)
906           matching connector on the TeleMetrum, and the 4-pin end to the
907           matching connector on the TeleDongle.
908           Note that each MicroMaTch connector has an alignment pin that
909           goes through a hole in the PC board when you have the cable
910           oriented correctly.
911         </listitem>
912         <listitem>
913           Attach a battery to the TeleMetrum board.
914         </listitem>
915         <listitem>
916           Plug both TeleMetrum and TeleDongle into your computer's USB
917           ports, and power up the TeleMetrum.
918         </listitem>
919         <listitem>
920           Run AltosUI, and select 'Flash Image' from the File menu.
921         </listitem>
922         <listitem>
923           Pick the TeleMetrum device from the list, identifying it as the
924           programming device.
925         </listitem>
926         <listitem>
927           Select the image you want put on the TeleDongle, which should have a
928           name in the form teledongle-v0.2-0.7.1.ihx.  It should be visible
929         in the default directory, if not you may have to poke around
930         your system to find it.
931         </listitem>
932         <listitem>
933           Make sure the configuration parameters are reasonable
934           looking. If the serial number and/or RF configuration
935           values aren't right, you'll need to change them.  The TeleDongle
936           serial number is on the "bottom" of the circuit board, and can
937           usually be read through the translucent blue plastic case without
938           needing to remove the board from the case.
939         </listitem>
940         <listitem>
941           Hit the 'OK' button and the software should proceed to flash
942           the TeleDongle with new firmware, showing a progress bar.
943         </listitem>
944         <listitem>
945           Confirm that the TeleDongle board seems to have updated ok, which you
946           can do by plugging in to it over USB and using a terminal program
947           to connect to the board and issue the 'v' command to check
948           the version, etc.  Once you're happy, remove the programming cable
949           and put the cover back on the TeleDongle.
950         </listitem>
951         <listitem>
952           If something goes wrong, give it another try.
953         </listitem>
954       </orderedlist>
955       <para>
956         Be careful removing the programming cable from the locking 8-pin
957         connector on TeleMetrum.  You'll need a fingernail or perhaps a thin
958         screwdriver or knife blade to gently pry the locking ears out
959         slightly to extract the connector.  We used a locking connector on
960         TeleMetrum to help ensure that the cabling to companion boards
961         used in a rocket don't ever come loose accidentally in flight.
962       </para>
963     </section>
964   </section>
965
966
967
968   </chapter>
969   <chapter>
970
971     <title>AltosUI</title>
972     <para>
973       The AltosUI program provides a graphical user interface for
974       interacting with the Altus Metrum product family, including
975       TeleMetrum and TeleDongle. AltosUI can monitor telemetry data,
976       configure TeleMetrum and TeleDongle devices and many other
977       tasks. The primary interface window provides a selection of
978       buttons, one for each major activity in the system.  This manual
979       is split into chapters, each of which documents one of the tasks
980       provided from the top-level toolbar.
981     </para>
982     <section>
983       <title>Packet Command Mode</title>
984       <subtitle>Controlling TeleMetrum Over The Radio Link</subtitle>
985       <para>
986         One of the unique features of the Altus Metrum environment is
987         the ability to create a two way command link between TeleDongle
988         and TeleMetrum using the digital radio transceivers built into
989         each device. This allows you to interact with TeleMetrum from
990         afar, as if it were directly connected to the computer.
991       </para>
992       <para>
993         Any operation which can be performed with TeleMetrum
994         can either be done with TeleMetrum directly connected to
995         the computer via the USB cable, or through the packet
996         link. Simply select the appropriate TeleDongle device when
997         the list of devices is presented and AltosUI will use packet
998         command mode.
999       </para>
1000       <para>
1001         One oddity in the current interface is how AltosUI selects the
1002         channel for packet mode communications. Instead of providing
1003         an interface to specifically configure the channel, it uses
1004         whatever channel was most recently selected for the target
1005         TeleDongle device in Monitor Flight mode. If you haven't ever
1006         used that mode with the TeleDongle in question, select the
1007         Monitor Flight button from the top level UI, pick the
1008         appropriate TeleDongle device. Once the flight monitoring
1009         window is open, select the desired channel and then close it
1010         down again. All Packet Command Mode operations will now use
1011         that channel.
1012       </para>
1013       <itemizedlist>
1014         <listitem>
1015           <para>
1016             Save Flight Data—Recover flight data from the rocket without
1017             opening it up.
1018           </para>
1019         </listitem>
1020         <listitem>
1021           <para>
1022             Configure TeleMetrum—Reset apogee delays or main deploy
1023             heights to respond to changing launch conditions. You can
1024             also 'reboot' the TeleMetrum device. Use this to remotely
1025             enable the flight computer by turning TeleMetrum on while
1026             horizontal, then once the airframe is oriented for launch,
1027             you can reboot TeleMetrum and have it restart in pad mode
1028             without having to climb the scary ladder.
1029           </para>
1030         </listitem>
1031         <listitem>
1032           <para>
1033             Fire Igniters—Test your deployment charges without snaking
1034             wires out through holes in the airframe. Simply assembly the
1035             rocket as if for flight with the apogee and main charges
1036             loaded, then remotely command TeleMetrum to fire the
1037             igniters.
1038           </para>
1039         </listitem>
1040       </itemizedlist>
1041       <para>
1042         Packet command mode uses the same RF channels as telemetry
1043         mode. Configure the desired TeleDongle channel using the
1044         flight monitor window channel selector and then close that
1045         window before performing the desired operation.
1046       </para>
1047       <para>
1048         TeleMetrum only enables packet command mode in 'idle' mode, so
1049         make sure you have TeleMetrum lying horizontally when you turn
1050         it on. Otherwise, TeleMetrum will start in 'pad' mode ready for
1051         flight and will not be listening for command packets from TeleDongle.
1052       </para>
1053       <para>
1054         When packet command mode is enabled, you can monitor the link
1055         by watching the lights on the TeleDongle and TeleMetrum
1056         devices. The red LED will flash each time TeleDongle or
1057         TeleMetrum transmit a packet while the green LED will light up
1058         on TeleDongle while it is waiting to receive a packet from
1059         TeleMetrum.
1060       </para>
1061     </section>
1062     <section>
1063       <title>Monitor Flight</title>
1064       <subtitle>Receive, Record and Display Telemetry Data</subtitle>
1065       <para>
1066         Selecting this item brings up a dialog box listing all of the
1067         connected TeleDongle devices. When you choose one of these,
1068         AltosUI will create a window to display telemetry data as
1069         received by the selected TeleDongle device.
1070       </para>
1071       <para>
1072         All telemetry data received are automatically recorded in
1073         suitable log files. The name of the files includes the current
1074         date and rocket serial and flight numbers.
1075       </para>
1076       <para>
1077         The radio channel being monitored by the TeleDongle device is
1078         displayed at the top of the window. You can configure the
1079         channel by clicking on the channel box and selecting the desired
1080         channel. AltosUI remembers the last channel selected for each
1081         TeleDongle and selects that automatically the next time you use
1082         that device.
1083       </para>
1084       <para>
1085         Below the TeleDongle channel selector, the window contains a few
1086         significant pieces of information about the TeleMetrum providing
1087         the telemetry data stream:
1088       </para>
1089       <itemizedlist>
1090         <listitem>
1091           <para>The TeleMetrum callsign</para>
1092         </listitem>
1093         <listitem>
1094           <para>The TeleMetrum serial number</para>
1095         </listitem>
1096         <listitem>
1097           <para>The flight number. Each TeleMetrum remembers how many
1098             times it has flown.
1099           </para>
1100         </listitem>
1101         <listitem>
1102           <para>
1103             The rocket flight state. Each flight passes through several
1104             states including Pad, Boost, Fast, Coast, Drogue, Main and
1105             Landed.
1106           </para>
1107         </listitem>
1108         <listitem>
1109           <para>
1110             The Received Signal Strength Indicator value. This lets
1111             you know how strong a signal TeleDongle is receiving. The
1112             radio inside TeleDongle operates down to about -99dBm;
1113             weaker signals may not be receiveable. The packet link uses
1114             error correction and detection techniques which prevent
1115             incorrect data from being reported.
1116           </para>
1117         </listitem>
1118       </itemizedlist>
1119       <para>
1120         Finally, the largest portion of the window contains a set of
1121         tabs, each of which contain some information about the rocket.
1122         They're arranged in 'flight order' so that as the flight
1123         progresses, the selected tab automatically switches to display
1124         data relevant to the current state of the flight. You can select
1125         other tabs at any time. The final 'table' tab contains all of
1126         the telemetry data in one place.
1127       </para>
1128       <section>
1129         <title>Launch Pad</title>
1130         <para>
1131           The 'Launch Pad' tab shows information used to decide when the
1132           rocket is ready for flight. The first elements include red/green
1133           indicators, if any of these is red, you'll want to evaluate
1134           whether the rocket is ready to launch:
1135           <itemizedlist>
1136             <listitem>
1137               <para>
1138                 Battery Voltage. This indicates whether the LiPo battery
1139                 powering the TeleMetrum has sufficient charge to last for
1140                 the duration of the flight. A value of more than
1141                 3.7V is required for a 'GO' status.
1142               </para>
1143             </listitem>
1144             <listitem>
1145               <para>
1146                 Apogee Igniter Voltage. This indicates whether the apogee
1147                 igniter has continuity. If the igniter has a low
1148                 resistance, then the voltage measured here will be close
1149                 to the LiPo battery voltage. A value greater than 3.2V is
1150                 required for a 'GO' status.
1151               </para>
1152             </listitem>
1153             <listitem>
1154               <para>
1155                 Main Igniter Voltage. This indicates whether the main
1156                 igniter has continuity. If the igniter has a low
1157                 resistance, then the voltage measured here will be close
1158                 to the LiPo battery voltage. A value greater than 3.2V is
1159                 required for a 'GO' status.
1160               </para>
1161             </listitem>
1162             <listitem>
1163               <para>
1164                 GPS Locked. This indicates whether the GPS receiver is
1165                 currently able to compute position information. GPS requires
1166                 at least 4 satellites to compute an accurate position.
1167               </para>
1168             </listitem>
1169             <listitem>
1170               <para>
1171                 GPS Ready. This indicates whether GPS has reported at least
1172                 10 consecutive positions without losing lock. This ensures
1173                 that the GPS receiver has reliable reception from the
1174                 satellites.
1175               </para>
1176             </listitem>
1177           </itemizedlist>
1178           <para>
1179             The LaunchPad tab also shows the computed launch pad position
1180             and altitude, averaging many reported positions to improve the
1181             accuracy of the fix.
1182           </para>
1183         </para>
1184       </section>
1185       <section>
1186         <title>Ascent</title>
1187         <para>
1188           This tab is shown during Boost, Fast and Coast
1189           phases. The information displayed here helps monitor the
1190           rocket as it heads towards apogee.
1191         </para>
1192         <para>
1193           The height, speed and acceleration are shown along with the
1194           maxium values for each of them. This allows you to quickly
1195           answer the most commonly asked questions you'll hear during
1196           flight.
1197         </para>
1198         <para>
1199           The current latitude and longitude reported by the GPS are
1200           also shown. Note that under high acceleration, these values
1201           may not get updated as the GPS receiver loses position
1202           fix. Once the rocket starts coasting, the receiver should
1203           start reporting position again.
1204         </para>
1205         <para>
1206           Finally, the current igniter voltages are reported as in the
1207           Launch Pad tab. This can help diagnose deployment failures
1208           caused by wiring which comes loose under high acceleration.
1209         </para>
1210       </section>
1211       <section>
1212         <title>Descent</title>
1213         <para>
1214           Once the rocket has reached apogee and (we hope) activated the
1215           apogee charge, attention switches to tracking the rocket on
1216           the way back to the ground, and for dual-deploy flights,
1217           waiting for the main charge to fire.
1218         </para>
1219         <para>
1220           To monitor whether the apogee charge operated correctly, the
1221           current descent rate is reported along with the current
1222           height. Good descent rates generally range from 15-30m/s.
1223         </para>
1224         <para>
1225           To help locate the rocket in the sky, use the elevation and
1226           bearing information to figure out where to look. Elevation is
1227           in degrees above the horizon. Bearing is reported in degrees
1228           relative to true north. Range can help figure out how big the
1229           rocket will appear. Note that all of these values are relative
1230           to the pad location. If the elevation is near 90°, the rocket
1231           is over the pad, not over you.
1232         </para>
1233         <para>
1234           Finally, the igniter voltages are reported in this tab as
1235           well, both to monitor the main charge as well as to see what
1236           the status of the apogee charge is.
1237         </para>
1238       </section>
1239       <section>
1240         <title>Landed</title>
1241         <para>
1242           Once the rocket is on the ground, attention switches to
1243           recovery. While the radio signal is generally lost once the
1244           rocket is on the ground, the last reported GPS position is
1245           generally within a short distance of the actual landing location.
1246         </para>
1247         <para>
1248           The last reported GPS position is reported both by
1249           latitude and longitude as well as a bearing and distance from
1250           the launch pad. The distance should give you a good idea of
1251           whether you'll want to walk or hitch a ride. Take the reported
1252           latitude and longitude and enter them into your handheld GPS
1253           unit and have that compute a track to the landing location.
1254         </para>
1255         <para>
1256           Finally, the maximum height, speed and acceleration reported
1257           during the flight are displayed for your admiring observers.
1258         </para>
1259       </section>
1260       <section>
1261         <title>Site Map</title>
1262         <para>
1263           When the rocket gets a GPS fix, the Site Map tab will map
1264           the rocket's position to make it easier for you to locate the
1265           rocket, both while it is in the air, and when it has landed. The
1266           rocket's state is indicated by colour: white for pad, red for
1267           boost, pink for fast, yellow for coast, light blue for drogue,
1268           dark blue for main, and black for landed.
1269         </para>
1270         <para>
1271           The map's scale is approximately 3m (10ft) per pixel. The map
1272           can be dragged using the left mouse button. The map will attempt
1273           to keep the rocket roughly centred while data is being received.
1274         </para>
1275         <para>
1276           Images are fetched automatically via the Google Maps Static API,
1277           and are cached for reuse. If map images cannot be downloaded,
1278           the rocket's path will be traced on a dark grey background
1279           instead.
1280         </para>
1281       </section>
1282     </section>
1283     <section>
1284       <title>Save Flight Data</title>
1285       <para>
1286         TeleMetrum records flight data to its internal flash memory.
1287         This data is recorded at a much higher rate than the telemetry
1288         system can handle, and is not subject to radio drop-outs. As
1289         such, it provides a more complete and precise record of the
1290         flight. The 'Save Flight Data' button allows you to read the
1291         flash memory and write it to disk.
1292       </para>
1293       <para>
1294         Clicking on the 'Save Flight Data' button brings up a list of
1295         connected TeleMetrum and TeleDongle devices. If you select a
1296         TeleMetrum device, the flight data will be downloaded from that
1297         device directly. If you select a TeleDongle device, flight data
1298         will be downloaded from a TeleMetrum device connected via the
1299         packet command link to the specified TeleDongle. See the chapter
1300         on Packet Command Mode for more information about this.
1301       </para>
1302       <para>
1303         After the device has been selected, a dialog showing the
1304         flight data saved in the device will be shown allowing you to
1305         select which flights to download and which to delete. With
1306         version 0.9 or newer firmware, you must erase flights in order
1307         for the space they consume to be reused by another
1308         flight. This prevents you from accidentally losing flight data
1309         if you neglect to download data before flying again. Note that
1310         if there is no more space available in the device, then no
1311         data will be recorded for a flight.
1312       </para>
1313       <para>
1314         The filename for each flight log is computed automatically
1315         from the recorded flight date, TeleMetrum serial number and
1316         flight number information.
1317       </para>
1318     </section>
1319     <section>
1320       <title>Replay Flight</title>
1321       <para>
1322         Select this button and you are prompted to select a flight
1323         record file, either a .telem file recording telemetry data or a
1324         .eeprom file containing flight data saved from the TeleMetrum
1325         flash memory.
1326       </para>
1327       <para>
1328         Once a flight record is selected, the flight monitor interface
1329         is displayed and the flight is re-enacted in real time. Check
1330         the Monitor Flight chapter above to learn how this window operates.
1331       </para>
1332     </section>
1333     <section>
1334       <title>Graph Data</title>
1335       <para>
1336         Select this button and you are prompted to select a flight
1337         record file, either a .telem file recording telemetry data or a
1338         .eeprom file containing flight data saved from the TeleMetrum
1339         flash memory.
1340       </para>
1341       <para>
1342         Once a flight record is selected, the acceleration (blue),
1343         velocity (green) and altitude (red) of the flight are plotted and
1344         displayed, measured in metric units.
1345       </para>
1346       <para>
1347         The graph can be zoomed into a particular area by clicking and
1348         dragging down and to the right. Once zoomed, the graph can be
1349         reset by clicking and dragging up and to the left. Holding down
1350         control and clicking and dragging allows the graph to be panned.
1351         The right mouse button causes a popup menu to be displayed, giving
1352         you the option save or print the plot.
1353       </para>
1354       <para>
1355         Note that telemetry files will generally produce poor graphs
1356         due to the lower sampling rate and missed telemetry packets,
1357         and will also often have significant amounts of data received
1358         while the rocket was waiting on the pad. Use saved flight data
1359         for graphing where possible.
1360       </para>
1361     </section>
1362     <section>
1363       <title>Export Data</title>
1364       <para>
1365         This tool takes the raw data files and makes them available for
1366         external analysis. When you select this button, you are prompted to select a flight
1367         data file (either .eeprom or .telem will do, remember that
1368         .eeprom files contain higher resolution and more continuous
1369         data). Next, a second dialog appears which is used to select
1370         where to write the resulting file. It has a selector to choose
1371         between CSV and KML file formats.
1372       </para>
1373       <section>
1374         <title>Comma Separated Value Format</title>
1375         <para>
1376           This is a text file containing the data in a form suitable for
1377           import into a spreadsheet or other external data analysis
1378           tool. The first few lines of the file contain the version and
1379           configuration information from the TeleMetrum device, then
1380           there is a single header line which labels all of the
1381           fields. All of these lines start with a '#' character which
1382           most tools can be configured to skip over.
1383         </para>
1384         <para>
1385           The remaining lines of the file contain the data, with each
1386           field separated by a comma and at least one space. All of
1387           the sensor values are converted to standard units, with the
1388           barometric data reported in both pressure, altitude and
1389           height above pad units.
1390         </para>
1391       </section>
1392       <section>
1393         <title>Keyhole Markup Language (for Google Earth)</title>
1394         <para>
1395           This is the format used by
1396           Googleearth to provide an overlay within that
1397           application. With this, you can use Googleearth to see the
1398           whole flight path in 3D.
1399         </para>
1400       </section>
1401     </section>
1402     <section>
1403       <title>Configure TeleMetrum</title>
1404       <para>
1405         Select this button and then select either a TeleMetrum or
1406         TeleDongle Device from the list provided. Selecting a TeleDongle
1407         device will use Packet Comamnd Mode to configure remote
1408         TeleMetrum device. Learn how to use this in the Packet Command
1409         Mode chapter.
1410       </para>
1411       <para>
1412         The first few lines of the dialog provide information about the
1413         connected TeleMetrum device, including the product name,
1414         software version and hardware serial number. Below that are the
1415         individual configuration entries.
1416       </para>
1417       <para>
1418         At the bottom of the dialog, there are four buttons:
1419       </para>
1420       <itemizedlist>
1421         <listitem>
1422           <para>
1423             Save. This writes any changes to the TeleMetrum
1424             configuration parameter block in flash memory. If you don't
1425             press this button, any changes you make will be lost.
1426           </para>
1427         </listitem>
1428         <listitem>
1429           <para>
1430             Reset. This resets the dialog to the most recently saved values,
1431             erasing any changes you have made.
1432           </para>
1433         </listitem>
1434         <listitem>
1435           <para>
1436             Reboot. This reboots the TeleMetrum device. Use this to
1437             switch from idle to pad mode by rebooting once the rocket is
1438             oriented for flight.
1439           </para>
1440         </listitem>
1441         <listitem>
1442           <para>
1443             Close. This closes the dialog. Any unsaved changes will be
1444             lost.
1445           </para>
1446         </listitem>
1447       </itemizedlist>
1448       <para>
1449         The rest of the dialog contains the parameters to be configured.
1450       </para>
1451       <section>
1452         <title>Main Deploy Altitude</title>
1453         <para>
1454           This sets the altitude (above the recorded pad altitude) at
1455           which the 'main' igniter will fire. The drop-down menu shows
1456           some common values, but you can edit the text directly and
1457           choose whatever you like. If the apogee charge fires below
1458           this altitude, then the main charge will fire two seconds
1459           after the apogee charge fires.
1460         </para>
1461       </section>
1462       <section>
1463         <title>Apogee Delay</title>
1464         <para>
1465           When flying redundant electronics, it's often important to
1466           ensure that multiple apogee charges don't fire at precisely
1467           the same time as that can overpressurize the apogee deployment
1468           bay and cause a structural failure of the airframe. The Apogee
1469           Delay parameter tells the flight computer to fire the apogee
1470           charge a certain number of seconds after apogee has been
1471           detected.
1472         </para>
1473       </section>
1474       <section>
1475         <title>Radio Channel</title>
1476         <para>
1477           This configures which of the 10 radio channels to use for both
1478           telemetry and packet command mode. Note that if you set this
1479           value via packet command mode, you will have to reconfigure
1480           the TeleDongle channel before you will be able to use packet
1481           command mode again.
1482         </para>
1483       </section>
1484       <section>
1485         <title>Radio Calibration</title>
1486         <para>
1487           The radios in every Altus Metrum device are calibrated at the
1488           factory to ensure that they transmit and receive on the
1489           specified frequency for each channel. You can adjust that
1490           calibration by changing this value. To change the TeleDongle's
1491           calibration, you must reprogram the unit completely.
1492         </para>
1493       </section>
1494       <section>
1495         <title>Callsign</title>
1496         <para>
1497           This sets the callsign included in each telemetry packet. Set this
1498           as needed to conform to your local radio regulations.
1499         </para>
1500       </section>
1501       <section>
1502         <title>Maximum Flight Log Size</title>
1503         <para>
1504           This sets the space (in kilobytes) allocated for each flight
1505           log. The available space will be divided into chunks of this
1506           size. A smaller value will allow more flights to be stored,
1507           a larger value will record data from longer flights.
1508         </para>
1509         <para>
1510           During ascent, TeleMetrum records barometer and
1511           accelerometer values 100 times per second, other analog
1512           information (voltages and temperature) 6 times per second
1513           and GPS data once per second. During descent, the non-GPS
1514           data is recorded 1/10th as often. Each barometer +
1515           accelerometer record takes 8 bytes.
1516         </para>
1517         <para>
1518           The default, 192kB, will store over 200 seconds of data at
1519           the ascent rate, or over 2000 seconds of data at the descent
1520           rate. That's plenty for most flights. This leaves enough
1521           storage for five flights in a 1MB system, or 10 flights in a
1522           2MB system.
1523         </para>
1524         <para>
1525           The configuration block takes the last available block of
1526           memory, on v1.0 boards that's just 256 bytes. However, the
1527           flash part on the v1.1 boards uses 64kB for each block.
1528         </para>
1529       </section>
1530     </section>
1531     <section>
1532       <title>Configure AltosUI</title>
1533       <para>
1534         This button presents a dialog so that you can configure the AltosUI global settings.
1535       </para>
1536       <section>
1537         <title>Voice Settings</title>
1538         <para>
1539           AltosUI provides voice annoucements during flight so that you
1540           can keep your eyes on the sky and still get information about
1541           the current flight status. However, sometimes you don't want
1542           to hear them.
1543         </para>
1544         <itemizedlist>
1545           <listitem>
1546             <para>Enable—turns all voice announcements on and off</para>
1547           </listitem>
1548           <listitem>
1549             <para>
1550               Test Voice—Plays a short message allowing you to verify
1551               that the audio systme is working and the volume settings
1552               are reasonable
1553             </para>
1554           </listitem>
1555         </itemizedlist>
1556       </section>
1557       <section>
1558         <title>Log Directory</title>
1559         <para>
1560           AltosUI logs all telemetry data and saves all TeleMetrum flash
1561           data to this directory. This directory is also used as the
1562           staring point when selecting data files for display or export.
1563         </para>
1564         <para>
1565           Click on the directory name to bring up a directory choosing
1566           dialog, select a new directory and click 'Select Directory' to
1567           change where AltosUI reads and writes data files.
1568         </para>
1569       </section>
1570       <section>
1571         <title>Callsign</title>
1572         <para>
1573           This value is used in command packet mode and is transmitted
1574           in each packet sent from TeleDongle and received from
1575           TeleMetrum. It is not used in telemetry mode as that transmits
1576           packets only from TeleMetrum to TeleDongle. Configure this
1577           with the AltosUI operators callsign as needed to comply with
1578           your local radio regulations.
1579         </para>
1580       </section>
1581       <section>
1582         <title>Serial Debug</title>
1583         <para>
1584           This causes all communication with a connected device to be
1585           dumped to the console from which AltosUI was started. If
1586           you've started it from an icon or menu entry, the output
1587           will simply be discarded. This mode can be useful to debug
1588           various serial communication issues.
1589         </para>
1590       </section>
1591     </section>
1592     <section>
1593       <title>Flash Image</title>
1594       <para>
1595         This reprograms any Altus Metrum device by using a TeleMetrum or
1596         TeleDongle as a programming dongle. Please read the directions
1597         for connecting the programming cable in the main TeleMetrum
1598         manual before reading these instructions.
1599       </para>
1600       <para>
1601         Once you have the programmer and target devices connected,
1602         push the 'Flash Image' button. That will present a dialog box
1603         listing all of the connected devices. Carefully select the
1604         programmer device, not the device to be programmed.
1605       </para>
1606       <para>
1607         Next, select the image to flash to the device. These are named
1608         with the product name and firmware version. The file selector
1609         will start in the directory containing the firmware included
1610         with the AltosUI package. Navigate to the directory containing
1611         the desired firmware if it isn't there.
1612       </para>
1613       <para>
1614         Next, a small dialog containing the device serial number and
1615         RF calibration values should appear. If these values are
1616         incorrect (possibly due to a corrupted image in the device),
1617         enter the correct values here.
1618       </para>
1619       <para>
1620         Finally, a dialog containing a progress bar will follow the
1621         programming process.
1622       </para>
1623       <para>
1624         When programming is complete, the target device will
1625         reboot. Note that if the target device is connected via USB, you
1626         will have to unplug it and then plug it back in for the USB
1627         connection to reset so that you can communicate with the device
1628         again.
1629       </para>
1630     </section>
1631     <section>
1632       <title>Fire Igniter</title>
1633       <para>
1634         This activates the igniter circuits in TeleMetrum to help test
1635         recovery systems deployment. Because this command can operate
1636         over the Packet Command Link, you can prepare the rocket as
1637         for flight and then test the recovery system without needing
1638         to snake wires inside the airframe.
1639       </para>
1640       <para>
1641         Selecting the 'Fire Igniter' button brings up the usual device
1642         selection dialog. Pick the desired TeleDongle or TeleMetrum
1643         device. This brings up another window which shows the current
1644         continutity test status for both apogee and main charges.
1645       </para>
1646       <para>
1647         Next, select the desired igniter to fire. This will enable the
1648         'Arm' button.
1649       </para>
1650       <para>
1651         Select the 'Arm' button. This enables the 'Fire' button. The
1652         word 'Arm' is replaced by a countdown timer indicating that
1653         you have 10 seconds to press the 'Fire' button or the system
1654         will deactivate, at which point you start over again at
1655         selecting the desired igniter.
1656       </para>
1657     </section>
1658   </chapter>
1659   <chapter>
1660     <title>Using Altus Metrum Products</title>
1661     <section>
1662       <title>Being Legal</title>
1663       <para>
1664         First off, in the US, you need an <ulink url="http://www.altusmetrum.org/Radio/">amateur radio license</ulink> or
1665         other authorization to legally operate the radio transmitters that are part
1666         of our products.
1667       </para>
1668       </section>
1669       <section>
1670         <title>In the Rocket</title>
1671         <para>
1672           In the rocket itself, you just need a <ulink url="http://www.altusmetrum.org/TeleMetrum/">TeleMetrum</ulink> board and
1673           a LiPo rechargeable battery.  An 860mAh battery weighs less than a 9V
1674           alkaline battery, and will run a <ulink url="http://www.altusmetrum.org/TeleMetrum/">TeleMetrum</ulink> for hours.
1675         </para>
1676         <para>
1677           By default, we ship TeleMetrum with a simple wire antenna.  If your
1678           electronics bay or the airframe it resides within is made of carbon fiber,
1679           which is opaque to RF signals, you may choose to have an SMA connector
1680           installed so that you can run a coaxial cable to an antenna mounted
1681           elsewhere in the rocket.
1682         </para>
1683       </section>
1684       <section>
1685         <title>On the Ground</title>
1686         <para>
1687           To receive the data stream from the rocket, you need an antenna and short
1688           feedline connected to one of our <ulink url="http://www.altusmetrum.org/TeleDongle/">TeleDongle</ulink> units.  The
1689           TeleDongle in turn plugs directly into the USB port on a notebook
1690           computer.  Because TeleDongle looks like a simple serial port, your computer
1691           does not require special device drivers... just plug it in.
1692         </para>
1693         <para>
1694           The GUI tool, AltosUI, is written in Java and runs across
1695           Linux, Mac OS and Windows. There's also a suite of C tools
1696           for Linux which can perform most of the same tasks.
1697         </para>
1698         <para>
1699           After the flight, you can use the RF link to extract the more detailed data
1700           logged in the rocket, or you can use a mini USB cable to plug into the
1701           TeleMetrum board directly.  Pulling out the data without having to open up
1702           the rocket is pretty cool!  A USB cable is also how you charge the LiPo
1703           battery, so you'll want one of those anyway... the same cable used by lots
1704           of digital cameras and other modern electronic stuff will work fine.
1705         </para>
1706         <para>
1707           If your rocket lands out of sight, you may enjoy having a hand-held GPS
1708           receiver, so that you can put in a waypoint for the last reported rocket
1709           position before touch-down.  This makes looking for your rocket a lot like
1710           Geo-Cacheing... just go to the waypoint and look around starting from there.
1711         </para>
1712         <para>
1713           You may also enjoy having a ham radio "HT" that covers the 70cm band... you
1714           can use that with your antenna to direction-find the rocket on the ground
1715           the same way you can use a Walston or Beeline tracker.  This can be handy
1716           if the rocket is hiding in sage brush or a tree, or if the last GPS position
1717           doesn't get you close enough because the rocket dropped into a canyon, or
1718           the wind is blowing it across a dry lake bed, or something like that...  Keith
1719           and Bdale both currently own and use the Yaesu VX-7R at launches.
1720         </para>
1721         <para>
1722           So, to recap, on the ground the hardware you'll need includes:
1723           <orderedlist inheritnum='inherit' numeration='arabic'>
1724             <listitem>
1725               an antenna and feedline
1726             </listitem>
1727             <listitem>
1728               a TeleDongle
1729             </listitem>
1730             <listitem>
1731               a notebook computer
1732             </listitem>
1733             <listitem>
1734               optionally, a handheld GPS receiver
1735             </listitem>
1736             <listitem>
1737               optionally, an HT or receiver covering 435 Mhz
1738             </listitem>
1739           </orderedlist>
1740         </para>
1741         <para>
1742           The best hand-held commercial directional antennas we've found for radio
1743           direction finding rockets are from
1744           <ulink url="http://www.arrowantennas.com/" >
1745             Arrow Antennas.
1746           </ulink>
1747           The 440-3 and 440-5 are both good choices for finding a
1748           TeleMetrum-equipped rocket when used with a suitable 70cm HT.
1749         </para>
1750       </section>
1751       <section>
1752         <title>Data Analysis</title>
1753         <para>
1754           Our software makes it easy to log the data from each flight, both the
1755           telemetry received over the RF link during the flight itself, and the more
1756           complete data log recorded in the DataFlash memory on the TeleMetrum
1757           board.  Once this data is on your computer, our postflight tools make it
1758           easy to quickly get to the numbers everyone wants, like apogee altitude,
1759           max acceleration, and max velocity.  You can also generate and view a
1760           standard set of plots showing the altitude, acceleration, and
1761           velocity of the rocket during flight.  And you can even export a data file
1762           useable with Google Maps and Google Earth for visualizing the flight path
1763           in two or three dimensions!
1764         </para>
1765         <para>
1766           Our ultimate goal is to emit a set of files for each flight that can be
1767           published as a web page per flight, or just viewed on your local disk with
1768           a web browser.
1769         </para>
1770       </section>
1771       <section>
1772         <title>Future Plans</title>
1773         <para>
1774           In the future, we intend to offer "companion boards" for the rocket that will
1775           plug in to TeleMetrum to collect additional data, provide more pyro channels,
1776           and so forth.  A reference design for a companion board will be documented
1777           soon, and will be compatible with open source Arduino programming tools.
1778         </para>
1779         <para>
1780           We are also working on the design of a hand-held ground terminal that will
1781           allow monitoring the rocket's status, collecting data during flight, and
1782           logging data after flight without the need for a notebook computer on the
1783           flight line.  Particularly since it is so difficult to read most notebook
1784           screens in direct sunlight, we think this will be a great thing to have.
1785         </para>
1786         <para>
1787           Because all of our work is open, both the hardware designs and the software,
1788           if you have some great idea for an addition to the current Altus Metrum family,
1789           feel free to dive in and help!  Or let us know what you'd like to see that
1790           we aren't already working on, and maybe we'll get excited about it too...
1791         </para>
1792     </section>
1793   </chapter>
1794 </book>