Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Roll, pitch, yaw, and the mixer

A pilot of a quadcopter has four levers to pull, and it is worth naming them before naming the motors, because the whole trick of flying the machine is turning one set into the other. The four commands are throttle, meaning climb or descend; pitch, tilting the nose down or up; roll, tilting to the left or right; and yaw, turning to face a new direction while staying level. Any flight, however wild, is a changing recipe of those four. The four motors know nothing of them. Each motor makes a thrust and a reaction torque, and the job of the mixer is to translate a pilot's four commands into four motor speeds, continuously, so that asking for more roll leaves height and heading untouched.

Four motors, four independent things

Label the motors by corner. In the common X layout the craft flies with an arm pointing forward-left, forward-right, back-left and back-right, and the propellers alternate in spin direction so that diagonal pairs match. Each motor contributes to all four commands at once, with a sign that depends on where it sits and which way it turns.

Throttle is the easy one: to climb, speed up all four equally. The thrusts rise together, their sum exceeds the weight, and the craft rises without tilting, because four equal increases stay balanced. This is the common part of every motor's command, the part that does not care about geometry.

Pitch and roll work by front-to-back and left-to-right imbalance. To pitch the nose down, speed up the two rear motors and slow the two front ones by the same amount. The extra thrust at the back and the reduced thrust at the front make a couple that tips the nose down, while the total thrust, and therefore the height, barely changes because what was added at the back was taken from the front. Roll is the identical idea rotated ninety degrees: speed up one side, slow the other, and the craft leans. In both cases the key is that the change is antisymmetric, a plus on one side and an equal minus on the other, so it produces a pure rotation and disturbs nothing else.

Yaw is the subtle one, and it is where the two spin directions earn their keep a second time. To turn right without leaning or climbing, speed up the two motors that spin one way and slow the two that spin the other, by equal amounts. The total thrust is unchanged, so height holds. The thrust imbalance is diagonal and cancels in both the pitch and roll directions, so the craft stays level. But the reaction torques no longer cancel: the sped-up pair now drags the air harder than the slowed pair, the net reaction twists the frame, and the craft rotates about its vertical axis. Yaw is commanded through torque, not thrust, which is why it is always the weakest and slowest of the three rotations, and why a quadcopter yaws far less crisply than it rolls.

The mixer as four sums

All of this is captured by a table of signs, one row per motor, one column per command, and the motor's speed command is throttle plus the signed contributions of pitch, roll and yaw:

Mi=T+aiP+biR+ciY

Here T is throttle, P, R and Y are the pitch, roll and yaw commands, and the coefficients ai, bi, ci are each +1 or -1 according to the corner and spin of motor i. A front motor gets -1 for a nose-down pitch and a rear motor +1; a left motor and a right motor get opposite roll signs; a clockwise motor and a counter-clockwise motor get opposite yaw signs. The pattern of signs is fixed by the geometry and never changes in flight. Flying the craft is nothing more than feeding four numbers into these four sums, thousands of times a second.

Example. A quadcopter hovers with every motor at a throttle value of 1500, on a scale where 1000 is off and 2000 is full. The pilot pushes for a small nose-down pitch worth 80 units, with no roll or yaw. What are the four motor commands?

The two front motors take 1500-80=1420 and the two rear motors take 1500+80=1580. The average is still 1500, so the total thrust and the height are unchanged, and the craft rotates nose-down until the pilot centres the stick.

Now you. From the same 1500 hover, the pilot commands a right roll of 60 units and nothing else. The right side motors should slow and the left side speed up. What are the left and right motor values?

Answer

The two left motors go to 1500+60=1560 and the two right motors to 1500-60=1440. The craft leans right, height held.

Saturation, and why a big command steals from the others

The sums have a ceiling and a floor. A motor cannot be commanded above full or below off, so once a motor is already near 2000, asking for more pitch cannot make it climb further, and the mixer has run out of room. This is motor saturation, and it is the reason a quadcopter at full throttle can barely steer: there is no headroom left to add to the motors that a roll would need. Good flight controllers handle saturation by pulling the whole throttle down a little when a rotation command would otherwise clip a motor, sacrificing a touch of height to keep the craft steerable, on the sound principle that a craft that will not turn is more dangerous than one that sags a few centimetres. It is the same reserve argument as the thrust to weight ratio in the previous lesson, now seen from inside the mixer: flying near the ceiling leaves nothing for control.

Why the craft still needs a brain

The mixer is a fixed piece of arithmetic. It faithfully turns a pitch command into the right motor imbalance, but it has no idea whether the craft is actually level. If the pilot commands zero pitch and zero roll, the mixer holds all four motors equal, and a perfectly balanced craft in still air would stay put. No real craft is perfectly balanced and no real air is still, so left to the bare mixer the machine drifts and tips within a second. What closes the gap is a controller that measures the craft's actual rotation and generates the pitch, roll and yaw commands itself, correcting error rather than obeying a stick. The mixer sits underneath that controller and never changes; the controller above it is the subject of the sensing and control lessons later in the course. For now the important result is the division of labour. The mixer answers the question of how to produce a wanted rotation from four motors. It says nothing about what rotation is wanted, and that second question is the harder half of making a quadcopter fly.