- Authors
- Name
- 1. Overview
- 2. Pixhawk — The Standard in Open-Source Flight Controllers
- 3. Flight Control System Architecture
- 4. PWM Signals and ESC Protocols
- 5. Kalman Filter — The Core Algorithm of Flight Control
- 6. eVTOL (Electric Vertical Takeoff and Landing)
- 7. PX4 Autopilot
- 8. ArduPilot
- 9. ROS2 Integration
- 10. SITL/HITL Simulation
- 11. Learning Roadmap
- 12. References
1. Overview
Drones and eVTOLs (electric Vertical Takeoff and Landing aircraft) are no longer experimental technology. In 2026, Joby Aviation and Archer Aviation are launching commercial operations, and Urban Air Mobility (UAM) is becoming a reality. At the heart of all this technology lies the flight control system.
This post provides a comprehensive summary of the core elements of flight control.
┌────────────────────────────────────────────────────────────┐
│ Flight Control System Architecture │
│ │
│ Sensor Layer Estimation Layer Control Layer Output │
│ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐│
│ │IMU(6DoF)│ │ Kalman │ │PID Control│ │ PWM/ ││
│ │GPS │──→│ Filter │──→│ Pos→Vel │──→│ DShot ││
│ │Baro │ │(EKF2/3) │ │ →Att→Rate │ │ ESC ││
│ │Mag │ │Sen. Fusion│ │ →Mixer │ │ Motors ││
│ └─────────┘ └──────────┘ └──────────┘ └────────┘│
│ │
│ Comms: MAVLink ←→ QGroundControl / ROS2 / Companion PC │
└────────────────────────────────────────────────────────────┘
2. Pixhawk — The Standard in Open-Source Flight Controllers
2.1 What Is Pixhawk?
Pixhawk is not a specific product but an open hardware standard. It is maintained by the Dronecode Foundation (under the Linux Foundation), and over one million Pixhawk-based devices are in operation worldwide.
2.2 FMU Version History
| Version | Processor | Key Features |
|---|---|---|
| FMUv2 | STM32F427 (Cortex-M4, 168MHz) | First commercial Pixhawk |
| FMUv3 | STM32F427 | Flash expanded to 2MB |
| FMUv5 | STM32F7 | CAN bus added, improved expandability |
| FMUv5X | STM32F7 | Modular design, triple redundancy introduced |
| FMUv6X | STM32H753 (Cortex-M7, 480MHz) | Ethernet, triple IMU, separated sensor domains |
| FMUv6C | STM32H743 (Cortex-M7, 480MHz) | Cost-optimized, dual redundant IMU |
2.3 Pixhawk 6X (FMUv6X) Detailed Specifications
Processors:
- FMU: STM32H753 (Cortex-M7, 480MHz, 2MB Flash, 1MB RAM)
- IO: STM32F103 (Cortex-M3, 72MHz, 64KB SRAM)
Onboard Sensors (Triple Redundant):
| Sensor Type | Model | Count | Notes |
|---|---|---|---|
| IMU (Accel/Gyro) | ICM-45686 | 3 | BalancedGyro technology, separate bus & power |
| Barometer | ICP20100, BMP388 | 2 | Dual redundant |
| Magnetometer | BMM150 | 1 | - |
Key Interfaces:
- 16+ PWM servo outputs (8 IO + 8 FMU)
- Ethernet PHY — high-speed communication with mission computers
- 4x UART, 3x SPI, 2x CAN, 2x I2C
- USB-C, RC input (SBUS/CPPM/DSM)
Modular Design: IMU Board + FMU Board + Base Board separated via 100-pin/50-pin Pixhawk Autopilot Bus connectors
2.4 Pixhawk 6C (FMUv6C)
| Item | Specification |
|---|---|
| Processor | STM32H743 (Cortex-M7, 480MHz) |
| IMU | ICM-42688-P + BMI055 (dual redundant) |
| Barometer | MS5611 |
| Magnetometer | IST8310 |
| Dimensions | 84.8 x 44 x 12.4 mm |
| Weight | 59.3g (aluminum) / 34.6g (plastic) |
| Operating Temp | -25 to 85 deg C |
2.5 Supported Autopilot Firmware
| Firmware | License | Features |
|---|---|---|
| PX4 Autopilot | BSD | Dronecode official, microkernel architecture, precise control |
| ArduPilot | GPL | Community-driven, broad vehicle support, field-proven |
2.6 Ecosystem
Manufacturers: Holybro, CUAV, ARK Electronics, ModalAI, NXP, mRo, Auterion Tools: QGroundControl (GCS), MAVLink, MAVSDK, MAVROS, ROS2 integration
3. Flight Control System Architecture
3.1 Cascaded Control Structure
The PX4 multicopter controller uses a cascaded position-velocity-attitude-rate loop.
[Pos SP] → [Pos P] → [Vel PID] → [Att P] → [Rate K-PID] → [Mixer] → [Motors]
Outer loop Mid loop Att loop Inner loop
~50Hz ~50Hz ~250Hz ~1000Hz
| Layer | Controller | Input | Output | Update Rate |
|---|---|---|---|---|
| Position (outer) | P controller | Position error | Velocity setpoint | ~50Hz |
| Velocity (mid) | PID controller | Velocity error | Acceleration setpoint | ~50Hz |
| Attitude | P controller (quaternion) | Attitude error | Rate setpoint | ~250Hz |
| Rate (inner) | K-PID controller | Rate error | Torque/thrust cmd | ~1000Hz |
3.2 PID Controller
Continuous-Time PID:
Discrete-Time PID (flight controller implementation):
| Parameter | Role | Increasing | Decreasing |
|---|---|---|---|
| (Proportional) | Immediate response to error | Faster response, more oscillation | Slower, more stable |
| (Integral) | Eliminates steady-state error | Converges to zero error, overshoot risk | Residual error remains |
| (Derivative) | Responds to rate of change (damping) | Reduces overshoot, noise-sensitive | Increased oscillation |
3.3 Position/Velocity Controller
Position Controller (P):
- PX4 parameters:
MPC_XY_P,MPC_Z_P - Velocity saturation:
MPC_XY_VEL_MAX
Velocity Controller (PID): Velocity error to acceleration setpoint, with anti-reset windup applied
3.4 Attitude/Rate Controller
Attitude Controller (P, quaternion-based):
Rate Controller (K-PID): Low-pass filter applied to the derivative path for noise reduction
Gyroscope Data Processing Pipeline:
- Calibration correction -> 2. Bias removal -> 3. Notch filter -> 4. Low-pass filter
3.5 Mixer (Control Allocation)
Converts rate controller outputs into individual motor commands.
Quadcopter X-configuration example:
Where = total thrust, = roll torque, = pitch torque, = yaw torque
4. PWM Signals and ESC Protocols
4.1 PWM (Pulse Width Modulation) Fundamentals
PWM is a technique that conveys analog values by modulating the duty cycle of a digital signal.
┌────┐ ┌────────┐
│ │ │ │
─────┘ └──────────────┘ └──────────
|<-->| |<------>|
1000us 2000us
(0% throttle) (100% throttle)
|<-------------------->|
20ms (50Hz period)
| Parameter | Value |
|---|---|
| Pulse width range | 1000us (min) to 2000us (max) |
| Neutral point | 1500us |
| Standard period | 20ms (50Hz) |
| Resolution | 1000 steps |
| Signal latency | ~2ms |
4.2 ESC Protocol Comparison
| Protocol | Type | Pulse Width | Max Update Rate | Resolution | Error Detection |
|---|---|---|---|---|---|
| Standard PWM | Analog | 1000-2000us | 500Hz | 1000 | None |
| OneShot125 | Analog | 125-250us | 4kHz | 1000 | None |
| OneShot42 | Analog | 42-84us | ~12kHz | 1000 | None |
| Multishot | Analog | 5-25us | ~32kHz | 1000 | None |
| DShot150 | Digital | - | 150 kbps | 2048 | CRC 4-bit |
| DShot300 | Digital | - | 300 kbps | 2048 | CRC 4-bit |
| DShot600 | Digital | - | 600 kbps | 2048 | CRC 4-bit |
| DShot1200 | Digital | - | 1200 kbps | 2048 | CRC 4-bit |
4.3 DShot Protocol in Detail
DShot is the de facto standard ESC protocol as of 2025.
Frame Structure (16 bits):
[11-bit throttle (0-2047)] [1-bit telemetry request] [4-bit CRC]
- Throttle values 1-47: Reserved for special commands (beep, motor direction reversal, ESC settings)
- Bit encoding: 0/1 distinguished by HIGH/LOW ratio (1 = 75% HIGH, 0 = 37.5% HIGH)
Bidirectional DShot:
- ESC sends eRPM telemetry back to the FC
- Real-time RPM data enables dynamic notch filtering, dramatically improving vibration suppression
- Data provided: RPM, voltage, current, temperature
4.4 PWM vs DShot — Key Differences
| Characteristic | PWM (Analog) | DShot (Digital) |
|---|---|---|
| Signal method | Value encoded via pulse width | 0/1 bit stream |
| Calibration | Required (varies per ESC) | Not required |
| Noise immunity | Low | High (CRC error detection) |
| Resolution | 1000 steps | 2048 steps |
| Bidirectional | Not possible | Possible (telemetry) |
| Special commands | Not possible | Possible |
5. Kalman Filter — The Core Algorithm of Flight Control
5.1 Kalman Filter Fundamentals
The Kalman filter is a recursive algorithm that optimally estimates system state from noisy multi-sensor measurements.
┌──────────────────────────────────────────────────────┐
│ Kalman Filter Cycle │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ Step 1: Predict │ │ Step 2: Update │ │
│ │ (Time Update) │────►│ (Meas. Update) │ │
│ │ │ │ │ │
│ │ x̂ = F·x + B·u │ │ K = P·Hᵀ·S⁻¹ │ │
│ │ P = F·P·Fᵀ + Q │ │ x̂ = x̂ + K·(z-Hx̂)│ │
│ │ │ │ P = (I-KH)·P │ │
│ │ Predict via │ │ Correct with │ │
│ │ motion model │ │ measurements │ │
│ └──────────────────┘ └────────┬─────────┘ │
│ ▲ │ │
│ └────────────────────────┘ │
│ Repeat │
└──────────────────────────────────────────────────────┘
Step 1: Prediction (Time Update)
| Symbol | Meaning |
|---|---|
| State estimate vector | |
| State transition matrix | |
| Control input matrix | |
| Control input (e.g., gyro angular rate) | |
| Error covariance matrix | |
| Process noise covariance |
Step 2: Update (Measurement Update)
| Symbol | Meaning |
|---|---|
| Kalman gain — determines weighting between prediction and measurement | |
| Observation matrix | |
| Actual measurement | |
| Measurement noise covariance |
Intuition Behind the Kalman Gain:
- : Trust the measurement more (low measurement noise)
- : Trust the prediction more (accurate model)
5.2 Extended Kalman Filter (EKF)
Since drone dynamics are nonlinear, the standard Kalman filter cannot be applied directly. The EKF linearizes nonlinear functions using a first-order Taylor series expansion.
Nonlinear System:
EKF Prediction:
EKF Update:
5.3 Error-State Kalman Filter (ESKF)
PX4's EKF2 implements the Error-State Kalman Filter. It is essential for estimating uncertainty in quaternion rotations.
Key Idea:
- Instead of directly estimating the quaternion, estimate the error rotation vector
- Represent rotational uncertainty as a 3D vector in the tangent space of SO(3)
- Separate the Nominal State (inertial navigation equations) from the Error State (Kalman filter)
5.4 PX4 EKF2 (ECL EKF) — 24-State Vector
| Index | State | Description |
|---|---|---|
| 0-3 | Quaternion (q0-q3) | NED to Body frame rotation |
| 4-6 | Velocity (Vn, Ve, Vd) | NED frame [m/s] |
| 7-9 | Position (Pn, Pe, Pd) | NED frame [m] |
| 10-12 | Gyro bias | IMU gyroscope [rad/s] |
| 13-15 | Accelerometer bias | IMU accelerometer [m/s^2] |
| 16-18 | Earth magnetic field | NED frame [Gauss] |
| 19-21 | Body magnetic field bias | Body frame |
| 22-23 | Wind velocity (Wn, We) | North/East wind [m/s] |
Sensor Fusion Architecture:
- Delayed fusion: Sensor data stored in a FIFO buffer to accommodate per-sensor time delays, fusing data at matching timestamps
- IMU data: Used only for state prediction, never as an observation
- Multiple EKF instances: Enhanced fault detection (MAX(IMU count, 1) x MAX(magnetometer count, 1), up to 16 instances)
- Multi-hypothesis filter: Gaussian sum filter for yaw estimation, capable of using GPS velocity alone
5.5 ArduPilot EKF2 vs EKF3
| Feature | EKF2 | EKF3 (current default) |
|---|---|---|
| Sensor affinity | Not supported | Supported — dynamic non-primary sensor switching |
| Additional sensors | Basic only | Beacons, wheel encoders, visual odometry |
| Lane switching | Limited | Dynamic lane switching |
| Fallback | EKF2 to DCM | EKF3 to DCM |
| Parameters | EK2_* | EK3_* |
5.6 Complementary Filter vs Kalman Filter
Where (typically 0.96-0.98)
| Feature | Complementary Filter | Kalman Filter |
|---|---|---|
| Complexity | Low | High |
| Compute load | Lightweight (embedded) | Heavy (FPU required) |
| Principle | HPF(gyro) + LPF(accelerometer) | Optimal weighted average (covariance) |
| Bias | May be present | Bias-free |
| Multi-sensor | Suited for 2 sensors | Optimal for multiple sensors |
| Fault tolerance | None | Innovation consistency check |
6. eVTOL (Electric Vertical Takeoff and Landing)
6.1 What Is eVTOL?
An eVTOL is an aircraft that takes off and lands vertically using an electric propulsion system and flies horizontally. As a core element of Urban Air Mobility (UAM), it is ushering in the era of "flying taxis."
6.2 Market Overview
- Market size: ~8.0B by 2033 (CAGR 37%)
- Commercial operations expected to begin in 2026: Joby Aviation, Archer Aviation
| Company | Aircraft | Max Speed | Range | Passengers | Market Share |
|---|---|---|---|---|---|
| Joby Aviation | S4 | 322 km/h | 241 km | 4+1 | 22% |
| Archer Aviation | Midnight | 241 km/h | 32-80 km | 4+1 | 18% |
| Lilium | Lilium Jet | 300 km/h | 250 km | 6 | 5-8% |
| EHang | EH216-S | 130 km/h | 35 km | 2 | - |
| Volocopter | VoloCity | 110 km/h | 35 km | 2 | - |
6.3 Airframe Configuration Types
Multirotor
① ②
\ /
┌────┐
│ │
└────┘
/ \
③ ④
- 4-8 rotors provide both lift and thrust
- Pros: Simple, stable hovering
- Cons: Worst energy efficiency (inefficient during cruise)
- Examples: EHang EH216-S, Volocopter VoloCity
Lift + Cruise
Vertical rotor Vertical rotor Rear propeller
↓ ↓ ↓
┌──┐ ┌──┐ ═══════ ▶───
└──┘ └──┘ Wing
- Separate rotors for vertical takeoff and propellers for horizontal flight
- Pros: Each flight phase is optimized
- Cons: Vertical rotors are dead weight during cruise
- Examples: Archer Midnight, Vertical Aerospace VX4
Tiltrotor
Hover: → Cruise:
↑ ↑ → →
│ │ ╱ ╲
┌──┐ ┌──────┐
└──┘ └──────┘
- Rotors tilt between vertical and horizontal orientations
- Pros: Efficient with a single propulsion system
- Cons: Mechanical complexity of tilt mechanism
- Examples: Joby S4 (6 tilting rotors), Bell Nexus
Tiltwing
- The wing itself tilts along with the rotors
- High-speed, long-range capability
- Examples: Lilium Jet (36 electric engines embedded in wings)
6.4 Certification Framework
FAA (United States):
- eVTOL reclassified under the "Powered-Lift" category
- AC 21.17-4 (2025.07): Max 12,500 lbs, 6 seats or fewer, battery-electric propulsion
- Joby: Stage 4 certification 70% complete (2025 Q3)
- Archer: Achieved longest piloted flight of 55 miles (2025.08)
EASA (Europe):
- Issued SC-VTOL (Special Condition - VTOL)
- Pursuing standards harmonization with FAA
6.5 Battery Technology
| Item | Current | Required |
|---|---|---|
| Li-ion energy density | ~250 Wh/kg | - |
| 300km range | - | 300-600 Wh/kg |
| 600km range | - | 600+ Wh/kg |
| Economical long-range | - | 800+ Wh/kg |
Solid-State Battery Breakthrough:
- EHang + Inx: Achieved 480 Wh/kg
- World's first eVTOL solid-state battery flight test successful (48 min 10 sec)
- Advantages: Higher energy density, thermal stability, reduced flammability
7. PX4 Autopilot
7.1 Architecture
PX4 follows a microkernel philosophy, using the uORB (Micro Object Request Broker) publish-subscribe bus for inter-module communication.
┌──────────────────────────────────────────────────┐
│ PX4 Flight Stack │
│ │
│ Sensor Drivers ──┐ │
│ EKF2 Estimator ──┼──→ [uORB Bus] ──→ MAVLink │
│ Control Modules──┤ ──→ Mixer/Actuators│
│ Flight Modes ──┘ ──→ Logger │
└──────────────────────────────────────────────────┘
7.2 Flight Modes
Manual Modes:
| Mode | Description |
|---|---|
| Stabilized | Stick controls vehicle angle, levels on release |
| Acro | Aerobatic flight, stick controls angular rate |
Assisted Modes:
| Mode | Description | Sensor Required |
|---|---|---|
| Altitude | Holds altitude, manual horizontal | Barometer |
| Position | Holds 3D position — safest | GPS + Barometer |
Autonomous Modes:
| Mode | Description |
|---|---|
| Hold | Hovers at current position |
| Return | Climbs to safe altitude, returns home, lands |
| Mission | Autonomous waypoint flight |
| Offboard | Follows setpoints from companion PC |
7.3 MAVLink Protocol
A lightweight messaging protocol for communication between drones and ground stations or companion computers.
MAVLink v2 Message Structure:
[STX][LEN][INC][CMP][SEQ][SYS_ID][COMP_ID][MSG_ID(3B)][PAYLOAD][CRC][SIGNATURE]
- Heartbeat: Sent at 1Hz, includes vehicle type, flight mode, and system status
- QGroundControl: Open-source ground control station based on MAVLink
8. ArduPilot
8.1 PX4 vs ArduPilot
| Item | ArduPilot | PX4 |
|---|---|---|
| License | GPL (disclosure required) | BSD (no disclosure required) |
| Code size | 700,000+ lines | Relatively smaller |
| Architecture | Monolithic tendency | Microkernel (uORB) |
| Community | Very large and active | Corporate-led (Auterion) |
| Field-proven | Top tier | Specialized in precise control |
| Default EKF | EKF3 | ECL EKF2 |
| GCS | Mission Planner, QGC | QGroundControl |
8.2 Supported Vehicles
| Vehicle | ArduPilot | PX4 |
|---|---|---|
| Copter (multirotor) | ArduCopter | Supported |
| Plane (fixed-wing) | ArduPlane | Supported |
| Rover (ground) | ArduRover | Supported |
| Sub (underwater) | ArduSub | Limited |
| VTOL | QuadPlane | Supported (strength) |
| Helicopter | Traditional heli support | Limited |
| Blimp/Boat | Supported | Not supported |
9. ROS2 Integration
9.1 Two Integration Approaches
┌──────────────────┐ ┌──────────────────┐
│ Companion Computer│ │ Pixhawk (PX4) │
│ │ │ │
│ [ROS2 Nodes] │ │ [PX4 Autopilot] │
│ │ │ │ │ │
│ [uXRCE-DDS │◄───►│ [uXRCE-DDS │ ← Approach 1 (Recommended)
│ Agent] │UART │ Client] │
│ or │ │ │
│ [MAVROS] │◄───►│ [MAVLink] │ ← Approach 2 (Legacy)
└──────────────────┘ └──────────────────┘
Approach 1: uXRCE-DDS (Recommended)
- PX4's built-in DDS client participates directly in the ROS2 DDS network
- uORB topics map directly to ROS2 topics
- Bypasses MAVLink for lower latency and higher bandwidth
Approach 2: MAVROS (Legacy)
- MAVLink to ROS2 topic/service bridge
- Compatible with ArduPilot
9.2 Offboard Control Example
import rclpy
from rclpy.node import Node
from px4_msgs.msg import (
OffboardControlMode,
TrajectorySetpoint,
VehicleCommand
)
class OffboardControl(Node):
def __init__(self):
super().__init__('offboard_control')
self.offboard_pub = self.create_publisher(
OffboardControlMode, '/fmu/in/offboard_control_mode', 10)
self.trajectory_pub = self.create_publisher(
TrajectorySetpoint, '/fmu/in/trajectory_setpoint', 10)
self.command_pub = self.create_publisher(
VehicleCommand, '/fmu/in/vehicle_command', 10)
def arm(self):
msg = VehicleCommand()
msg.command = VehicleCommand.VEHICLE_CMD_COMPONENT_ARM_DISARM
msg.param1 = 1.0 # Arm
self.command_pub.publish(msg)
def set_position(self, x, y, z):
msg = TrajectorySetpoint()
msg.position = [x, y, z] # NED coordinates
self.trajectory_pub.publish(msg)
10. SITL/HITL Simulation
10.1 SITL (Software-In-The-Loop)
Runs the flight firmware on a development PC without any physical hardware.
# PX4 SITL + Gazebo
cd PX4-Autopilot
make px4_sitl gz_x500
# Micro XRCE-DDS Agent (separate terminal)
MicroXRCEAgent udp4 -p 8888
# ArduPilot SITL + Gazebo
sim_vehicle.py -v ArduCopter -f gazebo-iris --console --map
- Runs the exact same code as real firmware (only simulation drivers differ)
- Risk-free algorithm validation and rapid iterative development
10.2 HITL (Hardware-In-The-Loop)
Runs standard firmware on actual Pixhawk hardware, with the simulator providing sensor data.
- Validates real hardware timing and performance
- Catches hardware compatibility issues early
- Final verification step before real flight
10.3 Gazebo Integration
Gazebo Harmonic (currently recommended):
- Physics engine, sensor simulation, camera/LiDAR rendering
- Communicates with PX4 via MAVLink or direct plugin interface
- Integration with ROS2 Humble
11. Learning Roadmap
11.1 Beginner (1-2 Months)
| Order | Topic | Resource |
|---|---|---|
| 1 | PID control theory | Duckietown - Intro to Drones |
| 2 | PX4 SITL environment | PX4 Simulation |
| 3 | QGroundControl basics | QGC User Guide |
| 4 | Kalman filter basics | kalmanfilter.net |
11.2 Intermediate (2-4 Months)
| Order | Topic | Resource |
|---|---|---|
| 5 | PX4 development | PX4 Dev Guide |
| 6 | EKF2 sensor fusion | PX4 EKF Tuning |
| 7 | ROS2 + PX4 integration | PX4 ROS2 Guide |
| 8 | ESC protocols (DShot) | Oscar Liang - DShot |
11.3 Advanced (4-6 Months)
| Order | Topic | Resource |
|---|---|---|
| 9 | Autonomous flight (Offboard) | px4-offboard |
| 10 | ArduPilot development | ArduPilot Dev Guide |
| 11 | eVTOL control algorithms | Papers and hands-on practice |
| 12 | Real vehicle build and tuning | Pixhawk 6X + frame assembly |
12. References
Official Documentation
- PX4 User Guide
- PX4 Dev Guide
- ArduPilot Copter Docs
- MAVLink Guide
- QGroundControl User Guide
- Pixhawk Open Standards
Hardware
Control and Estimation
ESC Protocols
eVTOL
- eVTOL Guide - Dewesoft
- eVTOL Market Analysis - MotorWatt
- FAA eVTOL Certification
- EHang Solid-State Battery Flight