我一直想知道當所有螺旋槳都處於水平狀態時，四軸飛行器實際上如何偏轉。我知道其中兩個電動機的旋轉速度更快，但是我不明白該電動機如何在水平方向上產生推力（我想必須這樣做）以使四軸飛行器轉彎。

# 四旋翼飛機如何偏航？

It’s all about inertia.

By changing the speed of the rotors spinning in one direction, due to the conservation of momentum, the quad moves in the other direction.

That’s quite a confusing way to put it, so imagine this:

You’re facing a friend, both of you are in an office chair with wheels. You put out your right hand and push off your friend’s left hand. Even though you’re pushing your friend to make them rotate, (like the motor spinning the propeller), you also end up rotating. You’re the drone, so by you pushing the propeller at different speeds, you yourself end up rotating.

The yaw effect created by the same effect that would cause a helicopter to spin if it didn't have a tail rotor.

On a multirotor, half the propellers spin clockwise (CW) and half counter-clockwise (CCW). This 50/50 split evens out the rotational forces for straight and level flight. To yaw, these forces need to be unbalanced. To spin CW for example, the CW motors spin faster and/or the CCW motors spin slower.

To minimise other movements, the CW and CCW motors alternate around the aircraft's frame. If all CW motors were on one side, a yaw motion would also cause the aircraft to tilt and move sideways.

Any vehicle yaws (i.e. turns) by having a net torque applied. What's interesting about a quadcopter is not just how it yaws, but how it yaws and *doesn't roll, pitch, or climb at the same time*.

To understand how this works, we need to briefly look at the math. We'll use a plus configuration, but really any mutirotor configuration works.

The thing to keep in mind is that thrusts and torques are related to propeller speeds. If you speed a propeller up, it's intuitively obvious that it will create more thrust. And likewise, if you spin it faster, you need more torque. So changing motor speeds changes the net forces and torques on the airframe.

(Pedantically, it goes with the square of speed. So if you double the speed you quadruple the thrust and torque. But that's not important to this analysis.)

Here's the high-level driving equation. If you've ever messed around with mixers, you'll notice that the 4x4 matrix in the middle looks really familiar:

What this does is it maps rotor speeds (squared) to torques about the roll, pitch, and yaw axes, as well as the net vertical thrust.

For hover, let's assume all motors are spinning at the same speed, `W`

. So `W = w1 = w2 = w3 = w4`

### Yaw

What happens if we *speed up the first and third and slow down the second and fourth* by the same (squared) amount `dW`

?

```
torque_x = 0*(W^2 + dW) + 1*(W^2 - dW) + 0*(W^2 + dW) - 1*(W^2 + dW) = 0
torque_y = 1*(W^2 + dW) + 0*(W^2 - dW) - 1*(W^2 + dW) + 0*(W^2 + dW) = 0
torque_y = 1*(W^2 + dW) - 1*(W^2 - dW) + 1*(W^2 + dW) - 1*(W^2 + dW) = 4*dW
F_z = 1*(W^2 + dW) + 1*(W^2 - dW) + 1*(W^2 + dW) + 1*(W^2 + dW) = 4*W^2
```

So the net force doesn't change (all the `dW`

cancel out), and neither do the net rolls and pitches, but voila we have `4*dW`

worth of torque!

For completeness, here's what happens when you want to change the other axes as well.

## Pitch

Let's change the front and back motors by the same (squared) speed, but we'll leave the other two motors alone:

```
torque_x = 0*(W^2 + 0) + 1*(W^2 - dW) + 0*(W^2 + 0) - 1*(W^2 + dW) = 2*dW
torque_y = 1*(W^2 + 0) + 0*(W^2 - dW) - 1*(W^2 + 0) + 0*(W^2 + dW) = 0
torque_z = 1*(W^2 + 0) - 1*(W^2 - dW) + 1*(W^2 + 0) - 1*(W^2 + dW) = 0
F_z = 1*(W^2 + 0) + 1*(W^2 - dW) + 1*(W^2 + 0) + 1*(W^2 + dW) = 4*W^2
```

Notice that, again, z-thrust stays constant, but this time only a pitching torque appears.

## Roll

Let's change the left and right motors by the same (squared) speed, but we'll leave the other two motors alone:

```
torque_x = 0*(W^2 + dW) + 1*(W^2 + 0) + 0*(W^2 + dW) - 1*(W^2 + 0) = 0
torque_y = 1*(W^2 + dW) + 0*(W^2 + 0) - 1*(W^2 + dW) + 0*(W^2 + 0) = 2*dW
torque_z = 1*(W^2 + dW) - 1*(W^2 + 0) + 1*(W^2 + dW) - 1*(W^2 + 0) = 0
F_z = 1*(W^2 + dW) + 1*(W^2 + 0) + 1*(W^2 + dW) + 1*(W^2 + 0) = 4*W^2
```

As always again, z-thrust stays constant, but this time only a rolling torque appears.

## Thrust

Finally, what happens if we speed up all four motors by the same (squared) speed?

```
torque_x = 0*(W^2 + dW) + 1*(W^2 + dW) + 0*(W^2 + dW) - 1*(W^2 + dW) = 0
torque_y = 1*(W^2 + dW) + 0*(W^2 + dW) - 1*(W^2 + dW) + 0*(W^2 + dW) = 0
torque_z = 1*(W^2 + dW) - 1*(W^2 + dW) + 1*(W^2 + dW) - 1*(W^2 + dW) = 0
F_z = 1*(W^2 + dW) + 1*(W^2 - dW) + 1*(W^2 + dW) + 1*(W^2 + dW) = 4*W^2 + 4*dW
```

So only in this case do we see an increase in vertical thrust (by `4*dW`

). Notice how the net torques about each axis cancel out.