Flight Computers and Real-Time Operating Systems
Every planetary surface vehicle flown by NASA since Mars Pathfinder has run its flight software as a set of preemptive prioritized tasks under Wind River VxWorks on a radiation-hardened PowerPC or POWER derivative. The operating system supplies task scheduling, timers, message queues, semaphores, and a DOS file system library. What it costs is a scheduling model whose worst cases are hard to bound by test, and a set of commercial libraries whose internal behavior the flight team does not own. Both costs have caused loss of vehicle control in flight [8][5].
The processors
Section titled “The processors”| Sojourner | Spirit and Opportunity | Curiosity | Perseverance | |
|---|---|---|---|---|
| Landing year | 1997 | 2004 | 2012 | 2021 |
| CPU | 80C85 | BAE RAD6000 | BAE RAD750 | BAE RAD750 x2 plus Xilinx Virtex5QV FPGA |
| Clock | 2 MHz | 20 MHz | 133 MHz | 133 MHz x2, FPGA at 22M disparities/s |
| RAM | 0.56 MB | 128 MB | 128 + 512 MB | 128 MB x2 plus 512 MB x2 |
| Non-volatile storage | 0.17 MB | 256 MB flash | 4096 MB flash | 4096 + 3072 MB flash |
Source: [7], Table 1. MER also carried 11 MB of EEPROM, of which the 3 MB supplied with the RAD6000 board has no error detection and correction [3]. Curiosity and Perseverance carry two flight computers, only one prime at a time, with dual sets of avionics, sensors, heaters and telecommunications paths [6]. Perseverance’s second RAD750 board is the Vision Compute Element, which hosts the Virtex-5 FPGA that runs stereo correlation and visual odometry image processing, six times as many pixels per step as Curiosity in less time [7].
What the operating system supplies, and what the software adds
Section titled “What the operating system supplies, and what the software adds”MER flight software is 93 modules and about 300,000 source lines of code, primarily ANSI C with targeted assembly and some C++, excluding the operating system [1]. Inheritance and polymorphism were deliberately not exploited: fully exercised in C++ they were judged to cost code size and to introduce non-deterministic behavior. It was written by one team over 35 months from July 2000, inheriting structure, architecture and source from Mars Pathfinder and the Athena rover software and, less directly, from Deep Space 1, Mars Surveyor 98 and Mars Surveyor 01 [1].
VxWorks contributes tasks, time and timers, math libraries, I/O, files, logging, message queues and semaphores. The real-time clock tick that drives the system clock comes from MER-specific hardware rather than from the computer board clock [1].
Above that, the 93 modules map onto 97 tasks, not one to one: sixteen sequence machine tasks share common source, and thirteen fault protection response tasks live in a single module [1]. Curiosity keeps the same shape, one VxWorks task per module communicating by inter-process communication rather than by shared memory under semaphores [6].
Scheduling
Section titled “Scheduling”There are no rate groups on MER. A task with a rate requirement subscribes to the timer module, which delivers a message at the required interval; the task’s event loop receives that message and performs the work its current state calls for [1]. Time event messages are usually delivered to a higher-priority queue than commands, so periodic work runs before command processing within a task. Several tasks wait on the 8 Hz time event, and task priority alone decides the order in which they run [1]. The cruise attitude control task carries an 8 Hz rate requirement and also processes commands and produces telemetry in the same context.
Tasks that have no rate requirement are entirely event driven and never poll; interrupts produce a message that wakes the target task [1]. Priority follows function: sequence engine tasks outrank image processing tasks because command execution is more urgent than imaging, and both are outranked by the task that controls autonomous communication. Every task has at least one message queue, messages are point to point with no broadcast, and the underlying transport is the VxWorks pipe.
The imaging chain shows what priority buys in throughput. MER Imaging Services runs three tasks, Imaging Services, Camera Control and Post Processing, with two request queues per priority level, one for cameras on the pointable mast and one for body-mounted cameras [4]. Acquisition takes many seconds, so a request is handed to Post Processing for compression and product generation as soon as its pixels are read, freeing Camera Control to start the next exposure. A body-mounted camera request that arrives while the mast is still slewing is serviced first, which means the order in which images are actually taken cannot be predicted from the order they were commanded.
Memory discipline
Section titled “Memory discipline”MER makes at most 75 percent of the 20 MHz RAD6000 available to autonomy software, and telemetry processing can reduce that further [2]. Dynamic allocation is strongly discouraged by the coding standards. Non-system RAM is available in dedicated pools of 4 MB, 9 MB and up to ten further 2 MB blocks, and using those 2 MB blocks reduces the memory left for image processing, so their use is discouraged as well [5]. By convention, applications request memory only during initialization and never return it.
The file systems are partitioned by medium, and there are no disk drives [5]:
| File system | Medium | Size | Purpose |
|---|---|---|---|
| RAM file system | RAM | 4 MB | Temporary storage of uplinked files |
| Temporary file system | RAM | 2 MB | Temporary data product store |
| FLASH file system | flash | 224 MB | Science and engineering data products |
| Primary sequence | EEPROM | 700 KB | Sequence storage |
| Secondary sequence | EEPROM | 700 KB | Redundant sequence storage |
| Primary downlink | EEPROM | 50 KB | Downlink table storage |
| Secondary downlink | EEPROM | 50 KB | Redundant downlink table storage |
Source: [5], Table 1.
Watchdogs, resets and boot
Section titled “Watchdogs, resets and boot”Severe errors are detected either inside an application or by a software health function that continuously checks for unresponsive or suspended tasks [3]. Suspension of a task is treated as a condition that should never occur, and the health monitor responds by forcing a reset of the avionics and re-initialization of the flight software [5]. The system response after initialization turns off science instruments and warm-up heaters, reinforces survival heaters on, and deactivates all sequences, while continuing to execute the scheduled communication windows in autonomous shutdown mode [3].
If a severe error is detected during initialization itself, the reset is delayed to give the ground time to intervene. The interval is 15 minutes for the first severe error, 15 minutes for the second, one hour for the third, then the pattern repeats [5]. Commands can be processed and communication windows can occur during the delayed reset period, and the boot logic loads alternating copies of the flight software on successive attempts [5][3].
Recovery below the software level is hardware. The mission clock lives in an FPGA powered directly from the batteries, so time survives a processor power-off; co-located on it is the alarm clock that tells the Battery Charge Board to power the avionics [3]. If the flight software cannot shut down within 60 seconds of a low battery detection, the Battery Charge Board takes the batteries off the bus regardless. A small set of commands is processed entirely in hardware, setting bits in a register the flight software reads during initialization; one of them is crippled mode, which tells the software not to use the flash file system and to create a RAM file system with the same logical device name instead [5].
Failure modes established in flight
Section titled “Failure modes established in flight”Priority inversion, Mars Pathfinder, July 1997. The 1553 bus scheduler task, the highest priority task in the system apart from the VxWorks tExec task, checked each 0.125 s cycle that the data distribution task had completed [8]. The meteorology task, near the bottom of the priority order, called select, which called pipeIoctl, which called selNodeAdd, and was preempted mid-semGive while holding the mutex protecting the select wait list. Medium priority tasks then ran long enough that the distribution task, blocked in pipeWrite on that same mutex, missed its deadline, and the scheduler declared the error and reset the computer [8]. The mutex had been created without the priority inheritance option because Wind River left it out of the default selectLib service for performance. The problem had been seen before landing but could not be reproduced, and was ranked below entry, descent and landing work; it was reproduced in the testbed in under 18 hours once the mission was on the surface, using a trace facility built into the flight software from the outset and left in deliberately, which is the only way the sequence could have been captured [8][9]. The fix set the global selectLib option variable to enable priority inheritance, which changed the behavior of every select semaphore created afterward, not just the one at fault; Wind River assessed the performance impact as minimal and the behavior of select as unchanged given that only one task ever waits on a given file descriptor in that system [8]. The patch was uplinked as a difference against the onboard image and applied by custom onboard software with validation, not typed into the VxWorks shell, although the shell was available.
Memory exhaustion through a file system library, Spirit, sol 18, 21 January 2004. The bundled DOS library builds an interlinked representation of the file system in RAM at mount time and updates it as files change [5]. Deleting a file frees its flash space but never releases the corresponding internal structure, so the memory required is set by the maximum number of files that ever existed in each subdirectory rather than by the number present [5]. Two configuration parameters were wrong: expansion of the library’s 256 KB private area from free system memory was permitted, with no ceiling, and the memory library was configured to suspend a task silently when an allocation could not be satisfied rather than failing the file operation. The first reset came from creating a large number of motion history data products; the second, two hours later, from a high gain antenna encoder calibration that produced more motion history files; the third from the data summary report generated automatically for each communication window. Because the failed allocation happened inside a critical region, the suspended task never released the DOS library semaphore, which blocked the task that reads files for recorded telemetry, the task that pushes telemetry frames into the hardware, and the task that idles the file system during shutdown. The rover therefore transmitted the same transfer frame eleven times, returned no recorded data, and did not sleep. Spirit was reset repeatedly from sol 18 until sol 21, when a hardware crippled mode command let it initialize with an empty RAM file system; the flash was erased in chunks and reformatted on sol 32 and normal science resumed on sol 33.
The consequence for the design is stated plainly by the flight software lead of both missions: know how commercial off-the-shelf code works before flying it, and enforce the design guidelines on it that are enforced on in-house code, in this case the prohibition on allocating system memory after initialization [5][8].
What the redundancy figures inherited from aircraft avionics mean
Section titled “What the redundancy figures inherited from aircraft avionics mean”The 1e-9 that flight computing quotes as a reliability requirement is not a per-hour rate and not a spacecraft number [11]. It is the probability of system failure over a ten-hour civil transport flight, met in the SIFT design by five-fold replication of critical tasks while five processors remain and degrading to three-fold with four or three, and it is computed from an assumed 2e-4 per hour solid processor fault rate, an assumed 2e-3 per hour transient error rate, a 0.36 s reconfiguration time and no intermittent faults modeled [11]. The report states those rates as assumptions and gives determining them empirically as a job for the test program, so the figure is the output of a model whose inputs were unmeasured, against a mission profile of ten hours and ground repair between flights.
Masking a fault in hardware instead costs a fixed factor. The FTMP architecture the same program built triplicates processors, system memory modules, real-time clocks and system bus lines, and packages them as ten line replaceable units of which nine form three triads and the tenth is a spare [12]. Voting happens bit-serially at every receiver with no software involvement, which is what makes masking transparent to the application, and it holds only while the three members of a triad stay in tight synchronism, so the architecture does not survive being stretched over physically separated units. Its fault model is random hardware failure in an aircraft environment; single event upsets, latchup and total dose are outside it.
Alternatives to a monolithic per-mission stack
Section titled “Alternatives to a monolithic per-mission stack”The NASA Goddard core Flight System factors the same job into an operating system abstraction layer over VxWorks, RTEMS, FreeRTOS or Linux, a platform support package, and a core Flight Executive providing software bus, time, event, table and executive services [10]. It reached flight on the Lunar Reconnaissance Orbiter in 2009 and the cFE application programming interface has not changed since. Its cost and reuse figures are on the core Flight System page.
References
- Reeves, G. E. (2005). An Overview of the Mars Exploration Rovers Flight Software
. IEEE International Conference on Systems, Man and Cybernetics. Source
BibTeX
@inproceedings{reeves2005overview, title = {An Overview of the Mars Exploration Rovers Flight Software}, author = {Reeves, Glenn E.}, booktitle = {IEEE International Conference on Systems, Man and Cybernetics}, volume = {1}, pages = {1-7}, address = {Waikoloa, Hawaii}, year = {2005}, doi = {10.1109/icsmc.2005.1571113}, abstract = {The Mars exploration rovers (MER) flight software (FSW) is possibly the most complex software implementation to be deployed on another planet. The requirements dictated a software system that addressed four distinct mission phases (cruise, landing, egress, and surface) and the mission demanded a system with significant autonomy. The structure of the MER flight software reflects its object-oriented beginnings and the overall function reflects the requirements of the MER mission and spacecraft. This paper provides an overview of the function and structure of the MER flight software. The MER mission and spacecraft are briefly discussed to provide context for the flight software decomposition and the discussion of the software execution model.} } - Maimone, M. W., Leger, P. C. and Biesiadecki, J. J. (2007). Overview of the Mars Exploration Rovers' Autonomous Mobility and Vision Capabilities
. IEEE International Conference on Robotics and Automation, Space Robotics Workshop. Source
BibTeX
@inproceedings{maimone2007overview, title = {Overview of the Mars Exploration Rovers' Autonomous Mobility and Vision Capabilities}, author = {Maimone, Mark W. and Leger, P. Chris and Biesiadecki, Jeffrey J.}, booktitle = {IEEE International Conference on Robotics and Automation, Space Robotics Workshop}, address = {Rome, Italy}, year = {2007}, url = {https://www-robotics.jpl.nasa.gov/media/documents/mer_autonomy_icra_2007.pdf} } - Neilson, T. (2005). Mars Exploration Rovers Surface Fault Protection
. IEEE International Conference on Systems, Man and Cybernetics. Source
BibTeX
@inproceedings{neilson2005mars, title = {Mars Exploration Rovers Surface Fault Protection}, author = {Neilson, Tracy}, booktitle = {IEEE International Conference on Systems, Man and Cybernetics}, volume = {1}, pages = {14-19}, address = {Big Sky, Montana}, year = {2005}, doi = {10.1109/icsmc.2005.1571115}, abstract = {The Mars exploration rovers surface fault protection design was influenced by the need for the solar powered rovers to recharge their batteries during the day to survive the night. The rovers were required to autonomously maintain thermal stability, and initiate reliable communication with orbiting assets or directly to Earth, while maintaining their energy balance. This paper describes the system fault protection design for the surface phase of the mission, including hardware descriptions and software algorithms. Additionally, a few in-flight experiences are described, including the Spirit flash memory anomaly and the Opportunity "stuck-on" heater failure.} } - Litwin, T. E. and Maki, J. N. (2005). Imaging Services Flight Software on the Mars Exploration Rovers
. IEEE International Conference on Systems, Man and Cybernetics. Source
BibTeX
@inproceedings{litwin2005imaging, title = {Imaging Services Flight Software on the Mars Exploration Rovers}, author = {Litwin, Todd E. and Maki, Justin N.}, booktitle = {IEEE International Conference on Systems, Man and Cybernetics}, volume = {1}, pages = {895--900}, address = {Waikoloa, Hawaii}, year = {2005}, doi = {10.1109/icsmc.2005.1571260}, abstract = {The imaging services module of the Mars Exploration Rovers' on-board flight software is responsible for providing image data to the rest of the system. It acquires images from a suite of cameras, performs on-board image processing, labels the results with metadata, and delivers the final products to a diverse set of consumers, both on board and on the ground. The demands for flexibility and speed led to a design involving multiple tasks and a large set of parameters controlling the acquisition of the images, the on-board processing, and the method of product delivery.} } - Reeves, G. E. and Neilson, T. A. (2005). The Mars Rover Spirit FLASH Anomaly
. IEEE Aerospace Conference. Source
BibTeX
@inproceedings{reeves2005mars, title = {The Mars Rover Spirit FLASH Anomaly}, author = {Reeves, Glenn E. and Neilson, Tracy A.}, booktitle = {IEEE Aerospace Conference}, pages = {4186-4199}, address = {Big Sky, Montana}, year = {2005}, doi = {10.1109/aero.2005.1559723}, abstract = {The Mars Exploration Rover "Spirit" suffered a debilitating anomaly that prevented communication with Earth for several anxious days. With the eyes of the world upon us, the anomaly team used each scrap of information, our knowledge of the system, and sheer determination to analyze and fix the problem, then return the vehicle to normal operation. This paper will discuss the Spirit FLASH anomaly, including the drama of the investigation, the root cause and the lessons learned from the experience} } - Benowitz, E. (2015). The Curiosity Mars Rover's Fault Protection Engine
. IEEE International Conference on Space Mission Challenges for Information Technology. Source
BibTeX
@inproceedings{benowitz2015curiosity, title = {The Curiosity Mars Rover's Fault Protection Engine}, author = {Benowitz, Ed}, booktitle = {IEEE International Conference on Space Mission Challenges for Information Technology}, volume = {111}, pages = {62-66}, address = {Big Sky, Montana}, year = {2015}, doi = {10.1109/smc-it.2014.16}, abstract = {The Curiosity Rover, currently operating on Mars, contains flight software onboard to autonomously handle aspects of system fault protection. Over 1000 monitors and 39 responses are present in the flight software. Orchestrating these behaviorsis the flight software's fault protection engine. In this paper, we discuss the engine's design, responsibilities, and present some lessons learned for future missions.} } - Rankin, A., Del Sesto, T., Hwang, P., Justice, H., Maimone, M., Verma, V. and Graser, E. (2023). Perseverance Rapid Traverse Campaign
. IEEE Aerospace Conference. Source
BibTeX
@inproceedings{rankin2023perseverance, title = {Perseverance Rapid Traverse Campaign}, author = {Rankin, Arturo and Del Sesto, Tyler and Hwang, Pauline and Justice, Heather and Maimone, Mark and Verma, Vandi and Graser, Evan}, booktitle = {IEEE Aerospace Conference}, pages = {1-16}, address = {Big Sky, Montana}, year = {2023}, doi = {10.1109/aero55745.2023.10115835}, abstract = {Over the first 13 months of the Mars 2020 mission, the Perseverance rover traversed nearly 5 km along the Jezero Crater floor. Near the end of that period, the Science team was anxious to relocate to the ancient Delta region near the crater rim, over 5 km away. A Rapid Traverse Campaign was planned that would prioritize use of Perseverance's autonomous navigation software to drive at an unprecedented high pace and minimize science activities. The Rapid Traverse Campaign started in March 2022 and lasted 31 Martian days. During the campaign, Perseverance drove over 5 km in 24 drives, during which its autonomy software planned 94.8% of its overall driving, enabling it to set several new planetary rover driving records. Perseverance exceeded the longest daily drive distance record achieved by a previous planetary rover (219 meters) 11 times and set new records for the longest multi-sol drive distance in a single plan (528.7 meters) and the longest continuation drive (699.9 meters) by operating without human drive path input during 3 sols of driving. This paper details the planning and execution of the Rapid Traverse Campaign.} } - Reeves, G. E. (1997). What really happened on Mars? Authoritative Account. cs.unc.edu/~anderson/teach/comp790/papers/mars_pathfinder_long_versio...
BibTeX
@misc{reeves1997what, title = {What really happened on Mars? Authoritative Account}, author = {Reeves, Glenn E.}, organization = {Jet Propulsion Laboratory}, year = {1997}, url = {https://www.cs.unc.edu/~anderson/teach/comp790/papers/mars_pathfinder_long_version.html} } - Jones, M. B. (1997). What really happened on Mars?. cs.unc.edu/~anderson/teach/comp790/papers/mars_pathfinder_short_versi...
BibTeX
@misc{jones1997what, title = {What really happened on Mars?}, author = {Jones, Michael B.}, organization = {Microsoft Research}, year = {1997}, url = {https://www.cs.unc.edu/~anderson/teach/comp790/papers/mars_pathfinder_short_version.html} } - McComas, D., Wilmot, J. and Cudmore, A. (2016). The Core Flight System (cFS) Community: Providing Low Cost Solutions for Small Spacecraft
. Annual AIAA/USU Conference on Small Satellites. Source
BibTeX
@inproceedings{mccomas2016core, title = {The Core Flight System (cFS) Community: Providing Low Cost Solutions for Small Spacecraft}, author = {McComas, David and Wilmot, Jonathan and Cudmore, Alan}, booktitle = {Annual AIAA/USU Conference on Small Satellites}, year = {2016}, url = {https://ntrs.nasa.gov/citations/20160010300}, abstract = {In February 2015 the NASA Goddard Space Flight Center (GSFC) completed the open source release of the entire Core Flight Software (cFS) suite. After the open source release a multi-NASA center Configuration Control Board (CCB) was established that has managed multiple cFS product releases. The cFS was developed and is being maintained in compliance with the NASA Class B software development process requirements and the open source release includes all Class B artifacts. The cFS is currently running on three operational science spacecraft and is being used on multiple spacecraft and instrument development efforts. While the cFS itself is a viable flight software (FSW) solution, we have discovered that the cFS community is a continuous source of innovation and growth that provides products and tools that serve the entire FSW lifecycle and future mission needs. This paper summarizes the current state of the cFS community, the key FSW technologies being pursued, the development/verification tools and opportunities for the small satellite community to become engaged. The cFS is a proven high quality and cost-effective solution for small satellites with constrained budgets.} } - Goldberg, J., Green, M. W., Kautz, W. H., Levitt, K. N., Melliar-Smith, P. M., Schwartz, R. L. and Weinstock, C. B. (1984). Development and Analysis of the Software Implemented Fault-Tolerance (SIFT) Computer
. SRI International for NASA Langley Research Center, NASA CR-172146. Source
BibTeX
@techreport{goldberg1984development, title = {Development and Analysis of the Software Implemented Fault-Tolerance (SIFT) Computer}, author = {Goldberg, Jack and Green, Milton W. and Kautz, William H. and Levitt, Karl N. and Melliar-Smith, P. Michael and Schwartz, Richard L. and Weinstock, Charles B.}, number = {NASA CR-172146}, institution = {SRI International for NASA Langley Research Center}, year = {1984}, url = {https://ntrs.nasa.gov/citations/19840010885}, abstract = {SIFT (Software Implemented Fault Tolerance) is an experimental, fault-tolerant computer system designed to meet the extreme reliability requirements for safety-critical functions in advanced aircraft. Errors are masked by performing a majority voting operation over the results of identical computations, and faulty processors are removed from service by reassigning computations to the nonfaulty processors. This scheme has been implemented in a special architecture using a set of standard Bendix BDX930 processors, augmented by a special asynchronous-broadcast communication interface that provides direct, processor to processor communication among all processors. Fault isolation is accomplished in hardware; all other fault-tolerance functions, together with scheduling and synchronization are implemented exclusively by executive system software. The system reliability is predicted by a Markov model. Mathematical consistency of the system software with respect to the reliability model has been partially verified, using recently developed tools for machine-aided proof of program correctness.} } - Smith, T. B. I. and Lala, J. H. (1983). Development and Evaluation of a Fault-Tolerant Multiprocessor (FTMP) Computer. Volume I: FTMP Principles of Operation
. Charles Stark Draper Laboratory for NASA Langley Research Center, NASA CR-166071. Source
BibTeX
@techreport{smith1983development, title = {Development and Evaluation of a Fault-Tolerant Multiprocessor (FTMP) Computer. Volume I: FTMP Principles of Operation}, author = {Smith, T. Basil, III and Lala, Jaynarayan H.}, number = {NASA CR-166071}, institution = {Charles Stark Draper Laboratory for NASA Langley Research Center}, year = {1983}, url = {https://ntrs.nasa.gov/citations/19850022393}, abstract = {The basic organization of the fault tolerant multiprocessor, (FTMP) is that of a general purpose homogeneous multiprocessor. Three processors operate on a shared system (memory and I/O) bus. Replication and tight synchronization of all elements and hardware voting is employed to detect and correct any single fault. Reconfiguration is then employed to repair a fault. Multiple faults may be tolerated as a sequence of single faults with repair between fault occurrences.} }