Algorithm Search⌘K

Theoremadvanced

Differential flatness of the quadrotor

Also called quadrotor flat outputs.

The full state and inputs of a quadrotor follow from position, yaw and their derivatives, so trajectories can be planned in those four outputs.

Statement

Take the quadrotor model with the world zz axis up, e3=(0,0,1)e_3 = (0, 0, 1) and g=9.81g = 9.81 m/s²:

x˙=v,mv˙=fRe3−mge3,R˙=RΩ^,JΩ˙=M−Ω×JΩ,\dot x = v, \qquad m\dot v = f R e_3 - m g e_3, \qquad \dot R = R\hat\Omega, \qquad J\dot\Omega = M - \Omega \times J\Omega,

with mass m>0m > 0, inertia JJ positive definite, thrust ff and body moment MM. Write b1,b2,b3b_1, b_2, b_3 for the columns of RR. For an angle ψ\psi, let xc=(cos⁡ψ,sin⁡ψ,0)x_c = (\cos\psi, \sin\psi, 0) and yc=(−sin⁡ψ,cos⁡ψ,0)y_c = (-\sin\psi, \cos\psi, 0). Say that ψ\psi is the yaw of RR when b2⋅xc=0b_2 \cdot x_c = 0 and b1⋅xc>0b_1 \cdot x_c > 0. This is the yaw angle of the Z-X-Y Euler angles, the convention of Mellinger and Kumar.

Theorem. Let x:I→R3x : I \to \mathbb{R}^3 be of class C4C^4 and ψ:I→R\psi : I \to \mathbb{R} of class C2C^2 on an interval II. Write a=x¨a = \ddot x, j=x...j = \dddot x and s=x(4)s = x^{(4)}, and let t=a+ge3t = a + g e_3. Assume that for all times in II:

  • (C1) nonzero thrust: t≠0t \ne 0, that is, x¨≠−ge3\ddot x \ne -g e_3;
  • (C2) a defined heading: tt is not parallel to xc(ψ)x_c(\psi).

Then there is exactly one solution (x,v,R,Ω,f,M)(x, v, R, \Omega, f, M) of the model on II with f>0f > 0 whose position is xx and whose yaw is ψ\psi. It is given by:

f=m∣t∣,b3=t∣t∣,b2=b3×xc∣b3×xc∣,b1=b2×b3,v=x˙,f = m|t|, \qquad b_3 = \frac{t}{|t|}, \qquad b_2 = \frac{b_3 \times x_c}{|b_3 \times x_c|}, \qquad b_1 = b_2 \times b_3, \qquad v = \dot x,
f˙=m b3⋅j,Ω1=−mf b2⋅j,Ω2=mf b1⋅j,Ω3=Ω1 b3⋅xc+ψ˙ b2⋅ycb1⋅xc,\dot f = m\, b_3 \cdot j, \qquad \Omega_1 = -\frac{m}{f}\, b_2 \cdot j, \qquad \Omega_2 = \frac{m}{f}\, b_1 \cdot j, \qquad \Omega_3 = \frac{\Omega_1\, b_3 \cdot x_c + \dot\psi\, b_2 \cdot y_c}{b_1 \cdot x_c},
Ω˙1=−m b2⋅s−2f˙ Ω1+f Ω2Ω3f,Ω˙2=m b1⋅s−2f˙ Ω2−f Ω1Ω3f,\dot\Omega_1 = \frac{-m\, b_2 \cdot s - 2\dot f\,\Omega_1 + f\,\Omega_2\Omega_3}{f}, \qquad \dot\Omega_2 = \frac{m\, b_1 \cdot s - 2\dot f\,\Omega_2 - f\,\Omega_1\Omega_3}{f},
Ω˙3=Ω1Ω2 b1⋅xc+(Ω2Ω3+Ω˙1) b3⋅xc+2ψ˙ (Ω1 b3⋅yc−Ω3 b1⋅yc)+ψ¨ b2⋅ycb1⋅xc,\dot\Omega_3 = \frac{\Omega_1\Omega_2\, b_1 \cdot x_c + (\Omega_2\Omega_3 + \dot\Omega_1)\, b_3 \cdot x_c + 2\dot\psi\,(\Omega_1\, b_3 \cdot y_c - \Omega_3\, b_1 \cdot y_c) + \ddot\psi\, b_2 \cdot y_c}{b_1 \cdot x_c},
M=JΩ˙+Ω×JΩ.M = J\dot\Omega + \Omega \times J\Omega.

So the position and the yaw are flat outputs of the quadrotor in the sense of differential flatness: they are functions of the state, and the state and the inputs are functions of them and of finitely many of their derivatives, up to the fourth derivative of xx and the second of ψ\psi. The four rotor thrusts follow from (f,M)(f, M) by the invertible mixer on the quadrotor dynamics page.

In plain words

A quadrotor has twelve numbers in its state and four controls, so it seems hard to plan its motion. But if you draw any smooth path through space and say which way the nose should point along the way, everything else is fixed. The push must point along the acceleration plus gravity, so the tilt follows from the path. The nose direction then fixes the full orientation. How fast the tilt changes follows from how fast the acceleration changes. And the turning effort follows from that. So a planner needs to draw only four smooth curves: three for the position and one for the heading.

