PX4 takes desired torque and thrust commands from the core controllers and translates them to actuator commands that control motors or servos. This translation is called control allocation (or mixing), and it depends on the physical geometry of the airframe.
For example, a "turn right" torque command maps to different motor actions depending on the vehicle: a plane deflects ailerons, a quadcopter changes motor speeds differentially, and a hexacopter distributes the load across six motors.
Why mixing is separated from control
By isolating mixing from the attitude/rate controller, the core controllers do not need special handling for each airframe geometry. This greatly improves reusability — the same controller code works for a quad, hex, or octo. PX4 also abstracts the mapping of output functions to specific hardware pins.
Actuator Control Pipeline
control_allocator → uORB → output driver → hardware
text
Key CA_AIRFRAME values (enum as text) ──────────────────────────────────────────────────────────── Value Airframe type ────── ────────────────────────────────────────────── 0 Multirotor 1 Fixed-wing 2 Standard VTOL (separate MC + FW actuators) 3 Tiltrotor VTOL 4 Tailsitter VTOL 5 Rover (Ackermann) 6 Rover (Differential) 7 Motors (6DOF) 8 Multirotor with tilt 9 Custom 10 Helicopter (main + tail rotor)
Output functions are defined in src/lib/mixer_module/output_functions.yaml. The driver uses a shared library from src/lib/mixer_module that reads the _FUNCx parameters. For example, if PWM_MAIN_FUNC3 is set to "Motor 2", the 3rd hardware output receives the 2nd motor signal from actuator_motors.
Configuring in QGroundControl
Select the airframe in Basic Config > Airframe to set the broad geometry and defaults. Then fine-tune motor positions, servo assignments, and output pins in Basic Config > Actuators. The Actuators UI reads the CA_* parameters and renders the right configuration for your airframe type.