Module 07 · Lesson 1
Telemetry and Command Structures
A telemetry packet does not describe itself. This lesson covers how parameters are packed into packets and frames, and how one shared database tells flight and ground software what every bit means.
Learning objectives
After this lesson you will be able to:
- Describe how parameters are grouped into packets and how packets are carried in frames
- Explain what a telemetry and command database defines and why it is kept under configuration control
- Extract a raw field from a packet by bit offset and convert it to engineering units
One definition, two readers
The foundation course noted that a telemetry database turns raw numbers into readings. For a developer, the key detail is that a telemetry packet does not describe itself. It contains no field names, no type tags and no schema. The flight software writes a value at an agreed position, and the ground software reads the same position. Both rely on a definition held somewhere else.
The closest mainstream comparison is a C struct written directly to a socket. Bandwidth is too scarce to spend on self-description, and one end of the interface is very hard to redeploy.
From parameters to packets to frames
A parameter is one named measurement or state: a battery voltage, a wheel speed, a mode flag, an error counter. Telemetry is organized in three layers.
- Fields. Each parameter occupies a field, which may be several bytes or only a few bits. A 12-bit converter reading and four 1-bit status flags fit together in two bytes.
- Packets. A packet groups parameters that are produced together, usually by one source at one rate. A power housekeeping packet might be generated once a second and a thermal packet every ten seconds. Each packet type carries an identifier, so the receiver knows which layout to apply.
- Frames. Frames carry packets over the radio link. They exist for the benefit of the link and have a size that suits synchronization and error correction. A packet may span several frames, and a frame may hold several packets.
The diagram below shows the path these structures travel between a control center, a ground station antenna and a spacecraft, with commands going up on the uplink and telemetry coming down on the downlink.
Telemetry, tracking and commanding
Technical diagram
- Uplink — commanding. Instructions sent from the ground to the spacecraft.
- Downlink — telemetry. Health and status measurements sent from the spacecraft to the ground.
- Tracking. Measurements of the radio signal itself, used to work out where the spacecraft is.
- Ground network. Links the antenna site to the control center, which may be far away.
The telemetry and command database
The telemetry and command database is the shared definition of every parameter and every command. For each telemetry parameter it typically records the following.
| Item | Example |
|---|---|
| Name and description | EPS_BATT_V, battery bus voltage |
| Packet and position | Power housekeeping packet, bit offset 52, length 12 bits |
| Raw type and byte order | Unsigned integer, most significant byte first |
| Calibration | Volts = 20.0 + 0.01 x counts |
| Limits | Yellow below 26.5 V, red below 25.0 V |
| Validity | Meaningful only while the power unit is switched on |
Position is given as a bit offset because fields do not always align to bytes. The numbering convention has to be stated. Space data standards conventionally number bits from the most significant bit of the first byte, so bit 0 is the first bit transmitted. Much everyday programming assumes the opposite, with bit 0 as the least significant bit, and mixing the two is a classic source of decoder bugs.
Raw counts and engineering units
The value in the packet is a raw count. A calibration turns it into engineering units. Common forms are:
- a polynomial, most often a straight line with a scale and an offset
- a piecewise-linear curve through a table of points, used for nonlinear sensors such as thermistors
- a text mapping for discrete states, such as 0 for
OFFand 1 forON
The example below extracts a field using most-significant-bit-first numbering and applies a linear calibration. The test case is small enough to check by hand.
// Extract an unsigned field. Bit 0 is the most significant bit of byte 0.
function extractBits(buf: Uint8Array, bitOffset: number, bitLength: number): number {
if (bitLength < 1 || bitLength > 32) throw new RangeError("bitLength must be 1 to 32");
if (bitOffset < 0 || bitOffset + bitLength > buf.length * 8) {
throw new RangeError("field lies outside the buffer");
}
let value = 0;
for (let i = 0; i < bitLength; i++) {
const bit = bitOffset + i;
const shift = 7 - (bit % 8); // 7 selects the most significant bit of the byte
value = value * 2 + ((buf[bit >> 3] >> shift) & 1);
}
return value;
}
// Linear calibration: engineering value = offset + scale * raw count.
function calibrate(raw: number, scale: number, offset: number): number {
return offset + scale * raw;
}
// Bytes 0x12 0xAB 0xC4 are the bits 0001 0010 1010 1011 1100 0100.
// The 12 bits starting at bit 4 are 0010 1010 1011 = 0x2AB = 683 counts.
const packet = new Uint8Array([0x12, 0xab, 0xc4]);
const raw = extractBits(packet, 4, 12);
const volts = calibrate(raw, 0.01, 20.0); // 0.01 V per count, 20.0 V offset
console.log(raw, volts.toFixed(2)); // 683 26.83
console.log(extractBits(packet, 16, 3)); // top three bits of 0xC4 = 110 = 6
A production decoder is driven by the database, not written by hand for each parameter. It also handles signed integers, floating-point fields and sources that send the least significant byte first.
Archives normally store the raw count and treat engineering units as derived, so a value can be recalibrated if the calibration proves wrong.
Command definitions
Commands are defined in the same database and travel in the opposite direction: the ground packs and the spacecraft unpacks. A command definition usually contains:
- a name, and an identifier that selects the destination and the function to run
- arguments, each with a type, a size, a position, and an allowed range or list of named values
- constraints, such as the spacecraft modes in which the command is permitted
- a criticality marking for commands that need extra confirmation
- the telemetry that should change if the command works, which is used for verification
This is an API contract with validation built into the schema. A procedure refers to HEATER_SET_POINT with ZONE = 3 and TEMP_C = 18. The ground software checks the arguments against the definition and encodes the bits. Nobody types hexadecimal.
Why the database is configuration-controlled
The database is a machine-readable interface specification, and it is treated like flight software: version-controlled, changed only through review, and released with the flight software build it describes. Three properties matter.
A single source. If packet layouts in the flight code and definitions in the ground database are maintained by hand in separate places, they will diverge. Projects aim to generate both from one definition, or one from the other.
A match to what is flying. The ground must use the version that corresponds to the software on board. After an in-orbit software update, the ground switches database versions when the new software becomes active.
Testing as a pair. The database is verified by running the real flight software, or a simulator of it, against the real ground system and checking that values and commands survive the round trip.
The parallel with a schema registry for service APIs is close. It breaks down in the failure mode. A mismatched web schema usually produces a parsing error. A mismatched telemetry definition produces a number.
A practical example: a field that moved
A flight software team adds a 4-bit fault code to the power housekeeping packet. To keep related fields together they insert it ahead of the battery voltage, which moves from bit offset 52 to bit offset 56. Spare bits absorb the change, so the packet length stays the same.
The matching database update is missed. On the test bench, the ground system still reads 12 bits at offset 52. It now gets the 4-bit fault code followed by the top 8 bits of the voltage. The fault code is zero and the bus is at 28.00 V, a raw count of 800, or 0x320. The ground reads 0x032, which is 50 counts, and displays 20.50 V. A red limit trips at once.
The error is large, so an alarm catches it before launch. A smaller shift, or a changed scale factor, could produce a value that stays inside its limits and is simply wrong.
The corrective actions are procedural. Flight packet code and the ground database are generated from one source. The spacecraft reports a database version identifier that the ground compares with its own. A round-trip test in the build pipeline fails when the two sides disagree.
Opening the packet
This lesson treated a packet as a container with an identifier. The next lesson opens the container and examines the header format most missions use, the CCSDS Space Packet, along with the frames that carry it.
Key takeaways
- Telemetry is layered. Parameters are packed into packets, and packets are carried over the radio link in frames.
- Nothing in the bits says what they mean. The telemetry and command database is the shared definition that flight and ground software both depend on.
- A raw count becomes a reading only through a calibration. Archives keep the raw value so it can be recalibrated later.
- The database is released and versioned with the flight software it describes. A mismatch usually produces a plausible wrong number, not an error.
Knowledge check
Check your understanding. These questions are not graded and you can retry as often as you like.
0 of 3 questions answered.
Glossary
Parameter
One named measurement or state reported in telemetry, such as a voltage, a temperature, a mode flag or an error counter.
Raw count
The unconverted integer or bit pattern that the spacecraft places in a packet for a parameter.
Calibration
The rule that converts a raw count into engineering units, for example a straight line, a curve through a table of points, or a mapping from numbers to state names.
Telemetry and command database
The configuration-controlled definition of every telemetry parameter and every command, including names, bit positions, types, calibrations, limits, arguments and constraints.
Bit offset
The position of a field within a packet, counted in bits from the start. Space data conventions usually count from the most significant bit of the first byte.
Command argument
A value supplied with a command, with a defined type, size, position and allowed range or list of named values.
References and further reading
- XML Telemetric and Command Exchange (XTCE) Specification (opens in a new tab)Object Management Group
- Basics of Space Flight - Chapter 10, Telecommunications (opens in a new tab)NASA Science
- Blue Books - Recommended Standards (opens in a new tab)Consultative Committee for Space Data Systems
Finished this lesson?
Loading your progress…
Lesson version 1.0.0.