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>Packet Format Design</title>
37 AltOS telemetry data is split into multiple different packets,
38 all the same size, but each includs an identifier so that the
39 ground station can distinguish among different types. A single
40 flight board will transmit multiple packet types, each type on a
41 different schedule. The ground software need look for only a
42 single packet size, and then decode the information within the
43 packet and merge data from multiple packets to construct the
44 full flight computer state.
47 Each AltOS packet is 32 bytes long. This size was chosen based
48 on the known telemetry data requirements. The power of two size
49 allows them to be stored easily in flash memory without having
50 them split across blocks or leaving gaps at the end.
53 All packet types start with a five byte header which encodes the
54 device serial number, device clock value and the packet
55 type. The remaining 27 bytes encode type-specific data.
59 <title>Packet Formats</title>
60 This section first defines the packet header common to all packets
61 and then the per-packet data layout.
63 <title>Packet Header</title>
65 <title>Telemetry Packet Header</title>
66 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
67 <colspec align='center' colwidth='*' colname='Offset'/>
68 <colspec align='center' colwidth='3*' colname='Data Type'/>
69 <colspec align='left' colwidth='3*' colname='Name'/>
70 <colspec align='left' colwidth='9*' colname='Description'/>
73 <entry align='center'>Offset</entry>
74 <entry align='center'>Data Type</entry>
75 <entry align='center'>Name</entry>
76 <entry align='center'>Description</entry>
82 <entry>uint16_t</entry>
84 <entry>Device serial Number</entry>
88 <entry>uint16_t</entry>
90 <entry>Device time in 100ths of a second</entry>
94 <entry>uint8_t</entry>
96 <entry>Packet type</entry>
105 Each packet starts with these five bytes which serve to identify
106 which device has transmitted the packet, when it was transmitted
107 and what the rest of the packet contains.
111 <title>Sensor Data</title>
112 <informaltable frame='none' label='' tocentry='0'>
113 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
114 <colspec align='center' colwidth='*' colname='Offset'/>
115 <colspec align='left' colwidth='3*' colname='Description'/>
119 <entry>Description</entry>
125 <entry>TeleMetrum Sensor Data</entry>
129 <entry>TeleMini Sensor Data</entry>
133 <entry>TeleNano Sensor Data</entry>
139 TeleMetrum, TeleMini and TeleNano share this same packet
140 format for sensor data. Each uses a distinct packet type so
141 that the receiver knows which data values are valid and which
145 Sensor Data packets are transmitted once per second on the
146 ground, 10 times per second during ascent and once per second
147 during descent and landing
150 <title>Sensor Packet Contents</title>
151 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
152 <colspec align='center' colwidth='*' colname='Offset'/>
153 <colspec align='center' colwidth='3*' colname='Data Type'/>
154 <colspec align='left' colwidth='3*' colname='Name'/>
155 <colspec align='left' colwidth='9*' colname='Description'/>
158 <entry align='center'>Offset</entry>
159 <entry align='center'>Data Type</entry>
160 <entry align='center'>Name</entry>
161 <entry align='center'>Description</entry>
166 <entry>5</entry><entry>uint8_t</entry><entry>state</entry><entry>Flight state</entry>
169 <entry>6</entry><entry>int16_t</entry><entry>accel</entry><entry>accelerometer (TM only)</entry>
172 <entry>8</entry><entry>int16_t</entry><entry>pres</entry><entry>pressure sensor</entry>
175 <entry>10</entry><entry>int16_t</entry><entry>temp</entry><entry>temperature sensor</entry>
178 <entry>12</entry><entry>int16_t</entry><entry>v_batt</entry><entry>battery voltage</entry>
181 <entry>14</entry><entry>int16_t</entry><entry>sense_d</entry><entry>drogue continuity sense (TM/Tm)</entry>
184 <entry>16</entry><entry>int16_t</entry><entry>sense_m</entry><entry>main continuity sense (TM/Tm)</entry>
187 <entry>18</entry><entry>int16_t</entry><entry>acceleration</entry><entry>m/s² * 16</entry>
190 <entry>20</entry><entry>int16_t</entry><entry>speed</entry><entry>m/s * 16</entry>
193 <entry>22</entry><entry>int16_t</entry><entry>height</entry><entry>m</entry>
196 <entry>24</entry><entry>int16_t</entry><entry>ground_pres</entry><entry>Average barometer reading on ground</entry>
199 <entry>26</entry><entry>int16_t</entry><entry>ground_accel</entry><entry>TM</entry>
202 <entry>28</entry><entry>int16_t</entry><entry>accel_plus_g</entry><entry>TM</entry>
205 <entry>30</entry><entry>int16_t</entry><entry>accel_minus_g</entry><entry>TM</entry>
215 <title>Configuration Data</title>
216 <informaltable frame='none' label='' tocentry='0'>
217 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
218 <colspec align='center' colwidth='*' colname='Offset'/>
219 <colspec align='left' colwidth='3*' colname='Description'/>
223 <entry>Description</entry>
229 <entry>Configuration Data</entry>
235 This provides a description of the software installed on the
236 flight computer as well as any user-specified configuration data.
239 Configuration data packets are transmitted once per second
240 during all phases of the flight
243 <title>Sensor Packet Contents</title>
244 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
245 <colspec align='center' colwidth='*' colname='Offset'/>
246 <colspec align='center' colwidth='3*' colname='Data Type'/>
247 <colspec align='left' colwidth='3*' colname='Name'/>
248 <colspec align='left' colwidth='9*' colname='Description'/>
251 <entry align='center'>Offset</entry>
252 <entry align='center'>Data Type</entry>
253 <entry align='center'>Name</entry>
254 <entry align='center'>Description</entry>
259 <entry>5</entry><entry>uint8_t</entry><entry>type</entry><entry>Device type</entry>
262 <entry>6</entry><entry>uint16_t</entry><entry>flight</entry><entry>Flight number</entry>
265 <entry>8</entry><entry>uint8_t</entry><entry>config_major</entry><entry>Config major version</entry>
268 <entry>9</entry><entry>uint8_t</entry><entry>config_minor</entry><entry>Config minor version</entry>
271 <entry>10</entry><entry>uint16_t</entry><entry>apogee_delay</entry>
272 <entry>Apogee deploy delay in seconds</entry>
275 <entry>12</entry><entry>uint16_t</entry><entry>main_deploy</entry><entry>Main deploy alt in meters</entry>
278 <entry>14</entry><entry>uint16_t</entry><entry>flight_log_max</entry>
279 <entry>Maximum flight log size (kB)</entry>
282 <entry>16</entry><entry>char</entry><entry>callsign[8]</entry><entry>Radio operator identifier</entry>
285 <entry>24</entry><entry>char</entry><entry>version[8]</entry><entry>Software version identifier</entry>
295 <title>GPS Location</title>
296 <informaltable frame='none' label='' tocentry='0'>
297 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
298 <colspec align='center' colwidth='*' colname='Offset'/>
299 <colspec align='left' colwidth='3*' colname='Description'/>
303 <entry>Description</entry>
309 <entry>GPS Location</entry>
315 This packet provides all of the information available from the
316 Venus SkyTraq GPS receiver—position, time, speed and precision
320 GPS Location packets are transmitted once per second during
321 all phases of the flight
324 <title>GPS Location Packet Contents</title>
325 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
326 <colspec align='center' colwidth='*' colname='Offset'/>
327 <colspec align='center' colwidth='3*' colname='Data Type'/>
328 <colspec align='left' colwidth='3*' colname='Name'/>
329 <colspec align='left' colwidth='9*' colname='Description'/>
332 <entry align='center'>Offset</entry>
333 <entry align='center'>Data Type</entry>
334 <entry align='center'>Name</entry>
335 <entry align='center'>Description</entry>
340 <entry>5</entry><entry>uint8_t</entry><entry>flags</entry>
341 <entry>See GPS Flags table below</entry>
344 <entry>6</entry><entry>int16_t</entry><entry>altitude</entry><entry>m</entry>
347 <entry>8</entry><entry>int32_t</entry><entry>latitude</entry><entry>degrees * 10<superscript>7</superscript></entry>
350 <entry>12</entry><entry>int32_t</entry><entry>longitude</entry><entry>degrees * 10<superscript>7</superscript></entry>
353 <entry>16</entry><entry>uint8_t</entry><entry>year</entry>
356 <entry>17</entry><entry>uint8_t</entry><entry>month</entry>
359 <entry>18</entry><entry>uint8_t</entry><entry>day</entry>
362 <entry>19</entry><entry>uint8_t</entry><entry>hour</entry>
365 <entry>20</entry><entry>uint8_t</entry><entry>minute</entry>
368 <entry>21</entry><entry>uint8_t</entry><entry>second</entry>
371 <entry>22</entry><entry>uint8_t</entry><entry>pdop</entry><entry>* 5</entry>
374 <entry>23</entry><entry>uint8_t</entry><entry>hdop</entry><entry>* 5</entry>
377 <entry>24</entry><entry>uint8_t</entry><entry>vdop</entry><entry>* 5</entry>
380 <entry>25</entry><entry>uint8_t</entry><entry>mode</entry>
381 <entry>See GPS Mode table below</entry>
384 <entry>26</entry><entry>uint16_t</entry><entry>ground_speed</entry><entry>cm/s</entry>
387 <entry>28</entry><entry>int16_t</entry><entry>climb_rate</entry><entry>cm/s</entry>
390 <entry>30</entry><entry>uint8_t</entry><entry>course</entry><entry>/ 2</entry>
393 <entry>31</entry><entry>uint8_t</entry><entry>unused[1]</entry>
402 Packed into a one byte field are status flags and the count of
403 satellites used to compute the position fix. Note that this
404 number may be lower than the number of satellites being
405 tracked; the receiver will not use information from satellites
406 with weak signals or which are close enough to the horizon to
407 have significantly degraded position accuracy.
410 <title>GPS Flags</title>
411 <tgroup cols='3' colsep='1' rowsep='1'>
412 <colspec align='center' colwidth='*' colname='bits'/>
413 <colspec align='left' colwidth='2*' colname='name'/>
414 <colspec align='left' colwidth='7*' colname='description'/>
417 <entry align='center'>Bits</entry>
418 <entry align='center'>Name</entry>
419 <entry align='center'>Description</entry>
426 <entry>Number of satellites in solution</entry>
431 <entry>GPS solution is valid</entry>
435 <entry>running</entry>
436 <entry>GPS receiver is operational</entry>
440 <entry>date_valid</entry>
441 <entry>Reported date is valid</entry>
445 <entry>course_valid</entry>
446 <entry>ground speed, course and climb rates are valid</entry>
452 Here are all of the valid GPS operational modes. Altus Metrum
453 products will only ever report 'N' (not valid), 'A'
454 (Autonomous) modes or 'E' (Estimated). The remaining modes
455 are either testing modes or require additional data.
458 <title>GPS Mode</title>
459 <tgroup cols='3' colsep='1' rowsep='1'>
460 <colspec align='center' colwidth='*' colname='value'/>
461 <colspec align='center' colwidth='3*' colname='name'/>
462 <colspec align='left' colwidth='7*' colname='description'/>
465 <entry align='center'>Mode</entry>
466 <entry align='center'>Name</entry>
467 <entry align='center'>Decsription</entry>
473 <entry>Not Valid</entry>
474 <entry>All data are invalid</entry>
478 <entry>Autonomous mode</entry>
479 <entry>Data are derived from satellite data</entry>
483 <entry>Differential Mode</entry>
485 Data are augmented with differential data from a
486 known ground station. The SkyTraq unit in TeleMetrum
487 does not support this mode
492 <entry>Estimated</entry>
494 Data are estimated using dead reckoning from the
500 <entry>Manual</entry>
501 <entry>Data were entered manually</entry>
505 <entry>Simulated</entry>
506 <entry>GPS receiver testing mode</entry>
513 <title>GPS Satellite Data</title>
514 <informaltable frame='none' label='' tocentry='0'>
515 <tgroup cols='2' align='center' colsep='1' rowsep='1'>
516 <colspec align='center' colwidth='*' colname='Offset'/>
517 <colspec align='left' colwidth='3*' colname='Description'/>
521 <entry>Description</entry>
527 <entry>GPS Satellite Data</entry>
533 This packet provides space vehicle identifiers and signal
534 quality information in the form of a C/N1 number for up to 12
535 satellites. The order of the svids is not specified.
538 GPS Satellite data are transmitted once per second during all
539 phases of the flight.
542 <title>GPS Satellite Data Contents</title>
543 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
544 <colspec align='right' colwidth='*' colname='Offset'/>
545 <colspec align='center' colwidth='3*' colname='Data Type'/>
546 <colspec align='left' colwidth='3*' colname='Name'/>
547 <colspec align='left' colwidth='9*' colname='Description'/>
550 <entry align='center'>Offset</entry>
551 <entry align='center'>Data Type</entry>
552 <entry align='center'>Name</entry>
553 <entry align='center'>Description</entry>
558 <entry>5</entry><entry>uint8_t</entry><entry>channels</entry>
559 <entry>Number of reported satellite information</entry>
562 <entry>6</entry><entry>sat_info_t</entry><entry>sats[12]</entry>
563 <entry>See Per-Satellite data table below</entry>
566 <entry>30</entry><entry>uint8_t</entry><entry>unused[2]</entry>
575 <title>GPS Per-Satellite data (sat_info_t)</title>
576 <tgroup cols='4' align='center' colsep='1' rowsep='1'>
577 <colspec align='right' colwidth='*' colname='Offset'/>
578 <colspec align='center' colwidth='3*' colname='Data Type'/>
579 <colspec align='left' colwidth='3*' colname='Name'/>
580 <colspec align='left' colwidth='9*' colname='Description'/>
583 <entry align='center'>Offset</entry>
584 <entry align='center'>Data Type</entry>
585 <entry align='center'>Name</entry>
586 <entry align='center'>Description</entry>
591 <entry>0</entry><entry>uint8_t</entry><entry>svid</entry>
592 <entry>Space Vehicle Identifier</entry>
595 <entry>1</entry><entry>uint8_t</entry><entry>c_n_1</entry>
596 <entry>C/N1 signal quality indicator</entry>
607 <title>Data Transmission</title>
609 Altus Metrum devices use the Texas Instruments CC1111
610 microcontroller which includes an integrated sub-GHz digital
611 transceiver. This transceiver is used to both transmit and
612 receive the telemetry packets. This section discusses what
613 modulation scheme is used and how this device is configured.
616 <title>Modulation Scheme</title>
618 Texas Instruments provides a tool for computing modulation
619 parameters given a desired modulation format and basic bit
620 rate. For AltOS, the basic bit rate was specified as 38 kBaud,
621 resulting in the following signal parmeters:
625 <colspec align="center" colwidth="*" colname="parameter"/>
626 <colspec align="center" text-align="." colwidth="*" colname="value"/>
627 <colspec align="center" colwidth="*" colname="description"/>
630 <entry align='center'>Parameter</entry>
631 <entry align='center'>Value</entry>
632 <entry align='center'>Description</entry>
637 <entry>Modulation</entry>
639 <entry>Gaussian Frequency Shift Keying</entry>
642 <entry>Deviation</entry>
643 <entry>20.507812 kHz</entry>
644 <entry>Frequency modulation</entry>
647 <entry>Data rate</entry>
648 <entry>38.360596 kBaud</entry>
649 <entry>Raw bit rate</entry>
652 <entry>RX Filter Bandwidth</entry>
653 <entry>93.75 kHz</entry>
654 <entry>Receiver Band pass filter bandwidth</entry>
657 <entry>IF Frequency</entry>
658 <entry>140.62 kHz</entry>
659 <entry>Receiver intermediate frequency</entry>
667 The cc1111 provides forward error correction in hardware,
668 which AltOS uses to improve reception of weak signals. The
669 overall effect of this is to halve the available bandwidth for
670 data from 38 kBaud to 19 kBaud.
672 <title>Error Correction</title>
675 <colspec align="center" colwidth="*" colname="parameter"/>
676 <colspec align="center" colwidth="*" colname="value"/>
677 <colspec align="center" colwidth="*" colname="description"/>
680 <entry align='center'>Parameter</entry>
681 <entry align='center'>Value</entry>
682 <entry align='center'>Description</entry>
687 <entry>Error Correction</entry>
688 <entry>Convolutional coding FEC</entry>
689 <entry>1/2 code, constraint length m=4</entry>
692 <entry>Interleaving</entry>
694 <entry>Reduce effect of noise burst</entry>
697 <entry>Data Whitening</entry>
698 <entry>XOR with 9-bit PNR</entry>
699 <entry>Rotate right with bit 8 = bit 0 xor bit 5, initial
700 value 111111111</entry>
708 <title>TeleDongle packet format</title>
710 TeleDongle does not do any interpretation of the packet data,
711 instead it is configured to receive packets of a specified
712 length (32 bytes in this case). For each received packet,
713 TeleDongle produces a single line of text. This line starts with
714 the string "TELEM " and is followed by a list of hexadecimal
717 <programlisting>TELEM 224f01080b05765e00701f1a1bbeb8d7b60b070605140c000600000000000000003fa988</programlisting>
719 The hexadecimal encoded string of bytes contains a length byte,
720 the packet data, two bytes added by the cc1111 radio receiver
721 hardware and finally a checksum so that the host software can
722 validate that the line was transmitted without any errors.
726 <colspec align="center" colwidth="2*" colname="offset"/>
727 <colspec align="center" colwidth="*" colname="name"/>
728 <colspec align="center" colwidth="*" colname="value"/>
729 <colspec align="center" colwidth="5*" colname="description"/>
732 <entry align='center'>Offset</entry>
733 <entry align='center'>Name</entry>
734 <entry align='center'>Example</entry>
735 <entry align='center'>Description</entry>
741 <entry>length</entry>
743 <entry>Total length of data bytes in the line. Note that
744 this includes the added RSSI and status bytes</entry>
747 <entry>1 ·· length-3</entry>
748 <entry>packet</entry>
749 <entry>4f ·· 00</entry>
750 <entry>Bytes of actual packet data</entry>
753 <entry>length-2</entry>
756 <entry>Received signal strength. dBm = rssi / 2 - 74</entry>
759 <entry>length-1</entry>
762 <entry>Link Quality Indicator and CRC status. Bit 7
763 is set when the CRC is correct</entry>
766 <entry>length</entry>
767 <entry>checksum</entry>
769 <entry>(0x5a + sum(bytes 1 ·· length-1)) % 256</entry>
776 <title>History and Motivation</title>
778 The original AltoOS telemetry mechanism encoded everything
779 available piece of information on the TeleMetrum hardware into a
780 single unified packet. Initially, the packets contained very
781 little data—some raw sensor readings along with the current GPS
782 coordinates when a GPS receiver was connected. Over time, the
783 amount of data grew to include sensor calibration data, GPS
784 satellite information and a host of internal state information
785 designed to help diagnose flight failures in case of a loss of
786 the on-board flight data.
789 Because every packet contained all of the data, packets were
790 huge—95 bytes long. Much of the information was also specific to
791 the TeleMetrum hardware. With the introduction of the TeleMini
792 flight computer, most of the data contained in the telemetry
793 packets was unavailable. Initially, a shorter, but still
794 comprehensive packet was implemented. This required that the
795 ground station be pre-configured as to which kind of packet to
799 The development of several companion boards also made the
800 shortcomings evident—each companion board would want to include
801 telemetry data in the radio link; with the original design, the
802 packet would have to hold the new data as well, requiring
803 additional TeleMetrum and ground station changes.