TL;DR
Designing flight software for a helicopter on another planet usually relies on static PowerPoint diagrams and natural-language specs—a handoff process practically begging for human error. Instead, NASA JPL engineers built executable architectural models for the Mars Sample Recovery Helicopter’s flight "brain," simulating its states and emergency behaviors before writing a single line of new flight code. By turning static blueprints into a running prototype, they caught subtle, split-second hardware timing bugs early on that could have been catastrophic on Mars.
What Problem Does This Paper Address?
Imagine designing a backup helicopter for the Mars Sample Return campaign. Named the Sample Recovery Helicopter (SRH), its job was to build on the legacy of the Ingenuity rotorcraft, adding wheels and a robotic arm to fly out, grab sample tubes cached by Perseverance, and bring them back to a lander.
Traditionally, systems engineers map out how a spacecraft behaves using static diagrams and text documents, then hand them over to software developers to translate into C/C++. As space missions grow more complex, ambiguities in those static drawings easily turn into expensive, dangerous software bugs.
For SRH, the "Aerial Mode Commander"—the state-machine ringleader orchestrating spinup, climb, traverse, and landing—had tricky hardware constraints. Because camera navigation requires heavy processing power, the Navigation (NAV) mode commander lives on a Linux processor on one circuit board, while the Guidance & Control (G&C) mode commander runs bare-metal on a separate flight controller board, chatting over a 500 Hz serial link. Furthermore, there are two redundant G&C flight computers; if the primary fails mid-air, the backup must "hot swap" in within milliseconds so the inherently unstable helicopter doesn't crash.
While Model-Based Systems Engineering (MBSE) promises to tame this complexity, there are very few real-world examples of active flight projects using executable models deep down at the detailed software subsystem level. The authors wanted to see if building a runnable SysML model of SRH’s mode commanders would pay off during an actual design cycle.
Methods
Instead of relying solely on "flat" drawings, the team used Systems Modeling Language (SysML) inside Cameo Systems Modeler to build a dynamic, executable prototype of the Aerial Mode Commander.
To make the model behave like actual flight hardware, they engineered two custom modeling patterns:
- Synchronized, Interdependent State Machines: Neither board can advance blindly (e.g., G&C won't spin up the rotors until NAV confirms its state estimator is ready). The authors linked separate state machines using Internal Block Diagrams and injected custom guard logic via Action Language Helper (ALH) APIs, allowing one state machine to dynamically query the real-time state of another before transitioning.
- The "Hot Swap" Fault Pattern: To model mid-air failover, they built a signal-duplicating "arbitrator" block that feeds identical commands to two concurrent G&C state machines (primary and backup). Because the single NAV computer needs to know which G&C computer to listen to, they created a dynamic reference property (
active_gnc_mc) that instantaneously re-routes dependencies from the dead unit to the backup upon a fault trigger.
Finally, they explored autocoding—using an open-source tool called Comodo to automatically translate their SysML state machines into C/C++ Quantum Platform code—and mapped Excel flight timelines into SysML sequence diagrams to generate automated verification tests.
Datasets
Not discussed in the paper. (This is a systems engineering and flight-software architecture study rather than a machine-learning or data-driven study, so no training or evaluation datasets were used.)
Key Insights and Ideas
- Simulating architecture exposes microsecond race conditions: During simulated hot swaps, the team noticed signals mysteriously vanishing. In SysML (and real hardware), if a signal arrives during the tiny, sub-millisecond window while one flight computer disconnects and the backup takes over, the signal is dropped. Losing a single high-priority fault signal mid-flight could be fatal. The model prompted them to add a hot-swap status flag (
hs_active) into the signal-sender guards, holding critical signals until the handover finishes. - Hardware memory design gets informed by behavioral models: Modeling the failover forced engineers to draw a crisp boundary between transient working memory and persistent, shared non-volatile RAM—clarifying exactly what state data the backup brain needed to wake up mid-flight without losing control.
- Executable models force syntactic honesty: You can wave your hands on a PowerPoint slide, but a simulation won't run if your logic is incomplete. Executable SysML forced systems engineers to nail down exact transition guards early, making the handoff to C++ developers remarkably smooth.
Key Results
Although NASA canceled the SRH project in spring 2024 as part of a broader Mars Sample Return restructuring, the team passed Preliminary Design Review (PDR) in November 2023 and delivered a working release of the flight software:
- Validated Flight Code Delivery: Developers successfully wrote the C/C++ G&C flight software library (supporting up to 64 enumerated modes) matching the executable model's logic, verifying it in closed-loop takeoff and trajectory simulations using Ingenuity's high-fidelity HeliCAT simulator.
- Autocode vs. Hand-Written Code Parity: Prototyping auto-generated C++ from the SysML model via Comodo produced state-machine code structurally and functionally very similar to the human-written flight code.
- Automated Test Proof-of-Concept: The team successfully built executable sequence diagrams for three nominal mission profiles (egress, mapping, and tube retrieval), automatically generating state timeline charts to verify timing constraints and state transitions.
Limitations and Future Work
- Project Cancellation Cut V&V Short: Because SRH was descoped right after PDR, the team couldn't build out their full, automated Verification & Validation (V&V) unit-test suite from the models, stopping after three nominal proof-of-concept test cases.
- Autocoding Friction with Legacy Code: SysML is richer than what C++ autocoders support, meaning engineers must restrict how they model if they want direct code generation. Furthermore, mixing auto-generated code with Ingenuity’s heavily intertwined, hand-written heritage C++ posed tricky change-control headaches, so SRH ultimately used hand-coded software for its actual flight release.
- Future Direction—Bridging SysML and F Prime: Rather than autocoding SysML straight into raw C++, the authors suggest writing a translator from SysML into the domain-specific modeling language of F Prime (JPL's open-source flight software framework, which is adding native state-machine support). This would cleanly separate high-level system design from low-level software plumbing.
Summary updated