Universal Controls Flight Controller Documentation

Draft documentation for the STM32H743 flight-controller board, Python GUI, firmware state machine, serial protocol, supported interfaces, and development plan.

Project Overview

Universal Controls is focused on flight-control development with a 3D-printable drone frame ecosystem. The project combines a custom STM32H743 flight-controller PCB, firmware, a Python tuning and bench-control app, and documentation for repeatable development.

The near-term goal is a minimal, understandable flight stack for quadrotor experiments. The longer-term goal is a developer kit that can support different quad builds, sensors, and standard ground-control interfaces without hiding the engineering.

Newest FC board image goes here
Suggested replacement: flight_controller_latest.png
Use a real photo or render of the current PCB revision.

Flight Controller Summary

ItemCurrent valueNotes
MCUSTM32H743VIT6Main flight-control MCU.
IMUICM-20948Main onboard inertial sensor for minimal flight mode.
IMU level shifting74LVC1T45 level shiftersBetween STM32 and 1.8 V IMU domain.
Main regulatorLM2675MX-3.3/NOPBMain 3.3 V board supply. Final load rating still needs review.
Additional 5 V regulator5 V peripheral supply regulatorTo power 5 V peripherals.
IMU regulatorXC6206P182MRLocal 1.8 V supply for the IMU domain.
CAN transceiverSN65HVD230DRElectrical interface for future DroneCAN work.
Secure elementATECC608A-SSHDA-TPresent on board; firmware use is still TBD.
PCB stack2 copper layers, 1.6 mmExtracted from the current KiCad PCB.
Approx board size75.43 mm x 53.00 mmExtracted from current Edge.Cuts outline.

Interfaces and Supported Peripherals

ESC1..ESC4

Four PWM signal outputs. The ESCs carry motor power externally; the FC connector outputs are command signals plus ground reference.

UART Interfaces

There are two UART interfaces. UART interface 1 is intended for the receiver. UART interface 2 depends on the selected flight mode and can be used for telemetry, bench connection, MAVLink/QGroundControl, or another supported serial role.

GPS / MAG

The GPS interface is aimed at M10-style 10-pin GPS/magnetometer connections, such as Holybro M10 10-pin modules.

I2C

3.3 V logic I2C expansion with different supply-header options. Peripheral compatibility should be configured explicitly in the app.

DroneCAN

CAN bus through an onboard transceiver for later DroneCAN experiments.

SWD / Debug

Programming, debug, SWO, and serial development paths remain central to the developer-kit workflow.

Software Summary

ComponentPurpose
FirmwareReal-time sensing, estimation, control, motor output, configuration, telemetry, and safety state machine.
Python GUIBench workflows, plotting, tuning, configuration, calibration, and event analysis.
Serial protocolCSV telemetry from firmware, ASCII commands from GUI, and ACK/ERR/EVT responses back to GUI.
Flash configPersistent vehicle/controller/estimator values stored in STM32 internal flash.
Event bufferHigh-rate capture around fault or pilot disable for post-test analysis.

Firmware State Machine

State / conceptMeaning
RC_ONLYNormal RC-driven flight/monitoring state. Pilot motor enable controls motor authority when safety gates pass.
Bench ControlGUI-controlled testbench mode. Motors require explicit bench arm and are used only for bench workflows.
FaultMotor outputs forced off. Flight-event buffer can be fetched for analysis.
Telemetry packageThe active CSV field set selected by the current GUI tab.
RAM configCurrently active firmware configuration. Changes take effect immediately but do not survive reset unless saved.
Flash configPersistent configuration stored in STM32 flash and loaded on startup.

Minimal Flight Mode

The current minimal flight mode is intended for early controlled tests without GPS. It uses the onboard ICM-20948, RC input, a hover-centered throttle curve, roll/pitch attitude commands, yaw rate damping, and event-buffer based post-test analysis.

