SmallSat flight software and ADCS
Zero-heap embedded C++20 spacecraft flight software and attitude control system, verified in 14,000× real-time lockstep SIL to 0.0285° nadir pointing with 164 passing tests and 30M fuzz runs.
[PRJ-03] CaptureLive Python ground monitor dashboard showing SmallSat C++20 flight software telemetry, modes, and wheel exclusion over UDP
What I built
Results
[PRJ-03] Measured- Nadir pointing (3σ)
- 0.0285°
- Heap allocs / 62 h
- 0
- Lockstep SIL speed
- 14,000×
- Nadir pointing accuracy (99.73rd percentile, 2 orbits, star tracker + gyro MEKF)0.0285° (102 arcsec)
- MEKF attitude estimation error (99.73rd percentile)0.0191° (69 arcsec)
- Detumble from 10 deg/s to < 0.5 deg/s (magnetorquers only)3,593 s (0.63 orbits)
- Net wheel momentum over 10 orbits: with vs without magnetic dumping< 0.35 mN·m·s vs 3.08 mN·m·s
- Gyro dropout / stuck-at / noise burst failover to redundant gyro0.1 s / 0.3 s / 0.1 s (pointing ≤ 0.13°)
- Reaction wheel seizure isolation and 3-wheel reallocation0.8 s isolate · 7.1° transient · < 0.1° in 111 s
- Heap allocations across 62 h simulated flight (22.5M frames)0 (verified by nm -u + runtime operator new abort)
- Test suite and sanitizers (GCC 16, Clang 21/23, ASan+UBSan, TSan)164 / 164 ctest · 163 / 163 ASan+UBSan · 93.65% line coverage
- Fuzzing (libFuzzer + ASan + UBSan on COBS, packet, uplink stream)3 × 10,000,000 executions, 0 flight-code findings
- Footprint and host base-rate CPU time (100 Hz tick, 10,000 µs budget)78 kB code · 12.3 kB static RAM · 0.37 µs mean tick
Architecture
-
Single YAML schema (8 telemetry packets, 17 commands, 24 events, 30 parameters) generating C++ codecs, Python ground module, ICD, and a link-checked dictionary CRC.
-
Deterministic 100 / 10 / 1 Hz cyclic executive with deadline monitoring and a statically sized, compile-time typed publish/subscribe message bus.
-
COBS framing, CCSDS Space Packet protocol, 7-stage command validation pipeline, byte-budgeted telemetry scheduler, and stored command sequences.
-
B-dot detumble, TRIAD initialization, gyro-bias MEKF, sun pointing, quaternion feedback nadir control, 4-wheel pseudo-inverse allocation with 3-wheel reconfiguration, and magnetic momentum dumping.
-
Table-driven mode manager and FDIR monitor table with watchdog, autonomous gyro failover, wheel exclusion, and SAFE mode transitions.
-
Single-threaded bit-reproducible lockstep SIL (identical 19.5 MB telemetry hash across runs and processes) plus Python live UDP dashboard, decoder, and plot/report generator.
Design decisions
-
Zero-heap compliance is enforced statically (nm -u ctest check rejecting operator new, malloc, __cxa_throw, __dynamic_cast, and printf) and dynamically (global operator new abort guard latched after init_complete, verified by death test).
-
Compile-time exhaustive dispatch() breaks the build whenever a YAML command lacks a flight-software handler.
-
Cross-language serialization tests round-trip every packet and command between C++ and Python, backed by 30M libFuzzer executions on untrusted uplink bytes.
-
All closed-loop figures are plotted directly from decoded binary CCSDS telemetry recordings without simulator shortcuts.
Figures
6 plots and captures. Select any figure to view it at full resolution.
Limits
What the model assumes and what this work does not show.
Reproduce
Run the tests and regenerate every figure from the repository.
$ cmake --preset release
$ cmake --build --preset release
$ ctest --preset release
$ build/release/apps/sil_run scenarios/06_wheel_seizure.scn --record seizure.tlm