doc: More altusmetrum.xsl updates for 1.3
[fw/altos] / doc / micropeak.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>MicroPeak Owner's Manual</title>
6   <subtitle>A recording altimeter for hobby rocketry</subtitle>
7   <bookinfo>
8     <author>
9       <firstname>Keith</firstname>
10       <surname>Packard</surname>
11     </author>
12     <copyright>
13       <year>2012</year>
14       <holder>Bdale Garbee and Keith Packard</holder>
15     </copyright>
16     <legalnotice>
17       <para>
18         This document is released under the terms of the
19         <ulink url="http://creativecommons.org/licenses/by-sa/3.0/">
20           Creative Commons ShareAlike 3.0
21         </ulink>
22         license.
23       </para>
24     </legalnotice>
25     <revhistory>
26       <revision>
27         <revnumber>0.1</revnumber>
28         <date>29 October 2012</date>
29         <revremark>
30           Initial release with preliminary hardware.
31         </revremark>
32       </revision>
33       <revision>
34         <revnumber>1.0</revnumber>
35         <date>18 November 2012</date>
36         <revremark>
37           Updates for version 1.0 release.
38         </revremark>
39       </revision>
40       <revision>
41         <revnumber>1.1</revnumber>
42         <date>12 December 2012</date>
43         <revremark>
44           Add comments about EEPROM storage format and programming jig.
45         </revremark>
46       </revision>
47       <revision>
48         <revnumber>1.2</revnumber>
49         <date>20 January 2013</date>
50         <revremark>
51           Add documentation for the MicroPeak USB adapter board. Note
52           the switch to a Kalman filter for peak altitude
53           determination.
54         </revremark>
55       </revision>
56     </revhistory>
57   </bookinfo>
58   <dedication>
59     <title>Acknowledgements</title>
60     <para>
61       Thanks to John Lyngdal for suggesting that we build something like this.
62     </para>
63     <para>
64       Have fun using these products, and we hope to meet all of you
65       out on the rocket flight line somewhere.
66       <literallayout>
67 Bdale Garbee, KB0G
68 NAR #87103, TRA #12201
69
70 Keith Packard, KD7SQG
71 NAR #88757, TRA #12200
72       </literallayout>
73     </para>
74   </dedication>
75   <chapter>
76     <title>Quick Start Guide</title>
77     <para>
78       MicroPeak is designed to be easy to use. Requiring no external
79       components, flying takes just a few steps
80     </para>
81     <itemizedlist>
82       <listitem>
83         <para>
84           Install the battery. Fit a CR1025 battery into the plastic
85           carrier. The positive (+) terminal should be towards the more
86           open side of the carrier. Slip the carrier into the battery
87           holder with the positive (+) terminal facing away from the
88           circuit board.
89         </para>
90       </listitem>
91       <listitem>
92         <para>
93           Install MicroPeak in your rocket. This can be as simple as
94           preparing a soft cushion of wadding inside a vented model payload
95           bay. Wherever you mount it, make sure you protect the
96           barometric sensor from corrosive ejection gasses as those
97           will damage the sensor, and shield it from light as that can
98           cause incorrect sensor readings.
99         </para>
100       </listitem>
101       <listitem>
102         <para>
103           Turn MicroPeak on. Slide the switch so that the actuator
104           covers the '1' printed on the board. MicroPeak will report
105           the maximum height of the last flight in decimeters using a
106           sequence of flashes on the LED. A sequence of short flashes
107           indicates one digit. A single long flash indicates zero. The
108           height is reported in decimeters, so the last digit will be
109           tenths of a meter. For example, if MicroPeak reports 5 4 4
110           3, then the maximum height of the last flight was 544.3m, or
111           1786 feet.
112         </para>
113       </listitem>
114       <listitem>
115         <para>
116           Finish preparing the rocket for flight. After the
117           previous flight data have been reported, MicroPeak waits for
118           30 seconds before starting to check for launch. This gives
119           you time to finish assembling the rocket. As those
120           activities might cause pressure changes inside the airframe,
121           MicroPeak might accidentally detect boost. If you need to do
122           anything to the airframe after the 30 second window passes,
123           make sure to be careful not to disturb the altimeter. The
124           LED will remain dark during the 30 second delay, but after
125           that, it will start blinking once every 3 seconds.
126         </para>
127       </listitem>
128       <listitem>
129         <para>
130           Fly the rocket. Once the rocket passes about 10m in height
131           (32 feet), the micro-controller will record the ground
132           pressure and track the pressure seen during the flight. In
133           this mode, the LED flickers rapidly. When the rocket lands,
134           and the pressure stabilizes, the micro-controller will record
135           the minimum pressure pressure experienced during the flight,
136           compute the height represented by the difference in air
137           pressure and blink that value out on the LED. After that,
138           MicroPeak powers down to conserve battery power.
139         </para>
140       </listitem>
141       <listitem>
142         <para>
143           Recover the data. Turn MicroPeak off and then back on. MicroPeak
144           will blink out the maximum height for the last flight. Turn
145           MicroPeak back off to conserve battery power.
146         </para>
147       </listitem>
148     </itemizedlist>
149   </chapter>
150   <chapter>
151     <title>Handling Precautions</title>
152     <para>
153       All Altus Metrum products are sophisticated electronic devices.  
154       When handled gently and properly installed in an air-frame, they
155       will deliver impressive results.  However, as with all electronic 
156       devices, there are some precautions you must take.
157     </para>
158     <para>
159       The CR1025 Lithium batteries have an
160       extraordinary power density.  This is great because we can fly with
161       much less battery mass... but if they are punctured
162       or their contacts are allowed to short, they can and will release their
163       energy very rapidly!
164       Thus we recommend that you take some care when handling MicroPeak
165       to keep conductive material from coming in contact with the exposed metal elements.
166     </para>
167     <para>
168       The barometric sensor used in MicroPeak is sensitive to
169       sunlight. Please consider this when designing an
170       installation. Many model rockets with payload bays use clear
171       plastic for the payload bay. Replacing these with an opaque
172       cardboard tube, painting them, or wrapping them with a layer of
173       masking tape are all reasonable approaches to keep the sensor
174       out of direct sunlight.
175     </para>
176     <para>
177       The barometric sensor sampling ports must be able to "breathe",
178       both by not being covered by foam or tape or other materials that might
179       directly block the hole on the top of the sensor, and also by having a
180       suitable static vent to outside air.
181     </para>
182     <para>
183       As with all other rocketry electronics, Altus Metrum altimeters must 
184       be protected from exposure to corrosive motor exhaust and ejection 
185       charge gasses.
186     </para>
187   </chapter>
188   <chapter>
189     <title>The MicroPeak USB adapter</title>
190     <para>
191       MicroPeak stores barometric pressure information for the first
192       48 seconds of the flight in on-board non-volatile memory. The
193       contents of this memory can be downloaded to a computer using
194       the MicroPeak USB adapter.
195     </para>
196     <section>
197       <title>Installing the MicroPeak software</title>
198       <para>
199         The MicroPeak application runs on Linux, Mac OS X and
200         Windows. You can download the latest version from
201         <ulink url="http://altusmetrum.org/AltOS"/>.
202       </para>
203       <para>
204         On Mac OS X and Windows, the FTDI USB device driver needs to
205         be installed. A compatible version of this driver is included
206         with the MicroPeak application, but you may want to download a
207         newer version from <ulink
208         url="http://www.ftdichip.com/FTDrivers.htm"/>.
209       </para>
210     </section>
211     <section>
212       <title>Downloading Micro Peak data</title>
213       <itemizedlist>
214         <listitem>
215           <para>
216             Connect the MicroPeak USB adapter to a USB cable and plug it
217             in to your computer.
218           </para>
219         </listitem>
220         <listitem>
221           <para>
222             Start the MicroPeak application, locate the File menu and
223             select the Download entry.
224           </para>
225         </listitem>
226         <listitem>
227           <para>
228             The MicroPeak USB adapter has a small phototransistor on
229             the end of the board furthest from the USB
230             connector. Locate this and place the LED on the MicroPeak
231             directly in contact with it. The MicroPeak LED and the
232             MicroPeak USB adapter photo need to be touching—even a
233             millimeters of space between them will reduce the light
234             intensity from the LED enough that the phototransistor
235             will not sense it. Turn on the MicroPeak board and adjust
236             the position until the blue LED on the MicroPeak USB
237             adapter blinks in time with the orange LED on the
238             MicroPeak board.
239           </para>
240         </listitem>
241         <listitem>
242           <para>
243             After the maximum flight height is reported, MicroPeak will
244             pause for a few seconds, blink the LED four times rapidly
245             and then send the data in one long blur on the LED. The
246             MicroPeak application should receive the data. When it does,
247             it will present the data in a graph and offer to save the
248             data to a file. If not, you can power cycle the MicroPeak
249             board and try again.
250           </para>
251         </listitem>
252       </itemizedlist>
253     </section>
254     <section>
255       <title>Analyzing MicroPeak Data</title>
256       <para>
257         The MicroPeak application can present flight data in the form
258         of a graph, a collection of computed statistics or in tabular
259         form.
260       </para>
261       <para>
262         MicroPeak collects raw barometric pressure data which is
263         then used to compute the remaining data. Altitude is computed
264         through a standard atmospheric model. Absolute error in this
265         data will be affected by local atmospheric
266         conditions. Fortunately, these errors tend to mostly cancel
267         out, so the error in the height computation is much smaller
268         than the error in altitude would be.
269       </para>
270       <para>
271         Speed and acceleration are computed by first smoothing the
272         height data with a Gaussian window averaging filter. For speed
273         data, this average uses seven samples. For acceleration data,
274         eleven samples are used. These were chosen to provide
275         reasonably smooth speed and acceleration data, which would
276         otherwise be swamped with noise.
277       </para>
278       <para>
279         Under the Graph tab, the height, speed and acceleration values
280         are displayed together. You can zoom in on the graph by
281         clicking and dragging to sweep out an area of
282         interest. Right-click on the plot to bring up a menu that will
283         let you save, copy or print the graph.
284       </para>
285       <para>
286         The Statistics tab presents overall data from the flight. Note
287         that the Maximum height value is taken from the minumum
288         pressure captured in flight, and may be different from the
289         apparant apogee value as the on-board data are sampled twice
290         as fast as the recorded values, or because the true apogee
291         occurred after the on-board memory was full. Each value is
292         presented in several units as appropriate.
293       </para>
294       <para>
295         A table consisting of the both the raw barometric pressure
296         data and values computed from that for each recorded time.
297       </para>
298       <para>
299         The File menu has operations to open existing flight logs,
300         Download new data from MicroPeak, Save a copy of the flight
301         log to a new file, Export the tabular data (as seen in the Raw
302         Data tab) to a file, change the application Preferences, Close
303         the current window or close all windows and Exit the
304         application.
305       </para>
306     </section>
307     <section>
308       <title>Configuring the MicroPeak application</title>
309       <para>
310         The MicroPeak application has a few user settings which are
311         configured through the Preferences dialog, which can be
312         accessed from the File menu.
313       <itemizedlist>
314         <listitem>
315           <para>
316             The Log Directory is where flight data will be saved to
317             and loaded from by default. Of course, you can always
318             navigate to other directories in the file chooser windows,
319             this setting is just the starting point.
320           </para>
321         </listitem>
322         <listitem>
323           <para>
324             If you prefer to see your graph data in feet and
325             miles per hour instead of meters and meters per second,
326             you can select Imperial Units.
327           </para>
328         </listitem>
329         <listitem>
330           <para>
331             To see what data is actually arriving over the serial
332             port, start the MicroPeak application from a command
333             prompt and select the Serial Debug option. This can be
334             useful in debugging serial communication problems, but
335             most people need never choose this.
336           </para>
337         </listitem>
338         <listitem>
339           <para>
340             You can adjust the size of the text in the Statistics tab
341             by changing the Font size preference. There are three
342             settings, with luck one will both fit on your screen and
343             provide readable values.
344           </para>
345         </listitem>
346         <listitem>
347           <para>
348             The Look &amp; feel menu shows a list of available
349             application appearance choices. By default, the MicroPeak
350             application tries to blend in with other applications, but
351             you may choose some other appearance if you like.
352           </para>
353         </listitem>
354       </itemizedlist>
355       </para>
356       <para>
357         Note that MicroPeak shares a subset of the AltosUI
358         preferences, so if you use both of these applications, change
359         in one application will affect the other.
360       </para>
361     </section>
362   </chapter>
363   <chapter>
364     <title>Technical Information</title>
365     <section>
366       <title>Barometric Sensor</title>
367       <para>
368         MicroPeak uses the Measurement Specialties MS5607 sensor. This
369         has a range of 120kPa to 1kPa with an absolute accuracy of
370         150Pa and a resolution of 2.4Pa.
371       </para>
372       <para>
373         The pressure range corresponds roughly to an altitude range of
374         -1500m (-4900 feet) to 31000m (102000 feet), while the
375         resolution is approximately 20cm (8 inches) near sea level and
376         60cm (24in) at 10000m (33000 feet).
377       </para>
378       <para>
379         Ground pressure is computed from an average of 16 samples,
380         taken while the altimeter is at rest. Flight pressure is
381         computed from a Kalman filter designed to smooth out any minor
382         noise in the sensor values. 
383       </para>
384     </section>
385     <section>
386       <title>Micro-controller</title>
387       <para>
388         MicroPeak uses an Atmel ATtiny85 micro-controller. This tiny
389         CPU contains 8kB of flash for the application, 512B of RAM for
390         temporary data storage and 512B of EEPROM for non-volatile
391         storage of previous flight data.
392       </para>
393       <para>
394         The ATtiny85 has a low-power mode which turns off all of the
395         clocks and powers down most of the internal components. In
396         this mode, the chip consumes only .1μA of power. MicroPeak
397         uses this mode once the flight has ended to preserve battery
398         power.
399       </para>
400     </section>
401     <section>
402       <title>Lithium Battery</title>
403       <para>
404         The CR1025 battery used by MicroPeak holes 30mAh of power,
405         which is sufficient to run for over 40 hours. Because
406         MicroPeak powers down on landing, run time includes only time
407         sitting on the launch pad or during flight.
408       </para>
409       <para>
410         The large positive terminal (+) is usually marked, while the
411         smaller negative terminal is not. Make sure you install the
412         battery with the positive terminal facing away from the
413         circuit board where it will be in contact with the metal
414         battery holder. A small pad on the circuit board makes contact
415         with the negative battery terminal.
416       </para>
417       <para>
418         Shipping restrictions may prevent us from including a CR1025
419         battery with MicroPeak. If so, many stores carry CR1025
420         batteries as they are commonly used in small electronic
421         devices such as flash lights.
422       </para>
423     </section>
424     <section>
425       <title>Atmospheric Model</title>
426       <para>
427         MicroPeak contains a fixed atmospheric model which is used to
428         convert barometric pressure into altitude. The model was
429         converted into a 469-element piece wise linear approximation
430         which is then used to compute the altitude of the ground and
431         apogee. The difference between these represents the maximum
432         height of the flight.
433       </para>
434       <para>
435         The model assumes a particular set of atmospheric conditions,
436         which while a reasonable average cannot represent the changing
437         nature of the real atmosphere. Fortunately, for flights
438         reasonably close to the ground, the effect of this global
439         inaccuracy are largely canceled out when the computed ground
440         altitude is subtracted from the computed apogee altitude, so
441         the resulting height is more accurate than either the ground
442         or apogee altitudes.
443       </para>
444     </section>
445     <section>
446       <title>Mechanical Considerations</title>
447       <para>
448         MicroPeak is designed to be rugged enough for typical rocketry
449         applications. It contains two moving parts, the battery holder
450         and the power switch, which were selected for their
451         ruggedness.
452       </para>
453       <para>
454         The MicroPeak battery holder is designed to withstand impact
455         up to 150g without breaking contact (or, worse yet, causing
456         the battery to fall out). That means it should stand up to
457         almost any launch you care to try, and should withstand fairly
458         rough landings.
459       </para>
460       <para>
461         The power switch is designed to withstand up to 50g forces in
462         any direction. Because it is a sliding switch, orienting the
463         switch perpendicular to the direction of rocket travel will
464         serve to further protect the switch from launch forces.
465       </para>
466     </section>
467     <section>
468       <title>On-board data storage</title>
469       <para>
470         The ATtiny85 has 512 bytes of non-volatile storage, separate
471         from the code storage memory. The MicroPeak firmware uses this
472         to store information about the last completed
473         flight. Barometric measurements from the ground before launch
474         and at apogee are stored, and used at power-on to compute the
475         height of the last flight.
476       </para>
477       <para>
478         In addition to the data used to present the height of the last
479         flight, MicroPeak also stores barometric information sampled
480         at regular intervals during the flight. This information can
481         be extracted from MicroPeak through any AVR programming
482         tool.
483       </para>
484       <table frame='all'>
485         <title>MicroPeak EEPROM Data Storage</title>
486         <tgroup cols='3' align='center' colsep='1' rowsep='1'>
487           <colspec align='center' colwidth='2*' colname='Address'/>
488           <colspec align='center' colwidth='*' colname='Size (bytes)'/>
489           <colspec align='left' colwidth='7*' colname='Description'/>
490           <thead>
491             <row>
492               <entry align='center'>Address</entry>
493               <entry align='center'>Size (bytes)</entry>
494               <entry align='center'>Description</entry>
495             </row>
496           </thead>
497           <tbody>
498             <row>
499               <entry>0x000</entry>
500               <entry>4</entry>
501               <entry>Average ground pressure (Pa)</entry>
502             </row>
503             <row>
504               <entry>0x004</entry>
505               <entry>4</entry>
506               <entry>Minimum flight pressure (Pa)</entry>
507             </row>
508             <row>
509               <entry>0x008</entry>
510               <entry>2</entry>
511               <entry>Number of in-flight samples</entry>
512             </row>
513             <row>
514               <entry>0x00a … 0x1fe</entry>
515               <entry>2</entry>
516               <entry>Instantaneous flight pressure (Pa) low 16 bits</entry>
517             </row>
518           </tbody>
519         </tgroup>
520       </table>
521       <para>
522         All EEPROM data are stored least-significant byte first. The
523         instantaneous flight pressure data are stored without the
524         upper 16 bits of data. The upper bits can be reconstructed
525         from the previous sample, assuming that pressure doesn't
526         change by more more than 32kPa in a single sample
527         interval. Note that this pressure data is <emphasis>not</emphasis>
528         filtered in any way, while both the recorded ground and apogee
529         pressure values are, so you shouldn't expect the minimum
530         instantaneous pressure value to match the recorded minimum
531         pressure value exactly.
532       </para>
533       <para>
534         MicroPeak samples pressure every 96ms, but stores only every
535         other sample in the EEPROM. This provides for 251 pressure
536         samples at 192ms intervals, or 48.192s of storage. The clock
537         used for these samples is a factory calibrated RC circuit
538         built into the ATtiny85 and is accurate only to within ±10% at
539         25°C. So, you can count on the pressure data being accurate,
540         but speed or acceleration data computed from this will be
541         limited by the accuracy of this clock.
542       </para>
543     </section>
544     <section>
545       <title>MicroPeak Programming Interface</title>
546       <para>
547         MicroPeak exposes a standard 6-pin AVR programming interface,
548         but not using the usual 2x3 array of pins on 0.1"
549         centers. Instead, there is a single row of tiny 0.60mm ×
550         0.85mm pads on 1.20mm centers exposed near the edge of the
551         circuit board. We couldn't find any connector that was
552         small enough to include on the circuit board.
553       </para>
554       <para>
555         In lieu of an actual connector, the easiest way to connect to
556         the bare pads is through a set of Pogo pins. These
557         spring-loaded contacts are designed to connect in precisely
558         this way. We've designed a programming jig, the MicroPeak
559         Pogo Pin board which provides a standard AVR interface on one
560         end and a recessed slot for MicroPeak to align the board with
561         the Pogo Pins.
562       </para>
563       <para>
564         The MicroPeak Pogo Pin board is not a complete AVR programmer,
565         it is an interface board that provides a 3.3V regulated power
566         supply to run the MicroPeak via USB and a standard 6-pin AVR
567         programming interface with the usual 2x3 grid of pins on 0.1"
568         centers. This can be connected to any AVR programming
569         dongle.
570       </para>
571       <para>
572         The AVR programming interface cannot run faster than ¼ of the
573         AVR CPU clock frequency. Because MicroPeak runs at 250kHz to
574         save power, you must configure your AVR programming system to
575         clock the AVR programming interface at no faster than
576         62.5kHz, or a clock period of 32µS.
577       </para>
578     </section>
579   </chapter>
580 </book>
581 <!--  LocalWords:  Altusmetrum MicroPeak
582 -->