Parhelion

2026-03-19

Code and docs

DanSTAR flight-computer program: team-owned Python on Raspberry Pi and an in-house HAT. Explicit mission state, safety interlocks, and linked OS and operator workstreams.

python · embedded · rocketry · state-machine · raspberry-pi

Repository

Parhelion is DanSTAR’s onboard flight-computer program: Python on Raspberry Pi-class hardware with an in-house HAT for engine I/O. The flight application in DanSTAR-DTU/parhelion is team-built. I joined DanSTAR in September 2024, became Software Team Lead in March 2025 for a five-person software team, and own architecture, interfaces, and the boundaries between application code, operator procedure, and OS/image integration.

Program scope and ownership

WorkstreamOwnerWhere to read
Flight application (main.py, engine, nodes, state machine, MCLink)DanSTAR teamThis page
Architecture, interfaces, subsystem ownershipPiotr (Software Team Lead)This page
OS/image integration (Yocto CM4 line, flash, update path)PiotrParhelion Yocto
Operator checklists and procedure PDFsDanSTAR teamparhelion-procedures
Shared team infrastructureDanSTAR teamDanSTAR Server Infrastructure
Architecture signalImplementation
Scheduler100 Hz Engine loop
CommunicationThread-safe pub/sub DataBus
Mission stateExplicit pytransitions FSM with stage-gated commands

Prior stack and the Pi + HAT path

DanSTAR previously pursued an STM microcontroller path with FreeRTOS. That stack was abandoned. Firmware complexity and hardware support cost outweighed the benefit for a student rocket team that needed something operators could bring up, update, and debug under test-day pressure.

Decision: Raspberry Pi + in-house HAT instead of STM/FreeRTOS.

Constraints: reproducible bring-up for operators, Linux tooling for logging and updates, and one codebase the software team could extend without a separate RTOS firmware tree.

Outcome: MVP shipped on Raspberry Pi with an in-house HAT mapping ADCs, thermocouples, solenoids, servos, and safety interlock GPIO. Configurations used in hot-fire testing (self-reported, March 2026) were RPi4 with HAT rev 0 and CM4 on a Waveshare carrier with HAT rev 1. Archive naming in parhelion-data-dump is consistent with hot-fire sessions. It is not a third-party test report.

Not built: MCU-on-HAT and distributed independent HAT variants stayed on the roadmap. Extra CPU was not required once the Pi + HAT system met stability needs.

Engine, nodes, and mission state

main.py loads vehicle-specific TOML under configs/ (per-vehicle overlay directories), wires a DataBus, and starts an Engine that schedules nodes at a fixed tick rate. Hardware-facing work stays in nodes. Mission progression stays in a StateMachineNode built on pytransitions.

Startup order matters. LogCollectorNode subscribes before config load so override logs are captured. Hardware nodes (ADCNode, ThermocoupleNode, HardwareSafetyNode, SolenoidNode, ServoNode) register with the engine. MCLinkNode bridges telemetry to mission control. StateMachineNode starts last because it may publish commands to other nodes on entry.

State is explicit. Mission modes (tanking, pressurisation, hot-fire stages, shutdown) define which solenoids may fire and which servos may move. Transitions include sm_abort paths from operational stages back to hold or shutdown. Vehicle configs expose ADC channel maps, actuator names, and limits as TOML. Operators verify the same names in checklists.

Safety boundaries

Safety sits in three places: hardware I/O, mission logic, and operator procedure.

Hardware path: HardwareSafetyNode reads interlock GPIO through the HAT. It publishes structured state on the bus.

Mission path: StateMachineNode tracks interlock freshness. Messages older than five seconds are treated as open — a communication-loss guard. Abort triggers go through defined FSM transitions. Application code does not write abort GPIO ad hoc.

Operational path: Software tags, daemon health, disk headroom, and GO/NO-GO gates live in parhelion-procedures. OS image identity and rare eMMC reflash are a separate lane in Parhelion Yocto.

  • Verified in the codebase: HardwareSafetyNode, stale-interlock timeout, and sm_abort transitions.
  • Deferred on the final Yocto WIC: normal main.py hardware smoke; actuation isolation was not confirmed.

What runs underneath

Flight software assumes a reproducible Linux base. Hand-maintained DietPi exports preceded the current Yocto Scarthgap line I integrated for CM4 bench work. That OS lane — custom meta-parhelion layer, staged WIC checksums, OS 0.1 vs application tag updates — is documented in Parhelion Yocto and the bench build log. Bench sign-off there is OS/image integration PASS on one CM4 unit. It does not claim production fleet cutover or end-to-end application hardware smoke.

Operator PDF release flow — Makefile-built checklists tied to git tags — stays in parhelion-procedures. Checklist rows still reference DietPi-era paths in places. Yocto OS identity rows are not yet folded into released operator PDFs.

Scope limits

This page covers the team flight application and the program architecture I shaped as Software Team Lead. It does not claim solo authorship of node implementations, custom kernel work, flight qualification, or DanSTAR production cutover to Yocto images. Hot-fire outcomes on DietPi-era configs are self-reported, with partial archive naming support only.