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