InputCurrent role
Throttle stickLow stick maps toward idle spin, mid stick maps near hover_thrust_norm, high stick maps toward max_motor_norm.
Roll stickRoll attitude setpoint.
Pitch stickPitch attitude setpoint.
Yaw stickYaw-rate command. Heading hold is optional through att_yaw_kp.
Pilot motor enablePrimary flight motor enable / kill control.

Communication Protocol

DirectionFormatUse
Firmware to GUICSV telemetryLive data packages and plots.
GUI to firmware$CMD ASCII linesMode, telemetry, config, tuning, motor bench commands, event requests.
Firmware to GUI$ACK, $ERR, $EVTCommand status, errors, state changes, event notifications.

GUI Tab Reference

Each screenshot below is a full-width placeholder. Replace the PNG files in this folder with real screenshots using the same filenames.

Main Data

Monitor Main Data Tab screenshot

Main Data is the compact live flight overview. It confirms serial connection, firmware state, RC validity, pilot motor enable, battery status, attitude estimates, setpoints, yaw/heading, and throttle command. It is the first tab to check after connecting.

Vehicle Config

Monitor Vehicle Config Tab screenshot

Vehicle Config contains physical vehicle and broad operating values such as mass, arm length, hover throttle, max motor command, idle spin, and attitude deadband. It supports local files, Apply To RAM, Restore From Flash, Save To Flash, and Clear FC Flash Config.

Flight Event

Monitor Flight Event Tab screenshot

Flight Event fetches and plots the frozen firmware event buffer. It is used after faults, pilot-disable events, and suspicious instability to inspect attitude, controller outputs, motor commands, and loop timing.

Motor Control

Bench Motor Control Tab screenshot

Motor Control provides direct bench motor commands. It requires an explicit Bench Control session and should be used with props removed or with the vehicle safely restrained.

Motor Balancing

Bench Motor Balancing Tab screenshot

Motor Balancing drives one motor at fixed output levels and displays a firmware-computed vibration score. It is designed for practical balancing work where the user may stand away from the vehicle.

Motor Mixing

Bench Motor Mixing Tab screenshot

Motor Mixing shows how roll, pitch, yaw, and throttle become M1-M4 commands. It is used to validate motor numbering, sign conventions, yaw pairs, limits, and saturation behavior.

Orientation

Bench Orientation Tab screenshot

Orientation contains detailed magnetic/body-vector diagnostics. It helps verify calibrated magnetometer vectors, body-frame projections, and heading behavior.

RC Link

Bench RC Link Tab screenshot

RC Link displays raw and normalized RC channels. It should be used before flight tests to confirm channel order, range, direction, failsafe behavior, and pilot motor enable mapping.

Calibrate Magnetometer (ICM20948)

Bench Calibrate Magnetometer Tab screenshot

Calibrate Magnetometer supports collecting and fitting magnetometer calibration data for the onboard ICM20948. It is used to check heading consistency and calibration quality.

Control Tuning

Bench Control Tuning Tab screenshot

Control Tuning is the manual tuning workspace for controller parameters. It combines live plots, a tuning table, RAM apply, flash save, restore, clear flash, and 5-second high-rate capture.

Estimator Tuning

Bench Estimator Tuning Tab screenshot

Estimator Tuning selects the active estimator and displays estimator-specific parameters. It also supports gyro-only comparison and high-rate capture for diagnosing noise, drift, and slow attitude wander.

Development Plan

PhaseGoal
1Stabilize minimal ICM-only flight mode and document the basic safe test workflow.
2Improve bench teststand and use repeatable flight-event captures for controller tuning.
3Finalize config architecture for vehicle, controller, estimator, and peripheral choices.
4Review the PCB, ratings, connectors, and power-tree before a next hardware revision.
5Add direct MAVLink/QGroundControl basics: heartbeat, attitude, battery, status, modes, and parameters.
6Package firmware, GUI, documentation, frame files, and teststand workflow as a developer kit.