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">
7 <title>AltOS Telemetry</title>
8 <subtitle>Packet Definitions</subtitle>
10 <firstname>Keith</firstname>
11 <surname>Packard</surname>
15 <holder>Keith Packard</holder>
19 This document is released under the terms of the
20 <ulink url="http://creativecommons.org/licenses/by-sa/3.0/">
21 Creative Commons ShareAlike 3.0
28 <revnumber>0.1</revnumber>
29 <date>01 July 2011</date>
30 <revremark>Initial content</revremark>
35 <title>History and Motivation</title>
37 The original AltoOS telemetry mechanism encoded everything
38 available piece of information on the TeleMetrum hardware into a
39 single unified packet. Initially, the packets contained very
40 little data—some raw sensor readings along with the current GPS
41 coordinates when a GPS receiver was connected. Over time, the
42 amount of data grew to include sensor calibration data, GPS
43 satellite information and a host of internal state information
44 designed to help diagnose flight failures in case of a loss of
45 the on-board flight data.
48 Because every packet contained all of the data, packets were
49 huge—95 bytes long. Much of the information was also specific to
50 the TeleMetrum hardware. With the introduction of the TeleMini
51 flight computer, most of the data contained in the telemetry
52 packets was unavailable. Initially, a shorter, but still
53 comprehensive packet was implemented. This required that the
54 ground station be pre-configured as to which kind of packet to
58 The development of several companion boards also made the
59 shortcomings evident—each companion board would want to include
60 telemetry data in the radio link; with the original design, the
61 packet would have to hold the new data as well, requiring
62 additional TeleMetrum and ground station changes.
66 <title>Packet Format Design</title>
68 AltOS telemetry data is split into multiple different packets,
69 all the same size, but each includs an identifier so that the
70 ground station can distinguish among different types. A single
71 flight board will transmit multiple packet types, each type on a
72 different schedule. The ground software need look for only a
73 single packet size, and then decode the information within the
74 packet and merge data from multiple packets to construct the
75 full flight computer state.
78 Each AltOS packet is 32 bytes long. This size was chosen based
79 on the known telemetry data requirements. The power of two size
80 allows them to be stored easily in flash memory without having
81 them split across blocks or leaving gaps at the end.
84 All packet types start with a five byte header which encodes the
85 device serial number, device clock value and the packet
86 type. The remaining 27 bytes encode type-specific data.
90 <title>Packet Formats</title>
91 This section first defines the packet header common to all packets
92 and then the per-packet data layout.
94 <title>Packet Header</title>
96 <title>Telemetry Packet Header</title>
97 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
98 <colspec align='right' colwidth='*' colname='Offset'/>
99 <colspec align='center' colwidth='3*' colname='Data Type'/>
100 <colspec align='left' colwidth='3*' colname='Name'/>
101 <colspec align='left' colwidth='9*' colname='Description'/>
104 <entry align='center'>Offset</entry>
105 <entry align='center'>Data Type</entry>
106 <entry align='center'>Name</entry>
107 <entry align='center'>Description</entry>
113 <entry>uint16_t</entry>
114 <entry>serial</entry>
115 <entry>Device serial Number</entry>
119 <entry>uint16_t</entry>
121 <entry>Device time in 100ths of a second</entry>
125 <entry>uint8_t</entry>
127 <entry>Packet type</entry>
136 Each packet starts with these five bytes which serve to identify
137 which device has transmitted the packet, when it was transmitted
138 and what the rest of the packet contains.
142 <title>Sensor Data</title>
143 <informaltable frame='none' label='' tocentry='0'>
144 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
145 <colspec align='center' colwidth='*' colname='Offset'/>
146 <colspec align='left' colwidth='3*' colname='Description'/>
150 <entry>Description</entry>
156 <entry>TeleMetrum Sensor Data</entry>
160 <entry>TeleMini Sensor Data</entry>
164 <entry>TeleNano Sensor Data</entry>
170 TeleMetrum, TeleMini and TeleNano share this same packet
171 format for sensor data. Each uses a distinct packet type so
172 that the receiver knows which data values are valid and which
176 <title>Sensor Packet Contents</title>
177 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
178 <colspec align='right' colwidth='*' colname='Offset'/>
179 <colspec align='center' colwidth='3*' colname='Data Type'/>
180 <colspec align='left' colwidth='3*' colname='Name'/>
181 <colspec align='left' colwidth='9*' colname='Description'/>
184 <entry align='center'>Offset</entry>
185 <entry align='center'>Data Type</entry>
186 <entry align='center'>Name</entry>
187 <entry align='center'>Description</entry>
192 <entry>5</entry><entry>uint8_t</entry><entry>state</entry><entry>Flight state</entry>
195 <entry>6</entry><entry>int16_t</entry><entry>accel</entry><entry>accelerometer (TM only)</entry>
198 <entry>8</entry><entry>int16_t</entry><entry>pres</entry><entry>pressure sensor</entry>
201 <entry>10</entry><entry>int16_t</entry><entry>temp</entry><entry>temperature sensor</entry>
204 <entry>12</entry><entry>int16_t</entry><entry>v_batt</entry><entry>battery voltage</entry>
207 <entry>14</entry><entry>int16_t</entry><entry>sense_d</entry><entry>drogue continuity sense (TM/Tm)</entry>
210 <entry>16</entry><entry>int16_t</entry><entry>sense_m</entry><entry>main continuity sense (TM/Tm)</entry>
213 <entry>18</entry><entry>int16_t</entry><entry>accel</entry><entry>m/s² * 16</entry>
216 <entry>20</entry><entry>int16_t</entry><entry>speed</entry><entry>m/s * 16</entry>
219 <entry>22</entry><entry>int16_t</entry><entry>height</entry><entry>m</entry>
222 <entry>24</entry><entry>int16_t</entry><entry>ground_accel</entry><entry>TM</entry>
225 <entry>26</entry><entry>int16_t</entry><entry>ground_pres</entry><entry>Average barometer reading on ground</entry>
228 <entry>28</entry><entry>int16_t</entry><entry>accel_plus_g</entry><entry>TM</entry>
231 <entry>30</entry><entry>int16_t</entry><entry>accel_minus_g</entry><entry>TM</entry>
241 <title>Configuration Data</title>
242 <informaltable frame='none' label='' tocentry='0'>
243 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
244 <colspec align='center' colwidth='*' colname='Offset'/>
245 <colspec align='left' colwidth='3*' colname='Description'/>
249 <entry>Description</entry>
255 <entry>Configuration Data</entry>
261 <title>Sensor Packet Contents</title>
262 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
263 <colspec align='right' colwidth='*' colname='Offset'/>
264 <colspec align='center' colwidth='3*' colname='Data Type'/>
265 <colspec align='left' colwidth='3*' colname='Name'/>
266 <colspec align='left' colwidth='9*' colname='Description'/>
269 <entry align='center'>Offset</entry>
270 <entry align='center'>Data Type</entry>
271 <entry align='center'>Name</entry>
272 <entry align='center'>Description</entry>
277 <entry>5</entry><entry>uint8_t</entry><entry>type</entry><entry>Device type</entry>
280 <entry>6</entry><entry>uint16_t</entry><entry>flight</entry><entry>Flight number</entry>
283 <entry>8</entry><entry>uint8_t</entry><entry>config_major</entry><entry>Config major version</entry>
286 <entry>9</entry><entry>uint8_t</entry><entry>config_minor</entry><entry>Config minor version</entry>
289 <entry>10</entry><entry>uint16_t</entry><entry>main_deploy</entry><entry>Main deploy alt in meters</entry>
292 <entry>12</entry><entry>uint32_t</entry><entry>flight_log_max</entry><entry>Maximum flight log size (B)</entry>
295 <entry>16</entry><entry>char</entry><entry>callsign[8]</entry><entry>Radio operator identifier</entry>
298 <entry>24</entry><entry>char</entry><entry>version[8]</entry><entry>Software version identifier</entry>
308 <title>GPS Location</title>
309 <informaltable frame='none' label='' tocentry='0'>
310 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
311 <colspec align='center' colwidth='*' colname='Offset'/>
312 <colspec align='left' colwidth='3*' colname='Description'/>
316 <entry>Description</entry>
322 <entry>GPS Location</entry>
328 <title>GPS Location Packet Contents</title>
329 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
330 <colspec align='right' colwidth='*' colname='Offset'/>
331 <colspec align='center' colwidth='3*' colname='Data Type'/>
332 <colspec align='left' colwidth='3*' colname='Name'/>
333 <colspec align='left' colwidth='9*' colname='Description'/>
336 <entry align='center'>Offset</entry>
337 <entry align='center'>Data Type</entry>
338 <entry align='center'>Name</entry>
339 <entry align='center'>Description</entry>
344 <entry>5</entry><entry>uint8_t</entry><entry>flags</entry><entry>GPS Flags (see below)</entry>
347 <entry>6</entry><entry>int16_t</entry><entry>altitude</entry><entry>m</entry>
350 <entry>8</entry><entry>int32_t</entry><entry>latitude</entry><entry>degrees * 10<superscript>7</superscript></entry>
353 <entry>12</entry><entry>int32_t</entry><entry>longitude</entry><entry>degrees * 10<superscript>7</superscript></entry>
356 <entry>16</entry><entry>uint8_t</entry><entry>year</entry>
359 <entry>17</entry><entry>uint8_t</entry><entry>month</entry>
362 <entry>18</entry><entry>uint8_t</entry><entry>day</entry>
365 <entry>19</entry><entry>uint8_t</entry><entry>hour</entry>
368 <entry>20</entry><entry>uint8_t</entry><entry>minute</entry>
371 <entry>21</entry><entry>uint8_t</entry><entry>second</entry>
374 <entry>22</entry><entry>uint8_t</entry><entry>pdop</entry><entry>* 5</entry>
377 <entry>23</entry><entry>uint8_t</entry><entry>hdop</entry><entry>* 5</entry>
380 <entry>24</entry><entry>uint8_t</entry><entry>vdop</entry><entry>* 5</entry>
383 <entry>25</entry><entry>uint8_t</entry><entry>mode</entry><entry>N, A, D, E, M, S</entry>
386 <entry>26</entry><entry>uint16_t</entry><entry>ground_speed</entry><entry>cm/s</entry>
389 <entry>28</entry><entry>uint8_t</entry><entry>course</entry><entry>/ 2</entry>
392 <entry>29</entry><entry>uint8_t</entry><entry>unused[2]</entry>
402 <title>GPS Satellite Data</title>
403 <informaltable frame='none' label='' tocentry='0'>
404 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
405 <colspec align='center' colwidth='*' colname='Offset'/>
406 <colspec align='left' colwidth='3*' colname='Description'/>
410 <entry>Description</entry>
416 <entry>GPS Satellite Data</entry>
422 <title>GPS Satellite Data Contents</title>
423 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
424 <colspec align='right' colwidth='*' colname='Offset'/>
425 <colspec align='center' colwidth='3*' colname='Data Type'/>
426 <colspec align='left' colwidth='3*' colname='Name'/>
427 <colspec align='left' colwidth='9*' colname='Description'/>
430 <entry align='center'>Offset</entry>
431 <entry align='center'>Data Type</entry>
432 <entry align='center'>Name</entry>
433 <entry align='center'>Description</entry>
438 <entry>5</entry><entry>uint8_t</entry><entry>channels</entry>
441 <entry>6</entry><entry>uint8_t</entry><entry>sat_0_id</entry>
444 <entry>7</entry><entry>uint8_t</entry><entry>sat_0_c_n_1</entry>
447 <entry>8</entry><entry>uint8_t</entry><entry>sat_1_id</entry>
450 <entry>9</entry><entry>uint8_t</entry><entry>sat_1_c_n_1</entry>
453 <entry>10</entry><entry>uint8_t</entry><entry>sat_2_id</entry>
456 <entry>11</entry><entry>uint8_t</entry><entry>sat_2_c_n_1</entry>
459 <entry>12</entry><entry>uint8_t</entry><entry>sat_3_id</entry>
462 <entry>13</entry><entry>uint8_t</entry><entry>sat_3_c_n_1</entry>
465 <entry>14</entry><entry>uint8_t</entry><entry>sat_4_id</entry>
468 <entry>15</entry><entry>uint8_t</entry><entry>sat_4_c_n_1</entry>
471 <entry>16</entry><entry>uint8_t</entry><entry>sat_5_id</entry>
474 <entry>17</entry><entry>uint8_t</entry><entry>sat_5_c_n_1</entry>
477 <entry>18</entry><entry>uint8_t</entry><entry>sat_6_id</entry>
480 <entry>19</entry><entry>uint8_t</entry><entry>sat_6_c_n_1</entry>
483 <entry>20</entry><entry>uint8_t</entry><entry>sat_7_id</entry>
486 <entry>21</entry><entry>uint8_t</entry><entry>sat_7_c_n_1</entry>
489 <entry>22</entry><entry>uint8_t</entry><entry>sat_8_id</entry>
492 <entry>23</entry><entry>uint8_t</entry><entry>sat_8_c_n_1</entry>
495 <entry>24</entry><entry>uint8_t</entry><entry>sat_9_id</entry>
498 <entry>25</entry><entry>uint8_t</entry><entry>sat_9_c_n_1</entry>
501 <entry>26</entry><entry>uint8_t</entry><entry>sat_10_id</entry>
504 <entry>27</entry><entry>uint8_t</entry><entry>sat_10_c_n_1</entry>
507 <entry>28</entry><entry>uint8_t</entry><entry>sat_11_id</entry>
510 <entry>29</entry><entry>uint8_t</entry><entry>sat_11_c_n_1</entry>
513 <entry>30</entry><entry>uin8_t</entry><entry>unused30</entry>
516 <entry>31</entry><entry>uin8_t</entry><entry>unused31</entry>
533 Rethinking this (over IRC), and thinking about telemetry from a
534 companion board, it looks like 32 bytes per packet would be better (12
535 channels of A/D from telescience would require 24 bytes).
537 Packet type 0x06: GPS satellites
543 <entry>5</entry><entry>uint8_t</entry><entry>channels</entry>
544 <entry>6</entry><entry>uint16_t</entry><entry>data[12]</entry>
545 <entry>30</entry><entry>uint8_t</entry><entry>unused[2]</entry>
548 [ 2-line signature. Click/Enter to show. ]
550 keith.packard@intel.com
551 [ application/pgp-signature ]
552 Keith Packard <keithp@keithp.com> (Mon. 18:59) (me sent)
553 Subject: Re: New telemetry ideas
555 Date: Mon, 27 Jun 2011 18:59:08 -0700
559 On Mon, 27 Jun 2011 14:25:00 -0700, Keith Packard <keithp@keithp.com> wrote:
560 Non-text part: multipart/signed
562 > Packet type 0x05: GPS location
563 > 1 packet per second
567 Let's add another field here:
569 <entry>6</entry><entry>int16_t</entry><entry>gps_tick</entry><entry>tick when GPS data was received</entry>
571 That leaves a single byte unused