This works only while the motors push. In free fall the push is zero and the tilt can be anything, so the path does not fix it.

Proof

Existence. Define ff, RR and Ω\Omega by the formulas. By (C1), ∣t∣>0|t| > 0, so f>0f > 0 and b3b_3 is a unit vector. By (C2), b3×xc≠0b_3 \times x_c \ne 0, so b2b_2 is a unit vector orthogonal to b3b_3 and to xcx_c, and b1=b2×b3b_1 = b_2 \times b_3 completes a right-handed orthonormal frame. So R=[b1 b2 b3]∈SO(3)R = [b_1\ b_2\ b_3] \in SO(3), and it is C2C^2 in tt since tt is C2C^2 and ψ\psi is C2C^2. Since b1b_1 is parallel to xc−(xc⋅b3)b3x_c - (x_c \cdot b_3)b_3, b1⋅xc=∣b3×xc∣>0b_1 \cdot x_c = |b_3 \times x_c| > 0, so ψ\psi is the yaw of RR.

Translation: fRe3=fb3=mt=mx¨+mge3f R e_3 = f b_3 = m t = m\ddot x + m g e_3, which is the second equation with v=x˙v = \dot x.

Rotation: let Ω\Omega be the body angular velocity of R(t)R(t), that is Ω^=RTR˙\hat\Omega = R^T\dot R, so the third equation holds by definition. It remains to show that Ω\Omega has the stated components. Since R˙=RΩ^\dot R = R\hat\Omega, the columns satisfy

b˙1=Ω3b2−Ω2b3,b˙2=−Ω3b1+Ω1b3,b˙3=Ω2b1−Ω1b2.\dot b_1 = \Omega_3 b_2 - \Omega_2 b_3, \qquad \dot b_2 = -\Omega_3 b_1 + \Omega_1 b_3, \qquad \dot b_3 = \Omega_2 b_1 - \Omega_1 b_2.

Differentiate mt=fb3m t = f b_3: mj=f˙b3+f(Ω2b1−Ω1b2)m j = \dot f b_3 + f(\Omega_2 b_1 - \Omega_1 b_2). Taking the dot product with b3b_3, b1b_1 and b2b_2 gives f˙\dot f, Ω2\Omega_2 and Ω1\Omega_1. Differentiate the yaw condition b2⋅xc=0b_2 \cdot x_c = 0, with x˙c=ψ˙yc\dot x_c = \dot\psi y_c: (−Ω3b1+Ω1b3)⋅xc+ψ˙ b2⋅yc=0(-\Omega_3 b_1 + \Omega_1 b_3) \cdot x_c + \dot\psi\, b_2 \cdot y_c = 0, which gives Ω3\Omega_3, since b1⋅xc>0b_1 \cdot x_c > 0.

Differentiate once more for Ω˙\dot\Omega (here xx is C4C^4 and ψ\psi is C2C^2). From ms=f¨b3+2f˙b˙3+f(Ω˙2b1−Ω˙1b2)+f(Ω2b˙1−Ω1b˙2)m s = \ddot f b_3 + 2\dot f\dot b_3 + f(\dot\Omega_2 b_1 - \dot\Omega_1 b_2) + f(\Omega_2\dot b_1 - \Omega_1\dot b_2), and Ω2b˙1−Ω1b˙2=Ω1Ω3b1+Ω2Ω3b2−(Ω12+Ω22)b3\Omega_2\dot b_1 - \Omega_1\dot b_2 = \Omega_1\Omega_3 b_1 + \Omega_2\Omega_3 b_2 - (\Omega_1^2 + \Omega_2^2) b_3, the dot products with b1b_1 and b2b_2 give Ω˙2\dot\Omega_2 and Ω˙1\dot\Omega_1. The second derivative of the yaw condition, b¨2⋅xc+2ψ˙ b˙2⋅yc+b2⋅(ψ¨yc−ψ˙2xc)=0\ddot b_2 \cdot x_c + 2\dot\psi\, \dot b_2 \cdot y_c + b_2 \cdot (\ddot\psi y_c - \dot\psi^2 x_c) = 0, with b¨2=−Ω˙3b1+Ω˙1b3−Ω3b˙1+Ω1b˙3\ddot b_2 = -\dot\Omega_3 b_1 + \dot\Omega_1 b_3 - \Omega_3\dot b_1 + \Omega_1\dot b_3 and b2⋅xc=0b_2 \cdot x_c = 0, gives Ω˙3\dot\Omega_3. Finally, defining MM by the last formula makes the fourth equation hold.

