How songge8/cf-drone works
CF-Drone is ESP32-family multirotor flight-controller firmware. The principal workflow is pilot input (SBUS or the documented web remote), flight-control computation, and motor output, with IMU sensing feeding attitude estimation and safety logic constraining operation. The README also documents battery protection, Wi-Fi/web control, console configuration, LEDs, and logging. Several runtime files are unsampled, so their likely connections are shown only as unverified dashed edges; source-level links are limited to indexed references and excerpts.
Main entry points: control.ino Flight control · estimate.ino Attitude estimation · MPU9250.cpp MPU6500/9250 driver · safety.ino Arming and failsafe
Components 23
Pilot interfaces
- SBUS receiver
drivers/SBUS.cpp - Web remote
web_rc.ino - Remote interface
web_rc_html.h - Wi-Fi service
wifi.ino
Flight control
- Flight control
control.ino - PID controllers
pid.h - Low-pass filter
lpf.h - Motor output
motors.ino
Sensing and estimation
- IMU interface
drivers/IMU.h - MPU6500/9250 driver
drivers/MPU9250.cpp - Sensor bus I/O
drivers/invensense_imu.cpp - Attitude estimation
estimate.ino - Vector math
vector.h - Quaternion math
quaternion.h - Vector primitives
vector.h
Runtime and safety
- Battery monitoring
battery.ino - Arming and failsafe
safety.ino - Parameters and console
parameters.ino - Debug console
cli.ino - LED status
led.ino - Logging
log.ino - MAVLink
mavlink.ino
Other components
- Pilot
Connections 21
- Pilot → SBUS receiver: sends commands
- Pilot → Remote interface: sends commands
- Remote interface → Web remote: provides interface
- Wi-Fi service → Web remote: hosts remote
- SBUS receiver → Flight control: supplies input
- Web remote → Flight control: supplies input
- Flight control → PID controllers: uses control loops
- PID controllers → Low-pass filter: filters derivative
pid.h - Flight control → Motor output: commands output
- MPU6500/9250 driver → Sensor bus I/O: uses bus I/O
- MPU6500/9250 driver → IMU interface: implements interface
- MPU6500/9250 driver → Attitude estimation: provides measurements
- Attitude estimation → Flight control: provides attitude
- Quaternion math → Vector math: uses vector math
quaternion.h - Attitude estimation → Quaternion math: uses rotations
- Attitude estimation → Vector primitives: uses vectors
- Battery monitoring → Arming and failsafe: triggers protection
README.MD - Arming and failsafe → Motor output: limits operation
README.MD - Parameters and console → Debug console: configured through
README.MD - Arming and failsafe → LED status: signals warnings
README.MD - Debug console → Logging: displays diagnostics