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