Uniqueness. Let (x,v,R,Ω,f,M)(x, v, R, \Omega, f, M) be any solution with f>0f > 0, position xx and yaw ψ\psi. The translation equation forces fb3=mtf b_3 = m t, and with f>0f > 0 and ∣b3∣=1|b_3| = 1 this forces f=m∣t∣f = m|t| and b3=t/∣t∣b_3 = t/|t|; in particular (C1) is necessary. The yaw condition says that b2b_2 is a unit vector orthogonal to b3b_3 and to xcx_c, so b2=±(b3×xc)/∣b3×xc∣b_2 = \pm(b_3 \times x_c)/|b_3 \times x_c|, and b1⋅xc>0b_1 \cdot x_c > 0 picks the plus sign. Then RR is fixed, Ω\Omega is fixed by Ω^=RTR˙\hat\Omega = R^T\dot R, and MM by the fourth equation. □\square

Check. A scratch script evaluated these formulas on a generic trajectory (x(t)x(t) a sum of sines and a quadratic, ψ(t)\psi(t) a sine) at five times, and compared them with central differences of RR, Ω\Omega and ff and with the translation equation. The largest difference was 5×10−105 \times 10^{-10} (measurement).

Consequences

  • Planning in the flat outputs. Any C4C^4 position path and C2C^2 yaw path that keep (C1) and (C2) can be flown in the model. Minimum snap trajectories are polynomials in these outputs, chosen so that the snap, and so the moment through Ω˙\dot\Omega, is small.
  • Feedforward for tracking. The formulas give RdR_d, Ωd\Omega_d and Ω˙d\dot\Omega_d along the plan. The geometric tracking controller on SE(3) uses them as its reference and adds feedback for the errors.
  • Feasibility checks. The thrust is m∣x¨+ge3∣m|\ddot x + g e_3|, and the body rates are bounded by ∣Ω1∣,∣Ω2∣≤m∣j∣/f|\Omega_1|, |\Omega_2| \le m|j|/f. So limits on the thrust and on the rates become limits on the acceleration and the jerk of the plan, which a planner can check before it flies.
  • Examples by hand. With a constant acceleration x¨=(g,0,0)\ddot x = (g, 0, 0) and ψ=0\psi = 0: f=2 mgf = \sqrt 2\, m g, b3=(1,0,1)/2b_3 = (1, 0, 1)/\sqrt 2 and b1=(1,0,−1)/2b_1 = (1, 0, -1)/\sqrt 2, a pitch of 45°45°, with Ω=0\Omega = 0. On the circle x=(cos⁡2t,sin⁡2t,0)x = (\cos 2t, \sin 2t, 0) m with ψ=0\psi = 0 and m=0.5m = 0.5 kg, at t=0t = 0: f=5.2971f = 5.2971 N, b3=(−0.37757,0,0.92598)b_3 = (-0.37757, 0, 0.92598) and Ω=(0.75513,0,−0.30790)\Omega = (0.75513, 0, -0.30790) rad/s. The body yaw rate is not zero even though ψ\psi is constant, because b3b_3 is tilted.

Tightness

  • (C1) cannot be dropped. If x¨=−ge3\ddot x = -g e_3 on an interval, as on a ballistic arc, then f=0f = 0, and every attitude and every moment give the same position, so the state is not a function of the outputs. At an isolated time where t=0t = 0, b3=t/∣t∣b_3 = t/|t| can jump, which needs an infinite angular velocity: a path that goes through free fall and then pushes in another direction cannot be flown smoothly in general.
  • (C2) is a chart singularity. When b3b_3 is parallel to xcx_c, the nose direction xcx_c cannot be projected onto the rotor plane, and the yaw is not defined. Another yaw chart, such as Z-Y-X angles with the condition b1⋅yc=0b_1 \cdot y_c = 0, is singular at a different place (b3b_3 parallel to ycy_c), so switching charts covers both cases, at the cost of a jump in the yaw signal.
  • Smoothness. If xx is only C3C^3, the moment MM is not defined at the points where the snap jumps. Piecewise polynomial plans must keep the position C4C^4 at the joints, or accept a jump in the moment.
  • Input limits are not part of the theorem. The formulas give the inputs a path needs, not whether the rotors can give them. Each rotor needs 0≤fi≤fmax⁡0 \le f_i \le f_{\max}, which must be checked after the mixer.
  • Model limits. The theorem is about the rigid body model. With rotor drag that grows with the speed, the position and the yaw are still flat outputs under extra conditions, but the formulas change.

History

Fliess, Lévine, Martin and Rouchon introduced differentially flat systems in the 1990s; see differential flatness. Mellinger and Kumar used the position and the yaw as flat outputs of a quadrotor in 2011, built minimum snap polynomial trajectories in these outputs, and flew them with a nonlinear controller on SO(3). Since then, flatness has been the standard way to plan quadrotor trajectories. Later work extended it to rotor drag and to quadrotors that carry a load on a cable.

References

  1. Daniel Mellinger and Vijay Kumar, Minimum snap trajectory generation and control for quadrotors, Proceedings of the 2011 IEEE International Conference on Robotics and Automation, the section on differential flatness (the flat outputs position and yaw, the body axes from the acceleration and the yaw, and the body rates from the jerk)
  2. Robert Mahony, Vijay Kumar and Peter Corke, Multirotor aerial vehicles, modeling, estimation, and control of quadrotor, IEEE Robotics and Automation Magazine 19(3), pp. 20-32 (the model, and trajectory planning with the flat outputs)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW0 stub
  • the lead paragraph