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