robotics//drone//multirotor//motor mixer

A motor mixer is the fixed linear map, inside a autopilot, that turns the total thrust and the torques the controller wants into one command per motor, and it is the last software step before the ESCs in every multirotor. The controller thinks in body terms (lift this much, roll this much, yaw this much); the motors only know their own speed, and the mixer is the translation.


A motor mixer is the fixed linear map, inside a autopilot, that turns the total thrust and the torques the controller wants into one command per motor, and it is the last software step before the ESCs in every multirotor. The controller thinks in body terms (lift this much, roll this much, yaw this much); the motors only know their own speed, and the mixer is the translation.

On the planar drone, with two motors at distance ℓ\ellℓ from the centre, the map is two equations. A total thrust TTT and a torque τ\tauτ require

T1=12(T+τ/ℓ),T2=12(T−τ/ℓ),T_1=\tfrac12\left(T+\tau/\ell\right),\qquad T_2=\tfrac12\left(T-\tau/\ell\right),T1​=21​(T+τ/ℓ),T2​=21​(T−τ/ℓ),

so the sum of the two thrusts lifts and their difference tilts. A quadcopter has four motors and four things to control (thrust, roll, pitch, yaw), and the mixer becomes a 4×4 matrix whose rows come from the frame's geometry: arm positions give roll and pitch, and the spin direction of each propeller gives yaw, because a quad yaws by speeding up the two motors that turn one way and slowing the other two, letting their drag torques disagree. Inverting that matrix is the whole job while every motor stays within its range.

When the motors cannot do everything, the mixer decides what to give up, and the order is a safety decision: roll and pitch first, because they keep the aircraft upright; then thrust or yaw. A drone that yields a little altitude or lets its heading drift survives; one that loses attitude for a few tenths of a second is upside down.

Saturation lives here. A full-power climb plus a hard roll can ask one motor for more than 100 % and its neighbour for less than idle. The mixer then shifts or scales the commands (stock autopilots raise or lower the whole set and trim yaw first) so the torque that matters is still delivered (saturation). While it does, the loops above should stop integrating, or integral windup arrives with the next manoeuvre.

It assumes the thrust map is right. The mixer computes thrusts, but the ESC receives commands, and thrust grows with the square of rotor speed (propeller thrust); a thrust curve or a linearization at hover sits between the two. Battery sag and a nicked propeller change that map without telling the mixer, which is where adaptation and the hover-thrust estimate of the multirotor hub come in.

A fixed matrix is the simplest case of control allocation. With more motors than axes, with limits that change, or after a motor fails, the split stops being one inverse and becomes a choice, recomputed in flight.

In cascade control it sits under the angular-rate loop, which sends it the desired torques at hundreds of Hz to a few kHz.