Professional Documents
Culture Documents
1 s2.0 S2405896320321984 Main
1 s2.0 S2405896320321984 Main
com
ScienceDirect
Trajectory Tracking
IFAC PapersOnLine for5731–5736
53-2 (2020) a Multicopter under
Trajectory Tracking for a Multicopter under
Trajectory Tracking for
a Quaternion
Trajectory Tracking for a Multicopter
Multicopter
Representation
a under
under
a Quaternion
Trajectory Tracking Representation
for a Multicopter under
a Quaternion
a Nguyen
Quaternion Representation
Representation
Huu Thien
a Nguyen
Quaternion
∗
Ngoc Thinh Nguyen
Representation
∗∗
IonelaProdan ∗∗∗
Huu Thien ∗ Ngoc Thinh
∗
Nguyen
Fernando Lobo Pereira
∗∗ Ionela Prodan ∗∗∗
∗∗
∗ ∗∗∗
Huu
Huu Thien Thien Nguyen NguyenFernando ∗ Ngoc Thinh
∗
Ngoc Thinh Lobo Nguyen
Pereira ∗∗∗∗∗ Ionela
Nguyen
∗∗
Ionela Prodan
Prodan ∗∗∗
∗∗∗
axis-angle representation to derive a feedback linearization Also, the relation between the quaternion derivative and
controller for the attitude, subsequently, they continued the multicopter angle rate is given by Carino et al. (2015):
with a feedback linearization for the position controller. 1
q̇ = q ⊗ ω, (3)
Even though the foregoing works are technically sound, we 2
believe that these contributions still lack several important in which, ω
= 0 ω ∈ R4 extends the angle rate vector
considerations. E.g., the model is linearized around the ω = [ωx ωy ωz ] ∈ R3 and the operation ⊗ is defined in
hovering condition (Chovancová et al., 2016), and hence, Carino et al. (2015); Chovancová et al. (2016). Hereinafter,
under more challenging scenarios, the control perfor- we provide explicitly the inverse formulation of (3) which
mances cannot be guaranteed. Moreover, the unit quater- will be employed in later analysis:
nion norm constraint is not strictly examined (Johnson
and Leang, 2014; Alaimo et al., 2013; Fresk and Niko- 0 q 0 q1 q2 q3 q̇0
lakopoulos, 2013), or is simply guaranteed by renormal- ωx −q1 q0 q3 −q2 q̇1
ω = 2 −q −q q , (4)
ization after each iteration (Carino et al., 2015), which y 2 3 0 q1 q̇2
probably introduces error into the system due to analytical ωz −q3 q2 −q1 q0 q̇3
drift through multiple integrations, and may eventually which can be more synthetically expressed by:
cause divergence and instability (Whitmore, 2000). ω = Q(q)q̇, (5)
Therefore, we present in this paper, several contributions with q = [q1 q2 q3 ] as in (1). Note that (5) is obtained
which can compensate for the drawbacks and provide by introducing the following relation to (4):
significant advantages w.r.t. the aforementioned works:
• a complete flatness-based representation of the non- q0 = 1 − (q12 + q22 + q32 ), (6)
linear multicopter dynamics using the attitude quater- which follows from the unit norm (1).
nion;
• a feedback linearization control law constructed based 2.2 Multicopter dynamics with the quaternion formulation
on the foregoing flatness property, able to linearize
the multicopter translational dynamics without any The translational dynamics of the multicopter system
simplifications; are obtained by using Newton’s second law of motion
• a computed-torque attitude controller that fully ex- (Formentin and Lovera, 2011; Nguyen et al., 2017):
ploits the attitude quaternion and guarantees their
unit norm property. mξ̈ = mg + Rez T, (7)
The remainder of the paper is organized as follows. Section with ξ [x y z] ∈ R , the position, g = [0 0 −g] , the
3
2 presents the mathematical model of a standard multi- gravity pointing downward, m, the system mass, R the
copter system using the attitude quaternion and its differ- rotation matrix from (2), ez [0 0 1] the unit vector of
ential flatness property. Section 3 details the hierarchical the z-axis, and T ∈ R+ the input thrust.
control design for trajectory tracking. Next, the simulation Next, the rotational dynamics of the multicopter are
and experimental results are given and discussed in Section considered as those of a 3-dimensional rigid body and
4. Finally, Section 5 provides conclusions and considers hence, are given by Carino et al. (2015); Nguyen et al.
future works. (2017):
J ω̇ + ω × (Jω) = τ (8)
with J = diag{Jx , Jy , Jz } ∈ R3×3 the inertia tensor, ω the
2. MULTICOPTER MODEL
angle rate as in (3), and τ [τx τy τz ] ∈ R3 gathering
the input torques.
In this section, we recapitulate the multicopter dynamics It will be more convenient to consider the matrix forms of
expressed by using the attitude quaternion as given in the dynamics (7)–(8), which are explicitly given as follows:
Carino et al. (2015); Chovancová et al. (2016). Next, the
differential flatness properties of the system are derived ẍ 0 T
2(q0 q2 + q1 q3 )
from its mathematical model. ÿ = 0 + 2(q2 q3 − q0 q1 ) , (9)
z̈ −g m q2 − q2 − q2 + q2
0 1 2 3
−1
2.1 Rotation kinematics with quaternion ω̇x (Jy − Jz )Jx−1 ωy ωz J x τx
ω̇y = (Jz − Jx )Jy−1 ωz ωx + Jy−1 τy . (10)
ω̇z −1 −1
The attitude of the multicopter system is described by (Jx − Jy )Jz ωx ωy J z τz
using a unit quaternion q q0 q ∈ R4 in which, Remark 1. By comparing the quaternion-based rotation
q0 ≥ 0 and q [q1 q2 q3 ] ∈ R , all satisfy:
3 matrix (2) with the one resulted from the Euler angles ap-
proach detailed in Formentin and Lovera (2011); Nguyen
q02 + q12 + q22 + q32 = 1. (1) et al. (2017), the relations between quaternion and Euler
The orientation of the body frame attached to the vehicle angles are as follows:
w.r.t. the global frame fixed to the ground is given through 2(q0 q1 + q2 q3 )
the following rotation matrix (Chovancová et al., 2016): arctan
φ 1 − 2(q12 + q22 )
1 − 2(q22 + q32 ) 2(q1 q2 − q0 q3 ) 2(q0 q2 + q1 q3 ) θ = arcsin[2(q0 q2 − q1 q3 )]
, (11)
R = 2(q1 q2 + q0 q3 ) 1 − 2(q12 + q32 ) 2(q2 q3 − q0 q1 ). (2) ψ 2(q 0 q 3 + q 1 q 2 )
arctan
2(q1 q3 − q0 q2 ) 2(q0 q1 + q2 q3 ) 1 − 2(q12 + q22 ) 1 − 2(q22 + q32 )
Huu Thien Nguyen et al. / IFAC PapersOnLine 53-2 (2020) 5731–5736 5733
being (φ, θ, ψ), the roll, pitch and yaw angles, respectively. et al., 2015; Nguyen et al., 2017). The position controller
Similar results can also be found in Diebel (2006). at the high control level compares the reference position
ξr with the actual position ξ received as feedback from
2.3 Flatness-based representation the system, in order to calculate the thrust T and the
reference quaternion qr = q0r qr = [q0r q1r q2r q3r ] .
Differential flatness definition: Consider the nonlinear Then, the last three components of the latter term, qr =
system in general form: [q1r q2r q3r ] , are sent to the attitude controller at the low
ẋ(t) = f (x(t), u(t)), (12) control level to track. Note that, the low control level is
with the state x(t) ∈ R and input vectors u(t) ∈ Rm .
n required to run at a higher frequency than the high-level
The system (12) is differentially flat if there exists a flat to establish the closed-loop stability for the whole scheme
output z(t) ∈ Rm (Fliess et al., 1995): (Nascimento and Saska, 2019).
z(t) = Υ(x(t), u(t), u̇(t), · · · , u(s) (t)) (13) 3.1 Feedback linearization position controller
such that the states and inputs can be algebraically
expressed in terms of z(t) and a finite number of its higher-
order derivatives 1 :
x(t) = Υx (z(t), ż(t), · · · , z(r) (t)), (14a)
Position controller
u(t) = Υu (z(t), ż(t), · · · , z(r+1) (t)). (14b)
Attitude controller
Flatness properties of the multicopter: Multicopter dynamics
The multicopter system (5)–(10) is differentially flat with
the flat output z ∈ R4 defined as follows: Fig. 1. Hierarchical control scheme of the multicopter.
(15)
z [x y z q3 ] ,
For the position controller at the high-level, we employ
with (x, y, z) the 3D position from (9) and q3 the fourth the flat representations (16)–(17) to design the feedback
element of the quaternion q from (1). linearization controller as follows:
Hereinafter, we will show the flatness-based representation
qir = Γqi (ξ̈ ∗ , q3r ), (19a)
of the multicopter’s states and inputs. First, from (9),
the first three elements of the quaternion q as in (1) are T = ΓT (ξ̈ ∗ ), (19b)
expressed as follows: with i ∈ {0, 1, 2}, q3r the reference of q3 defined by the
q0 = Γq0 (ẍ, ÿ, z̈, q3 , g), (16a) users and the corrective term ξ̈ ∗ [ẍ∗ ÿ ∗ z̈ ∗ ] given by:
q1 = Γq1 (ẍ, ÿ, z̈, q3 , g), (16b) ∗
˙
ξ̈ = ξ̈r + Kpξ ξ + Kdξ ξ + Kiξ ξ dt, (20)
q2 = Γq2 (ẍ, ÿ, z̈, q3 , g), (16c)
and the thrust T is obtained as: with ξ = ξr − ξ and Kpξ , Kdξ , Kiξ are diagonal positive
T = m ẍ2 + ÿ 2 + (z̈ + g)2 , (17) definite matrices from R3 .
with [x y z q3 ] the flat output chosen as in (15) and g Proposition 2. By applying the controller (19a)–(19b) to
the gravity. The explicit expressions for (16)–(17) are (9), it follows that the closed loop linear system (21) is
derived in the Appendix A. For further use, we shorten the stable.
descriptions (16)–(17) to qi = Γqi (ξ̈, q3 ) with i ∈ {0, 1, 2} ¨ξ + Kpξ ξ + Kdξ ˙ ξ + Kiξ ξ dt = 0. (21)
and T = ΓT (ξ̈).
Next, by introducing (5) into (8), we obtain the input Proof. From (19), with z̈ ∗ ≥ −g, we obtain the following
torque τ as follows: relations:
τ = J [Q(q)q̈ + Dq [Q(q)q̇]q̇] + [Q(q)q̇] × [JQ(q)q̇], (18) 2(q0r q2r + q1r q3r )T /m = ẍ∗ , (22a)
with Dq (·) the Jacobian w.r.t. q. (18) can be easily inter- 2(q2r q3r − q0r q1r )T /m = ÿ ∗ , (22b)
preted in the flat output space by introducing (16b)–(16c).
(q02r − q12r − q22r + q32r )T /m − g = z̈ ∗ , (22c)
The flatness representations of the multicopter system as q02r + q12r + q22r + q32r = 1. (22d)
in (16)–(18) can be used for various applications such
as constrained trajectory generation and control designs From (22a)–(22c), the control law (19) drives the transla-
(Nguyen et al., 2018). In the next section, we will exploit tional dynamics (9) to:
them to design feedback linearization control laws.
(23)
[ẍ ÿ z̈] = [ẍ∗ ÿ ∗ z̈ ∗ ] ,
3. TRACKING CONTROL DESIGN FOR THE or,
MULTICOPTER ẋ = Ax x + Bx ξ̈ ∗ , (24)
with x ξ ξ̇ [x y z ẋ ẏ ż] being the transla-
This section addresses the tracking control design for the
multicopter system (9)–(10). We make use of the standard tional position and velocity, ξ̈ ∗ [ẍ∗ ÿ ∗ z̈ ∗ ] denoting
hierarchical two-layer control scheme illustrated in Fig. virtual control inputs designed as in (20). The two matrices
1 which is usually employed in the literature (Carino Ax ∈ R6×6 and Bx ∈ R6×3 are defined as:
1 Any system admitting a flat description has the number of flat 03×3 I3×3 03×3
Ax = , Bx = . (25)
outputs z(t) equal to the number of inputs u(t) (Fliess et al., 1995). 03×3 03×3 I3×3
5734 Huu Thien Nguyen et al. / IFAC PapersOnLine 53-2 (2020) 5731–5736
Remark 1. In Carino et al. (2015), the authors introduce in Nguyen et al. (2017).
different feedback linearization designs for the position The parameters of the quadcopter used for simulation are
controller in more compact forms. However, their con- chosen as:
trollers implicitly constrain the fourth element of the
reference quaternion, q3r as in (19), to be zero, which - m = 0.025 [kg], Jx = Jy = 4.856 × 10−3 [kgm2 ],
does not hold for applications requiring yawing such as Jz = 8.801 × 10−3 [kgm2 ], CD = 0.8, ρ = 1.225
aerial photography and filming. Therefore, the flatness- [kg/m3 ], A = 0.01425 [m2 ].
based feedback linearization controller proposed in (19),
which takes into account a general value of q3r , provides 4.2 Simulation results
more flexibility for the users.
We first generate a reference trajectory starting from the
3.2 Computed-torque attitude controller initial position [1.8 2.27 0.6] at t = 0s, which hovers at
(28)
q0r = 1 − (q12r + q22r + q32r ), 0.999
0 −2 2 4 6 8 10 12 14 16 18 20
2 ·10
in which, [q1 q2 q3 ] converges to [q1r q2r q3r ] , and hence,
1
the attitude tracking capability is always guaranteed.
q1
0
Furthermore, it is important to choose the gains of both −1 simulation reference
−2
attitude and position controllers such that q as in (27) 0 −2 2 4 6 8 10 12 14 16 18 20
2 ·10
converges to 0 faster than ξ from (21) in order to ensure 1
good tracking capability (Nguyen et al., 2017).
q2
0
−1 simulation reference
4. SIMULATION AND EXPERIMENTAL RESULTS −2
0 −5 2 4 6 8 10 12 14 16 18 20
1 ·10
This section provides first the simulation results of the 0.5
q3
0
feedback linearization controllers proposed in Section 3. −0.5 simulation reference
Subsequently, the high-level position controller (19) is −1
0 2 4 6 8 10 12 14 16 18 20
further illustrated through real experiments over a nano- Time [s]
drone platform.
Fig. 2. Quaternion tracking results under simulation.
4.1 Simulation model At first, we provide the quaternion tracking results of the
attitude controller (26)–(27) in Fig. 2. We observe that
For the simulation model to be realistic, we add the drag
besides some chattering behavior in q3 around t = 1s due
force (Fox and McDonald, 1994) to dynamics (7):
to the instability inherent in the numerical differentiation,
mξ̈ = mg + Rez T + FD , (29) the three components q1 , q2 , q3 generally track well their
in which, the drag FD is calculated by: references. Thus, even though q0 is not explicitly controlled
1 by the CTC controller (26)–(27), it still follows the refer-
FD = − ρCD A|ξ̇|ξ̇, (30) ence q0r as shown in the first plot of Fig. 2.
2
with CD the drag coefficient, ρ the fluid density, ξ̇ the Next, the position references (plotted in red dashed lines)
velocity and A the cross-section of the multicopter as used and their tracking results under simulation (plotted in blue
Huu Thien Nguyen et al. / IFAC PapersOnLine 53-2 (2020) 5731–5736 5735
x [m]
robustness, albeit the drag in (30) is not taken into account 2
during the controller design procedure. In the next section, 1 simulation experiment reference
we will apply this position controller for controlling a real 0
quadcopter platform under the same tracking scenario. 0 2 4 6 8 10 12 14 16 18 20
4
4.3 Experimental results 3
y [m]
2
The experimental video could be viewed online at: 1 simulation experiment reference
https://youtu.be/NIdCI6FJXHM. The experiment is done 0
indoor, with no wind disturbance. 0 2 4 6 8 10 12 14 16 18 20
1.5
The experimental platform includes a quadcopter Crazyflie 1
z [m]
(CF) and a Loco Positioning System (LPS) (Bitcraze,
2019; Nguyen et al., 2018), which comprises of 6 fixed, 0.5 simulation experiment reference
known position anchors in the room and a tag attached to 0
the Crazyflie. The platform provides feedback on the quad- 0 2 4 6 8 10 12 14 16 18 20
copter position, by continuously measuring the distances Time [s]
between the tag and the anchors. The data transmission Fig. 3. Position with disturbances.
between the ground station PC and the Crazyflie is accom-
plished by 2.4GHz low-latency/long-range radio messages 0.4 reference experiment
between the tag and the Crazyradio PA radio USB dongle 0.2
connected to the PC. q1 0
−0.2
By decoupling the translational and rotational dynamics −0.4
of the Crazyflie with the proposed hierarchical control 0 2 4 6 8 10 12 14 16 18 20
approach, the autonomous trajectory tracking task could 0.4 reference experiment
be accomplished by utilizing the high-level controller on 0.2
q2
the PC. The CF has its built-in controller which can only 0
track the references of the thrust and the roll, pitch, yaw −0.2
light push heavy pushes
angles. Hence, the reference quaternion from the position −0.4
0 2 4 6 8 10 12 14 16 18 20
controller (19) needs to be transformed into these Euler 0.1 reference experiment
angles by using relation (11) before being sent to the CF. 0.05
0
q3
new flat output which may result in a less convoluted flat Nguyen, N.T., Prodan, I., and Lefèvre, L. (2018). Flat
representation, analyzing the robustness of the controlled trajectory design and tracking with saturation guaran-
system under saturation inputs and disturbances, as well tees: a nano-drone application. International Journal of
as testing with more aggressive trajectories. Control, 1–14, Article in Press.
Nguyen, N.T., Prodan, I., Stoican, F., and Lefevre, L.
REFERENCES (2017). Reliable nonlinear control for quadcopter tra-
jectory tracking through differential flatness. IFAC-
Alaimo, A., Artale, V., Milazzo, C., Ricciardello, A., and PapersOnLine, 50(1), 6971–6976.
Trefiletti, L. (2013). Mathematical modeling and control Tzafestas, S.G. (2013). Introduction to mobile robot con-
of a hexacopter. In 2013 International Conference trol. Elsevier.
on Unmanned Aircraft Systems (ICUAS), 1043–1050. Whitmore, S.A. (2000). Closed-form integrator for the
IEEE. quaternion (euler angle) kinematics equations. US
Bitcraze (2019). Crazyflie 2.0. Patent 6,061,611.
https://www.bitcraze.io/crazyflie-2/. [Online; Yang, Y. (2012). Spacecraft attitude determination and
accessed July 19, 2019]. control: Quaternion based method. Annual Reviews in
Carino, J., Abaunza, H., and Castillo, P. (2015). Quadro- Control, 36(2), 198–219.
tor quaternion control. In 2015 International Confer-
ence on Unmanned Aircraft Systems (ICUAS), 825–831. Appendix A. PROOF FOR THE FLAT
IEEE. REPRESENTATIONS OF THE QUADCOPTER
Chovancová, A., Fico, T., Hubinskỳ, P., and Duchoň, F. DYNAMICS
(2016). Comparison of various quaternion-based control
methods applied to quadrotor with disturbance observer Gathering the translational dynamics (9) and the norm
and position estimator. Robotics and Autonomous constraint (1), we have the system of equations:
Systems, 79, 87–98. mẍ/T = 2(q0 q2 + q1 q3 ), (A.1a)
Diebel, J. (2006). Representing attitude: Euler angles, unit
mÿ/T = 2(q2 q3 − q0 q1 ), (A.1b)
quaternions, and rotation vectors. Matrix, 58(15-16),
1–35. m(z̈ + g)/T = q02 − q12 − q22 + q32 , (A.1c)
Fliess, M., Lévine, J., Martin, P., and Rouchon, P. (1995). 2 2 2 2
1 = q0 + q 1 + q 2 + q 3 . (A.1d)
Flatness and defect of non-linear systems: introductory Squaring both sides of (A.1a)–(A.1c), then taking their
theory and examples. International journal of control, sum leads to:
61(6), 1327–1361. 2 2
Floreano, D. and Wood, R.J. (2015). Science, technology q0 + q12 + q22 + q32 = ẍ2 + ÿ 2 + (z̈ + g)2 m2 /T 2 .
and the future of small autonomous drones. Nature, (A.2)
521(7553), 460–466. Replacing (A.1d) to the left hand side of (A.2), and taking
Formentin, S. and Lovera, M. (2011). Flatness-based con- the square root of both sides, the thrust can be calculated
trol of a quadrotor helicopter via feedforward lineariza- as follows:
tion. In Proceedings of the 50th IEEE Conference on T = m ẍ2 + ÿ 2 + (z̈ + g)2 . (A.3)
Decision and Control and European Control Conference Taking the sum of both sides of (A.1c) and (A.1d), we
(CDC-ECC), 6171–6176. have:
Fox, R.W. and McDonald, A.T. (1994). Introduction to q02 + q32 = [1 + (z̈ + g)m/T ] /2. (A.4)
fluid mechanics. John Wiley. Replacing (A.3) to (A.4), we arrive to 2 :
Fresk, E. and Nikolakopoulos, G. (2013). Full quaternion 1 z̈ + g
based attitude control for a quadrotor. In 2013 European q0 = √ − 2q32 + 1. (A.5)
Control Conference (ECC), 3864–3869. IEEE. 2 ẍ2 + ÿ 2 + (z̈ + g)2
Herceg, M., Kvasnica, M., Jones, C., and Morari, M. Rewriting (A.1a) and (A.1b) in the matrix form leads to:
(2013). Multi-Parametric Toolbox 3.0. In Proc. of the
m ẍ
q3 q0 q1
European Control Conference, 502–510. Zürich, Switzer- = . (A.6)
−q0 q3 q2 2T ÿ
land. http://control.ee.ethz.ch/ mpt.
Johnson, N.L. and Leang, K.K. (2014). Enhanced Next, we have that:
proportional-derivative control of a micro quadcopter. q1 m 1 q3 −q0 ẍ
In ASME 2013 Dynamic Systems and Control Confer- = × 2 . (A.7)
q2 2T q0 + q32 q0 q3 ÿ
ence. American Society of Mechanical Engineers Digital Replacing (A.3) and (A.5) to (A.7) leads to:
Collection.
Löfberg, J. (2004). Yalmip : A toolbox for model- ẍq3 − √12 ÿ 2 z̈+g − 2q32 + 1
ing and optimization in MATLAB. In Proceedings
2 2
ẍ +ÿ +(z̈+g)
q1 = , (A.8a)
of the CACSD Conference. Taipei, Taiwan. URL (z̈ + g) + ẍ2 + ÿ 2 + (z̈ + g)2
http://users.isy.liu.se/johanl/yalmip.
Mellinger, D. and Kumar, V. (2011). Minimum snap ÿq3 + √12 ẍ 2 z̈+g − 2q32 + 1
trajectory generation and control for quadrotors. In
2 2
ẍ +ÿ +(z̈+g)
q2 = . (A.8b)
Proceedings of the 2011 IEEE International Conference (z̈ + g) + ẍ2 + ÿ 2 + (z̈ + g)2
on Robotics and Automation (ICRA), 2520–2525.
Nascimento, T.P. and Saska, M. (2019). Position and Thus, completing the proof.
attitude control of multi-rotor aerial vehicles: A survey. 2 We only consider z̈ ≥ −g, which is always true for nominal
Annual Reviews in Control. operation.