How mrmeizongo/xpilot works
Xpilot is an Arduino flight-stabilization system. Radio input and MPU6050 measurements feed selectable passthrough, rate, or stabilize control; outputs drive aircraft servos, with failsafe and arming behavior managed by the firmware. A serial interface and xp_serial.py support configuration and calibration. The workflow and capabilities are taken from the README; source excerpts also show EEPROM-backed configuration and the interfaces among key modules. Some implementation files were not sampled, so uncertain runtime links are omitted rather than inferred.
Main entry points: main.cpp Flight controller · Mode.cpp Flight modes · XPDebug.cpp Debug reporting · Radio.cpp Radio input
Components 23
Flight runtime
- Flight controller
src/main.cpp - Flight modes
lib/Xpilot/src/Mode.cpp - Passthrough mode
lib/Xpilot/src/PassthroughMode.cpp - Rate mode
lib/Xpilot/src/RateMode.cpp - Stabilize mode
lib/Xpilot/src/StabilizeMode.cpp - Airplane mixer
lib/Xpilot/src/AirplaneMixer.cpp - Servo outputs
lib/Xpilot/src/Actuators.cpp - Servo driver
lib/Servo/src/avr/Servo.cpp - Task scheduler
lib/Xpilot/src/Scheduler.cpp - LED notifier
lib/Xpilot/src/LEDnotifier.cpp - Debug reporting
lib/Xpilot/src/XPDebug.cpp
Inputs and sensing
- Radio input
lib/Xpilot/src/Radio.cpp - Pin interrupts
lib/PinChangeInterrupt/src/PinChangeInterrupt.cpp - IMU processing
lib/Xpilot/src/IMU.cpp - MPU6050 driver
lib/MPU6050/src/MPU6050.h
Configuration
- Configuration manager
lib/Config/src/ConfigManager.cpp - EEPROM
- Config access
lib/Xpilot/src/FlightConfigAccess.cpp
Serial interface
- Serial interface
lib/Xpilot/src/XPInterface.cpp - xp_serial tool
xp_serial.py
Other components
- Pilot / transmitter
- Aircraft servos
- Configuration operator
Connections 26
- Pilot / transmitter → Radio input: sends input
- Radio input → Flight controller: provides channels
- Flight controller → Flight modes: selects mode
- Flight modes → Passthrough mode: supports mode
- Flight modes → Rate mode: supports mode
- Flight modes → Stabilize mode: supports mode
- IMU processing → MPU6050 driver: reads sensor
- Flight controller → IMU processing: updates at 250Hz
- Flight modes → Airplane mixer: mixes surfaces
- Flight controller → Servo outputs: drives outputs
- Servo outputs → Servo driver: uses driver
- Servo driver → Aircraft servos: drives servos
- Radio input → Pin interrupts: captures pulses
- Flight controller → Task scheduler: runs periodic tasks
- Flight controller → Configuration manager: uses configuration
- Configuration manager → EEPROM: reads and writes
lib/Config/src/ConfigManager.cpp - Config access → Configuration manager: exposes config
- Configuration operator → xp_serial tool: configures aircraft
- xp_serial tool → Serial interface: communicates with
- Serial interface → Configuration manager: sets configuration
- xp_serial tool → IMU processing: supports calibration
- Flight controller → LED notifier: signals status
- Debug reporting → Task scheduler: reports task stats
lib/Xpilot/src/XPDebug.cpp - Debug reporting → Radio input: reports channel values
lib/Xpilot/src/XPDebug.cpp - Debug reporting → Flight modes: reports mode values
lib/Xpilot/src/XPDebug.cpp - Debug reporting → Servo outputs: reports output values
lib/Xpilot/src/XPDebug.cpp