Professional Documents
Culture Documents
Nonlinear_model_and_control_of_a_quadcopter
Nonlinear_model_and_control_of_a_quadcopter
Abstract—This paper presents the derivation, in great detail, system of N rigid bodies with n degrees of freedom is
of the full nonlinear model for a quad-copter, using D’Alembert’s
principle. The final model is presented in a form suitable
for simulation and control. Finally, the quad-copter model is δW =
n N N
!
implemented and a simple control law for the attitude and T ∂~v T ∂~ωi
X X ˙ i
X
~˙ i
altitude are derived. Numerical results are presented at the end = F~i − P~i + T~i − L δqj
of the paper. j=1 i=1
∂ q̇j i=1
∂ q̇j
Keywords—quad-copter modeling, D’Alembert’s principle,
nonlinear control ≡0 (1)
Authorized licensed use limited to: Lebanese American University. Downloaded on June 02,2024 at 22:33:41 UTC from IEEE Xplore. Restrictions apply.
where q = [x, y, z, θ, χ, φ]T . The inertia matrix of the quad-
copter while moving is I(t) = RT (t)I0 R(t) where RT =
T T T
Rkθ Riχ Rjφ and I0 is the inertia matrix in body frame.
For simplicity we modeled the quad-copter as five mass
points, one for each motor of mass m and one in the center
hub of mass mh , hence
2
2r 0 0 Ixx0 0 0
I0 = m · 0 2r2 0 = 0 Iyy0 0 (7)
0 0 4r2 0 0 Izz0
688
Authorized licensed use limited to: Lebanese American University. Downloaded on June 02,2024 at 22:33:41 UTC from IEEE Xplore. Restrictions apply.
The total torque due to the force developed by the propellers D. The equations of motion
is We use the theory briefly explained in the above section to
obtain the equations of motion for the vehicle.
r1 0 0 0
T~2 = RT 0 × 0 + r2 × 0 + ∂~v T ~ ˙ ∂~ωT ~
(F (t) − P~ (t)) + ~˙
(T (t) − L(t)) = 0;
0 a1 ω 2 0 a2 ω 2 ∂ q̇i ∂ q̇i
1 2
−r3 0 0 0 ∀qi ∈ {x, y, z, θ, χ, φ} (16)
+ RT 0 × 0 + −r4 × 0 =
0 a3 ω32 0 a4 ω42 One can see that ∂∂~ v
q̇i = [0, 0, 0]
T
for qi ∈ {θ, χ, φ} and
∂~ω T
a2 r2 w22 − a4 r4 w42
similarly ∂ q̇i = [0, 0, 0] for qi ∈ {x, y, z} hence we organize
T
= R a3 r3 w32 − a1 r1 w12 (12) these six equations in the following form:
0
ẋ2
689
Authorized licensed use limited to: Lebanese American University. Downloaded on June 02,2024 at 22:33:41 UTC from IEEE Xplore. Restrictions apply.
where columns of Bc (q), then
Fz Fz
1) b11
2 = −Iyy0 sin(χ)2 − Izz0 cos(χ)2 cos(φ)2 − Tx Tx Tx
Ixx0 cos(χ)2 sin(φ)2 Ac (q) ·
= A1c (q)Fz Bc (q) = Bc2,3,4 Ty
Ty Ty
2) b12
2 = cos(χ) cos(φ) sin(φ)(Ixx0 − Izz0 ) Tz
Tz Tz
3) b13
2 = −Iyy0 sin(χ) (21)
4) b21
2 = cos(χ) cos(φ) sin(φ)(Ixx0 − Izz0 )
5) b22 2 2
2 = Izz0 cos(φ) − Ixx0 cos(φ) − Izz0
Remark II.4. In general the equations of motion result in the
23
6) b2 = 0 following form
7) b31
2 = −Iyy0 sin(χ)
M (q, q̇, q̈) = 0
8) b32
2 =0 This form, however, is difficult to use for simulation and con-
9) b33
2 = −Iyy0 trol, hence we propose the form of the Equations (17) and (18)
which explicitly show the derivatives of the parameters vector
hence B2 (q) is symmetric. For B11 (q) we have q. This way of writing the equations eases the simulation, the
liniarization and finally the control.
1) b11
11 = 0
1 III. T HE CONTROL OF THE QUAD - COPTER
2) b12
11 = 2 sin(2χ)(Ixx0 − 2Iyy0 + Izz0 − Ixx0 cos(2φ) +
Izz0 cos(2φ)) The machine has six degrees of freedom x, y, z, θ, χ, φ and
3) b13 2
11 = 2(Izz0 − Ixx0 ) cos(χ) cos(φ) sin(φ) four inputs Fz , Tx , Ty , Tz uniquely determined by ωi with i ∈
14
4) b11 = (Izz0 − Ixx0 ) cos(φ) sin(χ) sin(φ) {1, 2, 3, 4}. One can use Tx , Ty , Tz to control θ, χ, φ and then
5) b15
11 = − cos(χ)(Iyy0 + (Izz0 − Ixx0 ) cos(2φ)) Fz to control z. In order to further control x and y a cascade
6) b16
11 = 0 control is required.
1
7) b21
11 = − 4 sin(2χ)(Ixx0 − 2Iyy0 + Izz0 − Ixx0 cos(2φ) +
Izz0 cos(2φ)) A. Attitude control. Control of θ, χ, φ
8) b22
11 = 0
Form equation (18) and remark (II.3) one has
9) b23
11 = cos(χ)(Iyy0 − (Izz0 − Ixx0 ) cos(2φ))
2
θ̇
10) b24
11 = 0 θ̇χ̇
11) b25
11 = sin(2φ)(Ixx0 − Izz0 ) θ̈ Tx 0
θ̇φ̇
12) b26
11 = 0 B2 (q) χ̈ + B11 (q) + Bc2,3,4 (q) Ty = 0 (22)
χ̇2
13) b31 2
11 = −(Izz0 − Ixx0 ) cos(χ) cos(φ) sin(φ) φ̈
χ̇φ̇ Tz 0
32
14) b11 = − cos(χ)(Iyy0 − (Izz0 − Ixx0 ) cos(2φ))
15) b33 φ̇2
11 = 0
1
16) b34
11 = − 2 sin(2φ)(Ixx0 − Izz0 )
Tx Tx1 Tx2
35
17) b11 = 0 Let Ty = Ty1 + Ty2 such that
18) b36
11 = 0 Tz Tz1 Tz2
2
For Bc (q) we have θ̇
θ̇χ̇
Tx1 0
1) b11
c =0 θ̇φ̇
B11 (q) + Bc2,3,4 (q) Ty1 = 0 ⇒
2) b12 = − cos(χ) sin(φ) χ̇2
c Tz1 0
3) b13
c = sin(χ) χ̇φ̇
4) b14
c = cos(χ) cos(φ) φ̇2
5) b21
c =0 2
θ̇
6) b22
c = cos(φ) θ̇χ̇
b23
7) c =0 Tx1
θ̇φ̇
−1
8) b24
c = sin(φ) 2,3,4
⇒ Ty1 = −(Bc (q)) B11 (q) χ̇2
(23)
9) b31
c =0 Tz1
χ̇φ̇
10) b32
c =0
11) b33 =1 φ̇2
c
12) b34
c =0 because for cos(χ) 6= 0 the inverse of matrix Bc2,3,4 (q) exists.
We are left with
We close this section with the following remarks about Ac
and Bc
θ̈ Tx2 0
2,3,4
Remark II.3. Let A1c denote the first column of matrix B2 (q) χ̈ + Bc (q) Ty2 = 0 (24)
Ac (q) and Bc2,3,4 denote the matrix formed with the last three φ̈ Tz2 0
690
Authorized licensed use limited to: Lebanese American University. Downloaded on June 02,2024 at 22:33:41 UTC from IEEE Xplore. Restrictions apply.
The above equation is linearized (according to Taylor expan-
sion about the origin, by simply letting θ = 0, χ = 0, φ = 0 in
ż 0 1 z 0 z
all of the coefficient matrices, except B0 (q), which happens = + az = Az + Bz az (30)
z̈ 0 0 ż 1 ż
to be O3×3 here) to obtain
the output is z = [1, 0]qz hence this is a single input
θ̈ Tx2 0
2,3,4 single output system with an integrator so we use the control
B2l χ̈ + Bcl Ty2 = 0 (25)
technique presented in [9] page 739 about type one servo
φ̈ Tz2 0
systems.
where The state feedback matrix is Kz and is found such that
−Izz0 0 0
0 0 1
Az − Bz Kz has the eigenvalues {−2, −3} using acker
B2l = 0 −Ixx0 0 2,3,4
Bcl = 1 0 0 function from M AT LAB R . This control will output az =
0 0 −Iyy0 0 1 0 z ∗ · Kz (1) − Kz qz . From here Fz2 = az cos(φ)Mcos(χ) . Here
(26) is the same discussion, as above, for controllability and the
choice of the closed loop poles.
Let qb = [θ, χ, φ, θ̇, χ̇, φ̇]T then
IV. N UMERICAL RESULTS
Tx2
O3×3 I3×3 O3×3
q̇b = q + Ty2 = The above derived quad-copter model was implemented
O3×3 O3×3 b −1 2,3,4
−B2l Bcl in Simulink M AT LAB R with the following parame-
Tz2
Tx2 ters values: m = 0.5, mh = 1, r = 0.3, a =
Abp qb + Bbp Ty2 (27) 3 · 10−6 and b = 1.14 · 10−7 . We obtained from (17)
0 0 5.55
Tz2 −1 2,3,4
−B2l Bcl = 11.11 0 0 and from here the
Let W be a matrix whose columns are the left eigenvectors 0 11.11 0
T matrices Abp and Bbp . The proposed control was imple-
of Abp . Because Bbp · W does not have any null column,
follows that the linear system is controllable. mented. Because Kb is a relatively large matrix to be re-
In the following we
shall
provide a simple
∗ linear stabiliza- produced here, we give the M AT LAB R command for it:
θ θ Kb = place(Abp , Bbp , [−2, −3, −4, −5, −6, −7]). The
alge-
tion law. Let Q2 = χ and let Q∗2 = χ∗ be the desired −0.01 2.14 −0.09
∗ braic prefilter matrix Fb = 0.41 −0.1 1.2 As for
φ φ
Tx2 3.2 −0.0 0.99
values for Q2 . In this conditions let Ty2 = Fb Q∗2 − Kb qb the control of the altitude i.e z we obtained Kz = 2 3
Tz2 As can be seen in Figure 2, the vehicle follows step
where Fb ∈ R3×3 is an algebraic filter matrix to be found references for θ, χ, φ, z with zero stationary error.
such that the stationary error to vanish for step inputs. The
eigenvalues of Abp are {0, 0, 0, 0, 0, 0} and we find Kb such
that the eigenvalues of Ab0 = Abp − Bbp Kb to be for instance
{−2, −3, −4, −5, −6, −7}. One might want an explanation
here for the choice of the closed loop poles, but because this
paper focuses mainly on modeling the device and not on its
control, the eigenvalues of the closed loop here were chosen
didactically. However, because as stated above, the system is
controllable, one can choose whatever closed loop poles he/she
wants. Hence we have q̇b = Ab0 qb +Bbp Fb Q∗2 and Q2 = Cb ·qb
where Cb = [I3×3 , O3×3 ] therefore Fb = −(Cb A−1 b0 Bbp )
−1
691
Authorized licensed use limited to: Lebanese American University. Downloaded on June 02,2024 at 22:33:41 UTC from IEEE Xplore. Restrictions apply.
In Figure 3 one can see the velocities and position of the [4] P. Castillo, R. Lozano, and A. Dzul, Stabilization of a mini rotorcraft
uncontrolled degrees of freedom i.e x and y. As expected the with four rotors, IEEE Control System Magazine, pp. 4555, 2005.
[5] S. Bouabdalla, P. Murrieri, and R. Siegward Towards autonomous indoor
position on ~i0 of the center of mass of the quad-copter i.e micro VTOL Autonomous Robots, vol. 18, no. 2, pp. 171183, 2005.
x, describes a parabola as long as χ 6= 0. Also the velocity [6] E. Nice Design of a four rotor hovering vehicle, Masters thesis, Cornell
on ~i0 of the center of mass, i.e ẋ is a linear function with a University, 2004.
[7] N. Guenard, T. Hamel, and V. Moreau, Dynamic modeling and intuitive
strictly positive or negative slope according to the angle χ 6= 0. control strategy for an X4-flyer in Proceedings of the IEEE International
However, when χ vanishes at t ≈ 8, the slope vanishes too, Conference on Control and Application, 2005
therefore the velocity ẋ remains constant, hence the position [8] S. Bouabdalla and R. Siegward, Backstepping and sliding-mode tech-
niques applied to an indoor micro quadrotor in Proceedings of the
x describes a line now. This is an expected scenario, because IEEE International Conference on Robotics and Automation, 2005, pp.
there were no aerodynamic drag forces modeled. The same 22592264.
phenomenon can be observed for the position on ~j0 axis, i.e [9] K. Ogata Modern Control Engineering, Fifth Edition Prentice Hall, 2010
[10] F. Goodarzi, D. Lee, and T. Lee Geometric Nonlinear PID Control of a
y. Quadrotor UAV on SE(3) in Proceedings of the IEEE European Control
Conference (ECC), 2013
[11] T. Lee, M. Leok, and N. H. McClamroch Nonlinear Robust Tracking
Control of a Quadrotor in Asian Journal of Control, Vol. 15, No. 3, pp.
118, May 2013
[12] Teppo Luukkonen Modelling and control of quadcopter School of
Science, Mat-2.4108, Espoo, August 22, 2011
692
Authorized licensed use limited to: Lebanese American University. Downloaded on June 02,2024 at 22:33:41 UTC from IEEE Xplore. Restrictions apply.