Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / doc / telemetrum-doc.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>TeleMetrum</title>
6   <subtitle>Owner's Manual for the TeleMetrum System</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     <copyright>
17       <year>2010</year>
18       <holder>Bdale Garbee and Keith Packard</holder>
19     </copyright>
20     <legalnotice>
21       <para>
22         This document is released under the terms of the 
23         <ulink url="http://creativecommons.org/licenses/by-sa/3.0/">
24           Creative Commons ShareAlike 3.0
25         </ulink>
26         license.
27       </para>
28     </legalnotice>
29     <revhistory>
30       <revision>
31         <revnumber>0.3</revnumber>
32         <date>12 November 2010</date>
33         <revremark>
34           Add instructions for re-flashing devices using AltosUI
35         </revremark>
36       </revision>
37       <revision>
38         <revnumber>0.2</revnumber>
39         <date>18 July 2010</date>
40         <revremark>Significant update</revremark>
41       </revision>
42       <revision>
43         <revnumber>0.1</revnumber>
44         <date>30 March 2010</date>
45         <revremark>Initial content</revremark>
46       </revision>
47     </revhistory>
48   </bookinfo>
49   <chapter>
50     <title>Introduction and Overview</title>
51     <para>
52       Welcome to the Altus Metrum community!  Our circuits and software reflect
53       our passion for both hobby rocketry and Free Software.  We hope their
54       capabilities and performance will delight you in every way, but by
55       releasing all of our hardware and software designs under open licenses,
56       we also hope to empower you to take as active a role in our collective
57       future as you wish!
58     </para>
59     <para>
60       The focal point of our community is TeleMetrum, a dual deploy altimeter 
61       with fully integrated GPS and radio telemetry as standard features, and
62       a "companion interface" that will support optional capabilities in the 
63       future.
64     </para>
65     <para>    
66       Complementing TeleMetrum is TeleDongle, a USB to RF interface for 
67       communicating with TeleMetrum.  Combined with your choice of antenna and 
68       notebook computer, TeleDongle and our associated user interface software
69       form a complete ground station capable of logging and displaying in-flight
70       telemetry, aiding rocket recovery, then processing and archiving flight
71       data for analysis and review.
72     </para>
73     <para>
74       More products will be added to the Altus Metrum family over time, and
75       we currently envision that this will be a single, comprehensive manual
76       for the entire product family.
77     </para>
78   </chapter>
79   <chapter>
80     <title>Getting Started</title>
81     <para>
82       This chapter began as "The Mere-Mortals Quick Start/Usage Guide to 
83       the Altus Metrum Starter Kit" by Bob Finch, W9YA, NAR 12965, TRA 12350, 
84       w9ya@amsat.org.  Bob was one of our first customers for a production
85       TeleMetrum, and the enthusiasm that led to his contribution of this
86       section is immensely gratifying and highy appreciated!
87     </para>
88     <para>
89       The first thing to do after you check the inventory of parts in your 
90       "starter kit" is to charge the battery by plugging it into the 
91       corresponding socket of the TeleMetrum and then using the USB A to B 
92       cable to plug the Telemetrum into your computer's USB socket. The 
93       TeleMetrum circuitry will charge the battery whenever it is plugged 
94       into the usb socket. The TeleMetrum's on-off switch does NOT control 
95       the charging circuitry.  When the GPS chip is initially searching for
96       satellites, the unit will pull more current than it can pull from the
97       usb port, so the battery must be plugged in order to get a good 
98       satellite lock.  Once GPS is locked the current consumption goes back 
99       down enough to enable charging while 
100       running. So it's a good idea to fully charge the battery as your 
101       first item of business so there is no issue getting and maintaining 
102       satellite lock.  The yellow charge indicator led will go out when the 
103       battery is nearly full and the charger goes to trickle charge.
104     </para>
105     <para>
106       The other active device in the starter kit is the half-duplex TeleDongle 
107       rf link.  If you plug it in to your computer it should "just work",
108       showing up as a serial port device.  If you are using Linux and are
109       having problems, try moving to a fresher kernel (2.6.33 or newer), as
110       there were some ugly USB serial driver bugs in earlier versions.
111     </para>
112     <para>
113       Next you should obtain and install the AltOS utilities.  The first
114       generation sofware was written for Linux only.  New software is coming
115       soon that will also run on Windows and Mac.  For now, we'll concentrate
116       on Linux.  If you are using Debian, an 'altos' package already exists, 
117       see http://altusmetrum.org/AltOS for details on how to install it.
118       User-contributed directions for building packages on ArchLinux may be 
119       found in the contrib/arch-linux directory as PKGBUILD files.
120       Between the debian/rules file and the PKGBUILD files in 
121       contrib, you should find enough information to learn how to build the 
122       software for any other version of Linux.
123     </para>
124     <para>
125       When you have successfully installed the software suite (either from 
126       compiled source code or as the pre-built Debian package) you will 
127       have 10 or so executable programs all of which have names beginning 
128       with 'ao-'.
129       ('ao-view' is the lone GUI-based program, the rest are command-line 
130       oriented.) You will also have man pages, that give you basic info 
131       on each program.
132       You will also get this documentation in two file types in the doc/ 
133       directory, telemetrum-doc.pdf and telemetrum-doc.html.
134       Finally you will have a couple control files that allow the ao-view 
135       GUI-based program to appear in your menu of programs (under 
136       the 'Internet' category). 
137     </para>
138     <para>
139       Both Telemetrum and TeleDongle can be directly communicated 
140       with using USB ports. The first thing you should try after getting 
141       both units plugged into to your computer's usb port(s) is to run 
142       'ao-list' from a terminal-window to see what port-device-name each 
143       device has been assigned by the operating system. 
144       You will need this information to access the devices via their 
145       respective on-board firmware and data using other command line
146       programs in the AltOS software suite.
147     </para>
148     <para>
149       To access the device's firmware for configuration you need a terminal
150       program such as you would use to talk to a modem.  The software 
151       authors prefer using the program 'cu' which comes from the UUCP package
152       on most Unix-like systems such as Linux.  An example command line for
153       cu might be 'cu -l /dev/ttyACM0', substituting the correct number 
154       indicated from running the
155       ao-list program.  Another reasonable terminal program for Linux is
156       'cutecom'.  The default 'escape' 
157       character used by CU (i.e. the character you use to
158       issue commands to cu itself instead of sending the command as input 
159       to the connected device) is a '~'. You will need this for use in 
160       only two different ways during normal operations. First is to exit 
161       the program by sending a '~.' which is called a 'escape-disconnect' 
162       and allows you to close-out from 'cu'. The
163       second use will be outlined later.
164     </para>
165     <para>
166       Both TeleMetrum and TeleDongle share the concept of a two level 
167       command set in their firmware.  
168       The first layer has several single letter commands. Once 
169       you are using 'cu' (or 'cutecom') sending (typing) a '?' 
170       returns a full list of these
171       commands. The second level are configuration sub-commands accessed 
172       using the 'c' command, for 
173       instance typing 'c?' will give you this second level of commands 
174       (all of which require the
175       letter 'c' to access).  Please note that most configuration options
176       are stored only in DataFlash memory, and only TeleMetrum has this
177       memory to save the various values entered like the channel number 
178       and your callsign when powered off.  TeleDongle requires that you
179       set these each time you plug it in, which ao-view can help with.
180     </para>
181     <para>
182       Try setting these config ('c' or second level menu) values.  A good
183       place to start is by setting your call sign.  By default, the boards
184       use 'N0CALL' which is cute, but not exactly legal!
185       Spend a few minutes getting comfortable with the units, their 
186       firmware, and 'cu' (or possibly 'cutecom').
187       For instance, try to send 
188       (type) a 'c r 2' and verify the channel change by sending a 'c s'. 
189       Verify you can connect and disconnect from the units while in your
190       terminal program by sending the escape-disconnect mentioned above.
191     </para>
192     <para>
193       Note that the 'reboot' command, which is very useful on TeleMetrum, 
194       will likely just cause problems with the dongle.  The *correct* way
195       to reset the dongle is just to unplug and re-plug it.
196     </para>
197     <para>
198       A fun thing to do at the launch site and something you can do while 
199       learning how to use these units is to play with the rf-link access 
200       of the TeleMetrum from the TeleDongle.  Be aware that you *must* create
201       some physical separation between the devices, otherwise the link will 
202       not function due to signal overload in the receivers in each device.
203     </para>
204     <para>
205       Now might be a good time to take a break and read the rest of this
206       manual, particularly about the two "modes" that the TeleMetrum 
207       can be placed in and how the position of the TeleMetrum when booting 
208       up will determine whether the unit is in "pad" or "idle" mode.
209     </para>
210     <para>
211       You can access a TeleMetrum in idle mode from the Teledongle's USB 
212       connection using the rf link
213       by issuing a 'p' command to the TeleDongle. Practice connecting and
214       disconnecting ('~~' while using 'cu') from the TeleMetrum.  If 
215       you cannot escape out of the "p" command, (by using a '~~' when in 
216       CU) then it is likely that your kernel has issues.  Try a newer version.
217     </para>
218     <para>
219       Using this rf link allows you to configure the TeleMetrum, test 
220       fire e-matches and igniters from the flight line, check pyro-match 
221       continuity and so forth. You can leave the unit turned on while it 
222       is in 'idle mode' and then place the
223       rocket vertically on the launch pad, walk away and then issue a 
224       reboot command.  The TeleMetrum will reboot and start sending data 
225       having changed to the "pad" mode. If the TeleDongle is not receiving 
226       this data, you can disconnect 'cu' from the Teledongle using the 
227       procedures mentioned above and THEN connect to the TeleDongle from 
228       inside 'ao-view'. If this doesn't work, disconnect from the
229       TeleDongle, unplug it, and try again after plugging it back in.
230     </para>
231     <para>
232       Eventually the GPS will find enough satellites, lock in on them, 
233       and 'ao-view' will both auditorially announce and visually indicate 
234       that GPS is ready.
235       Now you can launch knowing that you have a good data path and 
236       good satellite lock for flight data and recovery.  Remember 
237       you MUST tell ao-view to connect to the TeleDongle explicitly in 
238       order for ao-view to be able to receive data.
239     </para>
240     <para>
241       Both RDF (radio direction finding) tones from the TeleMetrum and 
242       GPS trekking data are available and together are very useful in 
243       locating the rocket once it has landed. (The last good GPS data 
244       received before touch-down will be on the data screen of 'ao-view'.)
245     </para>
246     <para>
247       Once you have recovered the rocket you can download the eeprom 
248       contents using either 'ao-dumplog' (or possibly 'ao-eeprom'), over
249       either a USB cable or over the radio link using TeleDongle.
250       And by following the man page for 'ao-postflight' you can create 
251       various data output reports, graphs, and even kml data to see the 
252       flight trajectory in google-earth. (Moving the viewing angle making 
253       sure to connect the yellow lines while in google-earth is the proper
254       technique.)
255     </para>
256     <para>
257       As for ao-view.... some things are in the menu but don't do anything 
258       very useful.  The developers have stopped working on ao-view to focus
259       on a new, cross-platform ground station program.  So ao-view may or 
260       may not be updated in the future.  Mostly you just use 
261       the Log and Device menus.  It has a wonderful display of the incoming 
262       flight data and I am sure you will enjoy what it has to say to you 
263       once you enable the voice output!
264     </para>
265     <section>
266       <title>FAQ</title>
267       <para>
268         The altimeter (TeleMetrum) seems to shut off when disconnected from the
269         computer.  Make sure the battery is adequately charged.  Remember the
270         unit will pull more power than the USB port can deliver before the 
271         GPS enters "locked" mode.  The battery charges best when TeleMetrum
272         is turned off.
273       </para>
274       <para>
275         It's impossible to stop the TeleDongle when it's in "p" mode, I have
276         to unplug the USB cable?  Make sure you have tried to "escape out" of 
277         this mode.  If this doesn't work the reboot procedure for the 
278         TeleDongle *is* to simply unplug it. 'cu' however will retain it's 
279         outgoing buffer IF your "escape out" ('~~') does not work. 
280         At this point using either 'ao-view' (or possibly
281         'cutemon') instead of 'cu' will 'clear' the issue and allow renewed
282         communication.
283       </para>
284       <para>
285         The amber LED (on the TeleMetrum/altimeter) lights up when both 
286         battery and USB are connected. Does this mean it's charging? 
287         Yes, the yellow LED indicates the charging at the 'regular' rate. 
288         If the led is out but the unit is still plugged into a USB port, 
289         then the battery is being charged at a 'trickle' rate.
290       </para>
291       <para>
292         There are no "dit-dah-dah-dit" sound like the manual mentions?
293         That's the "pad" mode.  Weak batteries might be the problem.
294         It is also possible that the unit is horizontal and the output 
295         is instead a "dit-dit" meaning 'idle'.
296       </para>
297       <para>
298         It's unclear how to use 'ao-view' and other programs when 'cu' 
299         is running. You cannot have more than one program connected to 
300         the TeleDongle at one time without apparent data loss as the 
301         incoming data will not make it to both programs intact. 
302         Disconnect whatever programs aren't currently being used.
303       </para>
304       <para>
305         How do I save flight data?   
306         Live telemetry is written to file(s) whenever 'ao-view' is connected 
307         to the TeleDongle.  The file area defaults to ~/altos
308         but is easily changed using the menus in 'ao-view'. The files that 
309         are written end in '.telem'. The after-flight
310         data-dumped files will end in .eeprom and represent continuous data 
311         unlike the rf-linked .telem files that are subject to the 
312         turnarounds/data-packaging time slots in the half-duplex rf data path. 
313         See the above instructions on what and how to save the eeprom stored 
314         data after physically retrieving your TeleMetrum.  Make sure to save
315         the on-board data after each flight, as the current firmware will
316         over-write any previous flight data during a new flight.
317       </para>
318     </section>
319   </chapter>
320   <chapter>
321     <title>Specifications</title>
322     <itemizedlist>
323       <listitem>
324         <para>
325           Recording altimeter for model rocketry.
326         </para>
327       </listitem>
328       <listitem>
329         <para>
330           Supports dual deployment (can fire 2 ejection charges).
331         </para>
332       </listitem>
333       <listitem>
334         <para>
335           70cm ham-band transceiver for telemetry downlink.
336         </para>
337       </listitem>
338       <listitem>
339         <para>
340           Barometric pressure sensor good to 45k feet MSL.
341         </para>
342       </listitem>
343       <listitem>
344         <para>
345           1-axis high-g accelerometer for motor characterization, capable of 
346           +/- 50g using default part.
347         </para>
348       </listitem>
349       <listitem>
350         <para>
351           On-board, integrated GPS receiver with 5hz update rate capability.
352         </para>
353       </listitem>
354       <listitem>
355         <para>
356           On-board 1 megabyte non-volatile memory for flight data storage.
357         </para>
358       </listitem>
359       <listitem>
360         <para>
361           USB interface for battery charging, configuration, and data recovery.
362         </para>
363       </listitem>
364       <listitem>
365         <para>
366           Fully integrated support for LiPo rechargeable batteries.
367         </para>
368       </listitem>
369       <listitem>
370         <para>
371           Uses LiPo to fire e-matches, support for optional separate pyro 
372           battery if needed.
373         </para>
374       </listitem>
375       <listitem>
376         <para>
377           2.75 x 1 inch board designed to fit inside 29mm airframe coupler tube.
378         </para>
379       </listitem>
380     </itemizedlist>
381   </chapter>
382   <chapter>
383     <title>Handling Precautions</title>
384     <para>
385       TeleMetrum is a sophisticated electronic device.  When handled gently and
386       properly installed in an airframe, it will deliver impressive results.
387       However, like all electronic devices, there are some precautions you
388       must take.
389     </para>
390     <para>
391       The Lithium Polymer rechargeable batteries used with TeleMetrum have an 
392       extraordinary power density.  This is great because we can fly with
393       much less battery mass than if we used alkaline batteries or previous
394       generation rechargeable batteries... but if they are punctured 
395       or their leads are allowed to short, they can and will release their 
396       energy very rapidly!
397       Thus we recommend that you take some care when handling our batteries 
398       and consider giving them some extra protection in your airframe.  We 
399       often wrap them in suitable scraps of closed-cell packing foam before 
400       strapping them down, for example.
401     </para>
402     <para>
403       The TeleMetrum barometric sensor is sensitive to sunlight.  In normal 
404       mounting situations, it and all of the other surface mount components 
405       are "down" towards whatever the underlying mounting surface is, so
406       this is not normally a problem.  Please consider this, though, when
407       designing an installation, for example, in a 29mm airframe with a 
408       see-through plastic payload bay.
409     </para>
410     <para>
411       The TeleMetrum barometric sensor sampling port must be able to 
412       "breathe",
413       both by not being covered by foam or tape or other materials that might
414       directly block the hole on the top of the sensor, but also by having a
415       suitable static vent to outside air.  
416     </para>
417     <para>
418       As with all other rocketry electronics, TeleMetrum must be protected 
419       from exposure to corrosive motor exhaust and ejection charge gasses.
420     </para>
421   </chapter>
422   <chapter>
423     <title>Hardware Overview</title>
424     <para>
425       TeleMetrum is a 1 inch by 2.75 inch circuit board.  It was designed to
426       fit inside coupler for 29mm airframe tubing, but using it in a tube that
427       small in diameter may require some creativity in mounting and wiring 
428       to succeed!  The default 1/4
429       wave UHF wire antenna attached to the center of the nose-cone end of
430       the board is about 7 inches long, and wiring for a power switch and
431       the e-matches for apogee and main ejection charges depart from the 
432       fin can end of the board.  Given all this, an ideal "simple" avionics 
433       bay for TeleMetrum should have at least 10 inches of interior length.
434     </para>
435     <para>
436       A typical TeleMetrum installation using the on-board GPS antenna and
437       default wire UHF antenna involves attaching only a suitable
438       Lithium Polymer battery, a single pole switch for power on/off, and 
439       two pairs of wires connecting e-matches for the apogee and main ejection
440       charges.  
441     </para>
442     <para>
443       By default, we use the unregulated output of the LiPo battery directly
444       to fire ejection charges.  This works marvelously with standard 
445       low-current e-matches like the J-Tek from MJG Technologies, and with 
446       Quest Q2G2 igniters.  However, if you
447       want or need to use a separate pyro battery, you can do so by adding
448       a second 2mm connector to position B2 on the board and cutting the
449       thick pcb trace connecting the LiPo battery to the pyro circuit between
450       the two silk screen marks on the surface mount side of the board shown
451       here [insert photo]
452     </para>
453     <para>
454       We offer two choices of pyro and power switch connector, or you can 
455       choose neither and solder wires directly to the board.  All three choices
456       are reasonable depending on the constraints of your airframe.  Our
457       favorite option when there is sufficient room above the board is to use
458       the Tyco pin header with polarization and locking.  If you choose this
459       option, you crimp individual wires for the power switch and e-matches
460       into a mating connector, and installing and removing the TeleMetrum
461       board from an airframe is as easy as plugging or unplugging two 
462       connectors.  If the airframe will not support this much height or if
463       you want to be able to directly attach e-match leads to the board, we
464       offer a screw terminal block.  This is very similar to what most other
465       altimeter vendors provide and so may be the most familiar option.  
466       You'll need a very small straight blade screwdriver to connect
467       and disconnect the board in this case, such as you might find in a
468       jeweler's screwdriver set.  Finally, you can forego both options and
469       solder wires directly to the board, which may be the best choice for
470       minimum diameter and/or minimum mass designs. 
471     </para>
472     <para>
473       For most airframes, the integrated GPS antenna and wire UHF antenna are
474       a great combination.  However, if you are installing in a carbon-fiber
475       electronics bay which is opaque to RF signals, you may need to use 
476       off-board external antennas instead.  In this case, you can order
477       TeleMetrum with an SMA connector for the UHF antenna connection, and
478       you can unplug the integrated GPS antenna and select an appropriate 
479       off-board GPS antenna with cable terminating in a U.FL connector.
480     </para>
481   </chapter>
482   <chapter>
483     <title>Operation</title>
484     <section>
485       <title>Firmware Modes </title>
486       <para>
487         The AltOS firmware build for TeleMetrum has two fundamental modes,
488         "idle" and "flight".  Which of these modes the firmware operates in
489         is determined by the orientation of the rocket (well, actually the
490         board, of course...) at the time power is switched on.  If the rocket
491         is "nose up", then TeleMetrum assumes it's on a rail or rod being
492         prepared for launch, so the firmware chooses flight mode.  However,
493         if the rocket is more or less horizontal, the firmware instead enters
494         idle mode.
495       </para>
496       <para>
497         At power on, you will hear three beeps 
498         ("S" in Morse code for startup) and then a pause while 
499         TeleMetrum completes initialization and self tests, and decides which
500         mode to enter next.
501       </para>
502       <para>
503         In flight or "pad" mode, TeleMetrum turns on the GPS system, 
504         engages the flight
505         state machine, goes into transmit-only mode on the RF link sending 
506         telemetry, and waits for launch to be detected.  Flight mode is
507         indicated by an audible "di-dah-dah-dit" ("P" for pad) on the 
508         beeper, followed by
509         beeps indicating the state of the pyrotechnic igniter continuity.
510         One beep indicates apogee continuity, two beeps indicate
511         main continuity, three beeps indicate both apogee and main continuity,
512         and one longer "brap" sound indicates no continuity.  For a dual
513         deploy flight, make sure you're getting three beeps before launching!
514         For apogee-only or motor eject flights, do what makes sense.
515       </para>
516       <para>
517         In idle mode, you will hear an audible "di-dit" ("I" for idle), and
518         the normal flight state machine is disengaged, thus
519         no ejection charges will fire.  TeleMetrum also listens on the RF
520         link when in idle mode for packet mode requests sent from TeleDongle.
521         Commands can be issued to a TeleMetrum in idle mode over either
522         USB or the RF link equivalently.
523         Idle mode is useful for configuring TeleMetrum, for extracting data 
524         from the on-board storage chip after flight, and for ground testing
525         pyro charges.
526       </para>
527       <para>
528         One "neat trick" of particular value when TeleMetrum is used with very
529         large airframes, is that you can power the board up while the rocket
530         is horizontal, such that it comes up in idle mode.  Then you can 
531         raise the airframe to launch position, use a TeleDongle to open
532         a packet connection, and issue a 'reset' command which will cause
533         TeleMetrum to reboot, realize it's now nose-up, and thus choose
534         flight mode.  This is much safer than standing on the top step of a
535         rickety step-ladder or hanging off the side of a launch tower with
536         a screw-driver trying to turn on your avionics before installing
537         igniters!
538       </para>
539     </section>
540     <section>
541       <title>GPS </title>
542       <para>
543         TeleMetrum includes a complete GPS receiver.  See a later section for
544         a brief explanation of how GPS works that will help you understand
545         the information in the telemetry stream.  The bottom line is that
546         the TeleMetrum GPS receiver needs to lock onto at least four 
547         satellites to obtain a solid 3 dimensional position fix and know 
548         what time it is!
549       </para>
550       <para>
551         TeleMetrum provides backup power to the GPS chip any time a LiPo
552         battery is connected.  This allows the receiver to "warm start" on
553         the launch rail much faster than if every power-on were a "cold start"
554         for the GPS receiver.  In typical operations, powering up TeleMetrum
555         on the flight line in idle mode while performing final airframe
556         preparation will be sufficient to allow the GPS receiver to cold
557         start and acquire lock.  Then the board can be powered down during
558         RSO review and installation on a launch rod or rail.  When the board
559         is turned back on, the GPS system should lock very quickly, typically
560         long before igniter installation and return to the flight line are
561         complete.
562       </para>
563     </section>
564     <section>
565       <title>Ground Testing </title>
566       <para>
567         An important aspect of preparing a rocket using electronic deployment
568         for flight is ground testing the recovery system.  Thanks
569         to the bi-directional RF link central to the Altus Metrum system, 
570         this can be accomplished in a TeleMetrum-equipped rocket without as
571         much work as you may be accustomed to with other systems.  It can
572         even be fun!
573       </para>
574       <para>
575         Just prep the rocket for flight, then power up TeleMetrum while the
576         airframe is horizontal.  This will cause the firmware to go into 
577         "idle" mode, in which the normal flight state machine is disabled and
578         charges will not fire without manual command.  Then, establish an
579         RF packet connection from a TeleDongle-equipped computer using the 
580         P command from a safe distance.  You can now command TeleMetrum to
581         fire the apogee or main charges to complete your testing.
582       </para>
583       <para>
584         In order to reduce the chance of accidental firing of pyrotechnic
585         charges, the command to fire a charge is intentionally somewhat
586         difficult to type, and the built-in help is slightly cryptic to 
587         prevent accidental echoing of characters from the help text back at
588         the board from firing a charge.  The command to fire the apogee
589         drogue charge is 'i DoIt drogue' and the command to fire the main
590         charge is 'i DoIt main'.
591       </para>
592     </section>
593     <section>
594       <title>Radio Link </title>
595       <para>
596         The chip our boards are based on incorporates an RF transceiver, but
597         it's not a full duplex system... each end can only be transmitting or
598         receiving at any given moment.  So we had to decide how to manage the
599         link.
600       </para>
601       <para>
602         By design, TeleMetrum firmware listens for an RF connection when
603         it's in "idle mode" (turned on while the rocket is horizontal), which
604         allows us to use the RF link to configure the rocket, do things like
605         ejection tests, and extract data after a flight without having to 
606         crack open the airframe.  However, when the board is in "flight 
607         mode" (turned on when the rocket is vertical) the TeleMetrum only 
608         transmits and doesn't listen at all.  That's because we want to put 
609         ultimate priority on event detection and getting telemetry out of 
610         the rocket and out over
611         the RF link in case the rocket crashes and we aren't able to extract
612         data later... 
613       </para>
614       <para>
615         We don't use a 'normal packet radio' mode because they're just too
616         inefficient.  The GFSK modulation we use is just FSK with the 
617         baseband pulses passed through a
618         Gaussian filter before they go into the modulator to limit the
619         transmitted bandwidth.  When combined with the hardware forward error
620         correction support in the cc1111 chip, this allows us to have a very
621         robust 38.4 kilobit data link with only 10 milliwatts of transmit power,
622         a whip antenna in the rocket, and a hand-held Yagi on the ground.  We've
623         had flights to above 21k feet AGL with good reception, and calculations
624         suggest we should be good to well over 40k feet AGL with a 5-element yagi on
625         the ground.  We hope to fly boards to higher altitudes soon, and would
626         of course appreciate customer feedback on performance in higher
627         altitude flights!
628       </para>
629     </section>
630     <section>
631       <title>Configurable Parameters</title>
632       <para>
633         Configuring a TeleMetrum board for flight is very simple.  Because we
634         have both acceleration and pressure sensors, there is no need to set
635         a "mach delay", for example.  The few configurable parameters can all
636         be set using a simple terminal program over the USB port or RF link
637         via TeleDongle.
638       </para>
639       <section>
640         <title>Radio Channel</title>
641         <para>
642           Our firmware supports 10 channels.  The default channel 0 corresponds
643           to a center frequency of 434.550 Mhz, and channels are spaced every 
644           100 khz.  Thus, channel 1 is 434.650 Mhz, and channel 9 is 435.550 Mhz.
645           At any given launch, we highly recommend coordinating who will use
646           each channel and when to avoid interference.  And of course, both 
647           TeleMetrum and TeleDongle must be configured to the same channel to
648           successfully communicate with each other.
649         </para>
650         <para>
651           To set the radio channel, use the 'c r' command, like 'c r 3' to set
652           channel 3.  
653           As with all 'c' sub-commands, follow this with a 'c w' to write the 
654           change to the parameter block in the on-board DataFlash chip on
655           your TeleMetrum board if you want the change to stay in place across reboots.
656         </para>
657       </section>
658       <section>
659         <title>Apogee Delay</title>
660         <para>
661           Apogee delay is the number of seconds after TeleMetrum detects flight
662           apogee that the drogue charge should be fired.  In most cases, this
663           should be left at the default of 0.  However, if you are flying
664           redundant electronics such as for an L3 certification, you may wish 
665           to set one of your altimeters to a positive delay so that both 
666           primary and backup pyrotechnic charges do not fire simultaneously.
667         </para>
668         <para>
669           To set the apogee delay, use the [FIXME] command.
670           As with all 'c' sub-commands, follow this with a 'c w' to write the 
671           change to the parameter block in the on-board DataFlash chip.
672         </para>
673         <para>
674           Please note that the TeleMetrum apogee detection algorithm always
675           fires a fraction of a second *after* apogee.  If you are also flying
676           an altimeter like the PerfectFlite MAWD, which only supports selecting
677           0 or 1 seconds of apogee delay, you may wish to set the MAWD to 0
678           seconds delay and set the TeleMetrum to fire your backup 2 or 3
679           seconds later to avoid any chance of both charges firing 
680           simultaneously.  We've flown several airframes this way quite happily,
681           including Keith's successful L3 cert.
682         </para>
683       </section>
684       <section>
685         <title>Main Deployment Altitude</title>
686         <para>
687           By default, TeleMetrum will fire the main deployment charge at an
688           elevation of 250 meters (about 820 feet) above ground.  We think this
689           is a good elevation for most airframes, but feel free to change this 
690           to suit.  In particular, if you are flying two altimeters, you may
691           wish to set the
692           deployment elevation for the backup altimeter to be something lower
693           than the primary so that both pyrotechnic charges don't fire
694           simultaneously.
695         </para>
696         <para>
697           To set the main deployment altitude, use the [FIXME] command.
698           As with all 'c' sub-commands, follow this with a 'c w' to write the 
699           change to the parameter block in the on-board DataFlash chip.
700         </para>
701       </section>
702     </section>
703     <section>
704       <title>Calibration</title>
705       <para>
706         There are only two calibrations required for a TeleMetrum board, and
707         only one for TeleDongle.
708       </para>
709       <section>
710         <title>Radio Frequency</title>
711         <para>
712           The radio frequency is synthesized from a clock based on the 48 Mhz
713           crystal on the board.  The actual frequency of this oscillator must be
714           measured to generate a calibration constant.  While our GFSK modulation
715           bandwidth is wide enough to allow boards to communicate even when 
716           their oscillators are not on exactly the same frequency, performance
717           is best when they are closely matched.
718           Radio frequency calibration requires a calibrated frequency counter.
719           Fortunately, once set, the variation in frequency due to aging and
720           temperature changes is small enough that re-calibration by customers
721           should generally not be required.
722         </para>
723         <para>
724           To calibrate the radio frequency, connect the UHF antenna port to a
725           frequency counter, set the board to channel 0, and use the 'C' 
726           command to generate a CW carrier.  Wait for the transmitter temperature
727           to stabilize and the frequency to settle down.  
728           Then, divide 434.550 Mhz by the 
729           measured frequency and multiply by the current radio cal value show
730           in the 'c s' command.  For an unprogrammed board, the default value
731           is 1186611.  Take the resulting integer and program it using the 'c f'
732           command.  Testing with the 'C' command again should show a carrier
733           within a few tens of Hertz of the intended frequency.
734           As with all 'c' sub-commands, follow this with a 'c w' to write the 
735           change to the parameter block in the on-board DataFlash chip.
736         </para>
737       </section>
738       <section>
739         <title>Accelerometer</title>
740         <para>
741           The accelerometer we use has its own 5 volt power supply and
742           the output must be passed through a resistive voltage divider to match
743           the input of our 3.3 volt ADC.  This means that unlike the barometric
744           sensor, the output of the acceleration sensor is not ratiometric to 
745           the ADC converter, and calibration is required.  We also support the 
746           use of any of several accelerometers from a Freescale family that 
747           includes at least +/- 40g, 50g, 100g, and 200g parts.  Using gravity,
748           a simple 2-point calibration yields acceptable results capturing both
749           the different sensitivities and ranges of the different accelerometer
750           parts and any variation in power supply voltages or resistor values
751           in the divider network.
752         </para>
753         <para>
754           To calibrate the acceleration sensor, use the 'c a 0' command.  You
755           will be prompted to orient the board vertically with the UHF antenna
756           up and press a key, then to orient the board vertically with the 
757           UHF antenna down and press a key.
758           As with all 'c' sub-commands, follow this with a 'c w' to write the 
759           change to the parameter block in the on-board DataFlash chip.
760         </para>
761         <para>
762           The +1g and -1g calibration points are included in each telemetry
763           frame and are part of the header extracted by ao-dumplog after flight.
764           Note that we always store and return raw ADC samples for each
765           sensor... nothing is permanently "lost" or "damaged" if the 
766           calibration is poor.
767         </para>
768       </section>
769     </section>
770   </chapter>
771   <chapter>
772     <title>Updating Device Firmware</title>
773     <para>
774       The big conceptual thing to realize is that you have to use a
775       TeleDongle as a programmer to update a TeleMetrum, and vice versa.
776       Due to limited memory resources in the cc1111, we don't support
777       programming either unit directly over USB.
778     </para>
779     <para>
780       You may wish to begin by ensuring you have current firmware images.
781       These are distributed as part of the AltOS software bundle that
782       also includes the AltosUI ground station program.  Newer ground
783       station versions typically work fine with older firmware versions, 
784       so you don't need to update your devices just to try out new 
785       software features.  You can always download the most recent 
786       version from http://www.altusmetrum.org/AltOS/.
787     </para>
788     <para>
789       We recommend updating TeleMetrum first, before updating TeleDongle.
790     </para>
791     <section>
792       <title>Updating TeleMetrum Firmware</title>
793       <orderedlist inheritnum='inherit' numeration='arabic'>
794         <listitem> 
795           Find the 'programming cable' that you got as part of the starter
796           kit, that has a red 8-pin MicroMaTch connector on one end and a
797           red 4-pin MicroMaTch connector on the other end.  
798         </listitem>
799          
800         <listitem> 
801           Take the 2 screws out of the TeleDongle case to get access 
802           to the circuit board.  
803         </listitem>
804         <listitem>
805           Plug the 8-pin end of the programming cable to the
806           matching connector on the TeleDongle, and the 4-pin end to the
807           matching connector on the TeleMetrum.  
808         </listitem>
809         <listitem>
810           Attach a battery to the TeleMetrum board.
811         </listitem>
812         <listitem>
813           Plug the TeleDongle into your computer's USB port, and power 
814           up the TeleMetrum. 
815         </listitem>
816         <listitem>
817           Run AltosUI, and select 'Flash Image' from the File menu.
818         </listitem>
819         <listitem>
820           Pick the TeleDongle device from the list, identifying it as the 
821           programming device.
822         </listitem>
823         <listitem>
824           Select the image you want put on the TeleMetrum, which should have a 
825           name in the form telemetrum-v1.0-0.7.1.ihx.  It should be visible 
826         in the default directory, if not you may have to poke around 
827         your system to find it.
828         </listitem>
829         <listitem>
830           Make sure the configuration parameters are reasonable
831           looking. If the serial number and/or RF configuration
832           values aren't right, you'll need to change them.
833         </listitem>
834         <listitem>
835           Hit the 'OK' button and the software should proceed to flash 
836           the TeleMetrum with new firmware, showing a progress bar.
837         </listitem>
838         <listitem>
839           Confirm that the TeleMetrum board seems to have updated ok, which you
840           can do by plugging in to it over USB and using a terminal program
841           to connect to the board and issue the 'v' command to check
842           the version, etc.
843         </listitem>
844         <listitem>
845           If something goes wrong, give it another try.
846         </listitem>
847       </orderedlist>
848     </section>
849     <section>
850       <title>Updating TeleDongle Firmware</title>
851       <para>
852         Updating TeleDongle's firmware is just like updating TeleMetrum
853         firmware, but you switch which board is the programmer and which
854         is the programming target.
855         </para>
856       <orderedlist inheritnum='inherit' numeration='arabic'>
857         <listitem> 
858           Find the 'programming cable' that you got as part of the starter
859           kit, that has a red 8-pin MicroMaTch connector on one end and a
860           red 4-pin MicroMaTch connector on the other end.  
861         </listitem>
862         <listitem>
863           Find the USB cable that you got as part of the starter kit, and
864           plug the "mini" end in to the mating connector on TeleMetrum.
865         </listitem>
866         <listitem>
867           Take the 2 screws out of the TeleDongle case to get access 
868           to the circuit board.  
869         </listitem>
870         <listitem>
871           Plug the 8-pin end of the programming cable to the (latching)
872           matching connector on the TeleMetrum, and the 4-pin end to the
873           matching connector on the TeleDongle.  
874         </listitem>
875         <listitem>
876           Attach a battery to the TeleMetrum board.
877         </listitem>
878         <listitem>
879           Plug both TeleMetrum and TeleDongle into your computer's USB 
880           ports, and power up the TeleMetrum. 
881         </listitem>
882         <listitem>
883           Run AltosUI, and select 'Flash Image' from the File menu.
884         </listitem>
885         <listitem>
886           Pick the TeleMongle device from the list, identifying it as the 
887           programming device.
888         </listitem>
889         <listitem>
890           Select the image you want put on the TeleDongle, which should have a 
891           name in the form teledongle-v0.2-0.7.1.ihx.  It should be visible 
892         in the default directory, if not you may have to poke around 
893         your system to find it.
894         </listitem>
895         <listitem>
896           Make sure the configuration parameters are reasonable
897           looking. If the serial number and/or RF configuration
898           values aren't right, you'll need to change them.  The TeleDongle
899           serial number is on the "bottom" of the circuit board, and can 
900           usually be read through the translucent blue plastic case without
901           needing to remove the board from the case.
902         </listitem>
903         <listitem>
904           Hit the 'OK' button and the software should proceed to flash 
905           the TeleDongle with new firmware, showing a progress bar.
906         </listitem>
907         <listitem>
908           Confirm that the TeleDongle board seems to have updated ok, which you
909           can do by plugging in to it over USB and using a terminal program
910           to connect to the board and issue the 'v' command to check
911           the version, etc.  Once you're happy, remove the programming cable
912           and put the cover back on the TeleDongle.     
913         </listitem>
914         <listitem>
915           If something goes wrong, give it another try.
916         </listitem>
917       </orderedlist>
918       <para>
919         Be careful removing the programming cable from the locking 8-pin
920         connector on TeleMetrum.  You'll need a fingernail or perhaps a thin
921         screwdriver or knife blade to gently pry the locking ears out 
922         slightly to extract the connector.  We used a locking connector on 
923         TeleMetrum to help ensure that the cabling to companion boards 
924         used in a rocket don't ever come loose accidentally in flight.
925       </para>
926     </section>
927   </chapter>
928   <chapter>
929     <title>Using Altus Metrum Products</title>
930     <section>
931       <title>Being Legal</title>
932       <para>
933         First off, in the US, you need an [amateur radio license](../Radio) or 
934         other authorization to legally operate the radio transmitters that are part
935         of our products.
936       </para>
937       <section>
938         <title>In the Rocket</title>
939         <para>
940           In the rocket itself, you just need a [TeleMetrum](../TeleMetrum) board and 
941           a LiPo rechargeable battery.  An 860mAh battery weighs less than a 9V 
942           alkaline battery, and will run a [TeleMetrum](../TeleMetrum) for hours.
943         </para>
944         <para>
945           By default, we ship TeleMetrum with a simple wire antenna.  If your 
946           electronics bay or the airframe it resides within is made of carbon fiber, 
947           which is opaque to RF signals, you may choose to have an SMA connector 
948           installed so that you can run a coaxial cable to an antenna mounted 
949           elsewhere in the rocket.
950         </para>
951       </section>
952       <section>
953         <title>On the Ground</title>
954         <para>
955           To receive the data stream from the rocket, you need an antenna and short 
956           feedline connected to one of our [TeleDongle](../TeleDongle) units.  The
957           TeleDongle in turn plugs directly into the USB port on a notebook 
958           computer.  Because TeleDongle looks like a simple serial port, your computer
959           does not require special device drivers... just plug it in.
960         </para>
961         <para>
962           Right now, all of our application software is written for Linux.  However, 
963           because we understand that many people run Windows or MacOS, we are working 
964           on a new ground station program written in Java that should work on all
965           operating systems.
966         </para>
967         <para>
968           After the flight, you can use the RF link to extract the more detailed data 
969           logged in the rocket, or you can use a mini USB cable to plug into the 
970           TeleMetrum board directly.  Pulling out the data without having to open up
971           the rocket is pretty cool!  A USB cable is also how you charge the LiPo 
972           battery, so you'll want one of those anyway... the same cable used by lots 
973           of digital cameras and other modern electronic stuff will work fine.
974         </para>
975         <para>
976           If your rocket lands out of sight, you may enjoy having a hand-held GPS 
977           receiver, so that you can put in a waypoint for the last reported rocket 
978           position before touch-down.  This makes looking for your rocket a lot like 
979           Geo-Cacheing... just go to the waypoint and look around starting from there.
980         </para>
981         <para>
982           You may also enjoy having a ham radio "HT" that covers the 70cm band... you 
983           can use that with your antenna to direction-find the rocket on the ground 
984           the same way you can use a Walston or Beeline tracker.  This can be handy 
985           if the rocket is hiding in sage brush or a tree, or if the last GPS position 
986           doesn't get you close enough because the rocket dropped into a canyon, or 
987           the wind is blowing it across a dry lake bed, or something like that...  Keith
988           and Bdale both currently own and use the Yaesu VX-7R at launches.
989         </para>
990         <para>
991           So, to recap, on the ground the hardware you'll need includes:
992           <orderedlist inheritnum='inherit' numeration='arabic'>
993             <listitem> 
994               an antenna and feedline
995             </listitem>
996             <listitem> 
997               a TeleDongle
998             </listitem>
999             <listitem> 
1000               a notebook computer
1001             </listitem>
1002             <listitem> 
1003               optionally, a handheld GPS receiver
1004             </listitem>
1005             <listitem> 
1006               optionally, an HT or receiver covering 435 Mhz
1007             </listitem>
1008           </orderedlist>
1009         </para>
1010         <para>
1011           The best hand-held commercial directional antennas we've found for radio 
1012           direction finding rockets are from 
1013           <ulink url="http://www.arrowantennas.com/" >
1014             Arrow Antennas.
1015           </ulink>
1016           The 440-3 and 440-5 are both good choices for finding a 
1017           TeleMetrum-equipped rocket when used with a suitable 70cm HT.  
1018         </para>
1019       </section>
1020       <section>
1021         <title>Data Analysis</title>
1022         <para>
1023           Our software makes it easy to log the data from each flight, both the 
1024           telemetry received over the RF link during the flight itself, and the more
1025           complete data log recorded in the DataFlash memory on the TeleMetrum 
1026           board.  Once this data is on your computer, our postflight tools make it
1027           easy to quickly get to the numbers everyone wants, like apogee altitude, 
1028           max acceleration, and max velocity.  You can also generate and view a 
1029           standard set of plots showing the altitude, acceleration, and
1030           velocity of the rocket during flight.  And you can even export a data file 
1031           useable with Google Maps and Google Earth for visualizing the flight path 
1032           in two or three dimensions!
1033         </para>
1034         <para>
1035           Our ultimate goal is to emit a set of files for each flight that can be
1036           published as a web page per flight, or just viewed on your local disk with 
1037           a web browser.
1038         </para>
1039       </section>
1040       <section>
1041         <title>Future Plans</title>
1042         <para>
1043           In the future, we intend to offer "companion boards" for the rocket that will
1044           plug in to TeleMetrum to collect additional data, provide more pyro channels,
1045           and so forth.  A reference design for a companion board will be documented
1046           soon, and will be compatible with open source Arduino programming tools.
1047         </para>
1048         <para>
1049           We are also working on the design of a hand-held ground terminal that will
1050           allow monitoring the rocket's status, collecting data during flight, and
1051           logging data after flight without the need for a notebook computer on the
1052           flight line.  Particularly since it is so difficult to read most notebook
1053           screens in direct sunlight, we think this will be a great thing to have.
1054         </para>
1055         <para>
1056           Because all of our work is open, both the hardware designs and the software,
1057           if you have some great idea for an addition to the current Altus Metrum family,
1058           feel free to dive in and help!  Or let us know what you'd like to see that 
1059           we aren't already working on, and maybe we'll get excited about it too... 
1060         </para>
1061       </section>
1062     </section>
1063     <section>
1064       <title>
1065         How GPS Works
1066       </title>
1067       <para>
1068         Placeholder.
1069       </para>
1070     </section>
1071   </chapter>
1072 </book>
1073