Module 11 · Lesson 3
Operating Software Safely
Software keeps changing after launch. This lesson covers in-flight updates, configuration control of flight and ground software, commanding discipline, and the lessons of Ariane 5 and Mars Climate Orbiter.
Learning objectives
After this lesson you will be able to:
- Describe how flight software is updated in orbit and the safeguards that keep an update recoverable
- Explain why flight software, ground software and the telemetry and command database must be managed as one configuration
- Draw general lessons about reuse, interfaces and assumptions from the Ariane 5 Flight 501 and Mars Climate Orbiter failures
Software after launch
The foundation course noted that software is the only part of a spacecraft that can be changed after launch. Teams do change it: to fix defects found in flight, to work around failed hardware, to add capability and to adjust parameters. The changes come in three sizes, in rising order of risk:
- a table or parameter update, which changes data the software reads
- a memory patch, which alters a limited region of code or data
- a full image replacement
Why updates are rare and rehearsed
Uplink is slow and intermittent, so a large image arrives in pieces over several contacts. The computer being updated is the one flying the spacecraft. A faulty update can break the command path needed to repair it, and nobody can attach a debugger. Four safeguards follow.
- Keep a known-good image. The new image is written to a separate area of memory and the proven one is left untouched. Many designs also hold a minimal image in read-only memory that can always receive commands and load software.
- Verify before use. Each segment and the whole image are checked against checksums.
- Activate in stages. The new image is started once, by command. If it does not come up healthy, a watchdog or boot counter returns the computer to the previous image without help from the ground. Only after a period of observation does the new image become the default.
- Rehearse. The whole procedure runs first on the flatsat or twin from Module 10, through the operational ground system, including the failure paths: an interrupted upload, a corrupted segment, a failed start.
Deployment pipelines with automatic rollback use the same idea. The difference is that a single spacecraft offers no low-risk instances to try the change on first, and the rollback must work with nobody in contact.
One configuration, not three
Flight software, ground software and the telemetry and command database are built by different teams and are correct only as a matched set. The database tells the ground how to interpret each bit of telemetry and how to build each command. If a flight update changes a packet layout and the database does not follow, the displays show confident, wrong values.
The three are therefore versioned together, and the ground system checks the flight software version reported in telemetry against the database before commanding.
This resembles keeping client and server compatible across an API change, except that every old database version must be kept, because archived telemetry can be decoded only with the definitions that applied when it was recorded.
Discipline around commanding
Module 07 showed how ground software makes unsafe commanding hard, with arm-then-fire steps and explicit confirmation. Over years of operations the task is to keep those safeguards intact. Procedures are configuration items and are revalidated whenever the flight software or database changes. Commands outside an approved procedure go through a defined contingency process, not improvisation at the console. Every release is logged with the operator, the procedure and the database version.
Two failures worth knowing
Ariane 5 Flight 501, 1996
The first Ariane 5 launched on 4 June 1996. About 40 seconds into flight it veered off course, broke up and was destroyed.
The inquiry board traced the failure to the inertial reference system, whose software had been reused from Ariane 4. One function converted a 64-bit floating-point value, related to the rocket's horizontal velocity, into a 16-bit signed integer. Ariane 5's trajectory produced a larger value than Ariane 4's ever had, and the conversion overflowed. The resulting exception was not handled, and the unit shut down. The backup unit ran the same software and had already failed in the same way. The flight computer then interpreted diagnostic output from the failed unit as flight data and commanded extreme nozzle deflections.
Two further findings matter. The function belonged to pre-launch alignment and served no purpose after liftoff on Ariane 5, but continued to run because Ariane 4 had needed it to. And protection against overflow had been deliberately left off this variable, on the basis of analysis that was valid for Ariane 4.
Mars Climate Orbiter, 1999
Mars Climate Orbiter was lost on arrival at Mars on 23 September 1999.
Ground software produced a file of thruster impulse data that the navigation team used to model small forces on the spacecraft. The interface specification called for newton-seconds. The software supplied pound-force seconds. One pound-force second is about 4.45 newton-seconds, so the effect of each thruster firing was underestimated by that factor. The trajectory error built up over months of cruise, and the spacecraft approached Mars far lower than planned. The investigation board also listed contributing causes, among them inadequate communication between project teams and verification that did not adequately cover the ground software.
What the two have in common
In both cases each piece of software did what it had been written to do. The fault lay at a boundary: between an old vehicle and a new one, and between two teams.
- Reuse is a change. Inherited code carries assumptions about ranges, rates and sequences that must be checked against the new mission.
- Redundancy does not cover design faults. Identical copies fail identically, which is a common-cause failure.
- An interface document is not enough. The Mars Climate Orbiter specification was correct. Conformance has to be verified with real data across the real interface.
- Make assumptions executable. Carry units in names, types or file headers, as Module 01 advised. Assert ranges. Make conversions explicit and checked.
A JavaScript typed array stores an out-of-range number by silently wrapping it, while a checked conversion forces the caller to decide what to do.
const INT16_MIN = -32768;
const INT16_MAX = 32767;
type Converted = { ok: true; value: number } | { ok: false; reason: string };
function toInt16(x: number): Converted {
if (!Number.isFinite(x)) return { ok: false, reason: 'not a finite number' };
const rounded = Math.round(x);
if (rounded < INT16_MIN || rounded > INT16_MAX) {
return { ok: false, reason: `${rounded} does not fit in 16 bits` };
}
return { ok: true, value: rounded };
}
console.log(new Int16Array([40000])[0]); // a typed array wraps silently
console.log(toInt16(12000.4));
console.log(toInt16(40000));
It prints:
-25536
{ ok: true, value: 12000 }
{ ok: false, reason: '40000 does not fit in 16 bits' }
Detection is only half of the design. On Ariane 5 the overflow was detected, as an exception, and the response to it, shutting the unit down, was what led to the loss of the vehicle.
A practical example: inheriting a maneuver tool
A team inherits a maneuver planning tool from an earlier mission and must use it for a new satellite with larger thrusters.
Before running it, an engineer lists every input and output with its unit, range, reference frame and time scale, and compares each with the new mission. The output file stores thrust in a scaled 16-bit field sized for the old thrusters, and the new ones exceed it. She adds a header declaring the file's units and makes the reader reject a file whose units differ from what it expects. She then runs real data from the tool through command generation and into the simulator.
None of this is advanced engineering. It is a systematic refusal to assume that what worked before still applies.
That completes the material on reliability. The final module puts the course to work in a capstone project: designing and building a satellite tracking application.
Key takeaways
- In-flight updates are rare and rehearsed because the computer being changed is the one keeping the spacecraft alive. A retained known-good image, verification before activation and automatic fallback keep an update recoverable.
- Flight software, ground software and the telemetry and command database are built separately but are correct only as a matched set. They are versioned and changed together.
- Commanding discipline is enforced by tooling - authorization, precondition checks, confirmation of hazardous commands and a complete log.
- Ariane 5 Flight 501 and Mars Climate Orbiter both failed at a boundary, where an assumption that held in one context was carried unchecked into another.
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
Known-good image
A copy of flight software that has been proven to work and is kept on board, unmodified, so that the computer can fall back to it if a newer version fails.
Memory patch
A change to a limited region of on-board memory, uploaded by command, that alters code or data without replacing the whole software image.
Telemetry and command database
The ground definition of every telemetry parameter and command, including packet layouts, calibrations, limits and command parameters. It must match the flight software version in use.
Interface specification
A controlled document that defines the data exchanged between two systems, including formats, units, ranges and timing.
Common-cause failure
The failure of several redundant items from a single shared cause, such as an identical software fault present in every copy.
References and further reading
Finished this lesson?
Loading your progress…
Lesson version 1.0.0.