Software Concept
The software is built around a custom STM32 flight-control firmware and a Python development GUI. The firmware owns real-time control, estimator updates, motor safety, configuration, and telemetry. The GUI owns bench workflows, live plots, event analysis, configuration editing, and tuning.
The current focus is a minimal flight mode using the onboard ICM-20948, RC input, hover-centered throttle mapping, roll/pitch attitude control, yaw rate damping, and event-buffer based analysis.
Main Software Blocks
| Block | Role |
|---|---|
| Firmware state machine | Separates RC-only operation, bench control, active flight, and fault behavior. |
| Estimator layer | Supports estimator selection and tuning. Mahony is the practical default; MEKF/UKF infrastructure exists for later work. |
| Controller layer | Currently cascaded angle/rate controller with live tunable gains, output limits, idle spin, and hover-centered throttle behavior. |
| Config system | Vehicle, controller, and estimator values can be applied to RAM and saved to STM32 flash. |
| Telemetry packages | Each GUI tab requests the firmware data package it needs, reducing GUI clutter and serial load. |
| Flight event buffer | Firmware stores high-rate data around fault/pilot-disable events for post-test analysis. |
Communication Model
| Direction | Format | Purpose |
|---|---|---|
| Firmware to GUI | CSV telemetry lines | Live plots and tab-specific data packages. |
| GUI to firmware | ASCII command lines beginning with $CMD | Mode changes, config, tuning, motor bench commands, event requests. |
| Firmware to GUI | $ACK, $ERR, $EVT | Command responses, errors, state changes, event notifications. |
App Modes
| Mode | Purpose | App Sub Modes |
|---|---|---|
| Monitor | Flight data, vehicle configuration, and post-event analysis. | Main Data, Vehicle Config, Flight Event. |
| Bench Control | Testbench workflows where the GUI may take controlled authority. | Motor Control, Motor Balancing, Motor Mixing, Orientation, RC Link, Magnetometer Calibration, Control Tuning, Estimator Tuning. |
Safety-Oriented Behavior
| Situation | Expected behavior |
|---|---|
| Boot/init | Motors remain stopped until firmware is initialized and safety gates allow control. |
| RC-only flight | RC pilot motor enable and throttle/sticks control stabilized flight if gates pass. |
| Bench disarmed | GUI may connect and inspect data, but motors remain stopped. |
| Bench armed | GUI may command motors for explicit bench workflows. |
| Fault | Motors are forced off and event data can be fetched. |
Development Direction
The near-term software value is not trying to replace QGroundControl. The project should use the custom app where it is strongest: bench work, tuning, estimator development, and FC-specific diagnostics. Later MAVLink/QGroundControl support can cover standard telemetry, mode/status, battery, attitude, parameters, and basic flight integration.