Beruflich Dokumente
Kultur Dokumente
Abstract—This project implements adaptive control laws in Before we start diving into the control theory, we need
order to control a Parrot Rolling Spider mini drone. We will go the equations of motions from which we will derive our
through two steps: Step 1 - Linear Adaptive Control, Step 2 - state-space equations. For any drone we normally need nine
Nonlinear Controller. We simulate the performance of our model
reference adaptive controller (MRAC) and our fixed-gain linear equations of motion. These define the dynamics of: the linear
controller, and show that the former outperforms the latter in acceleration (ẍ, ÿ, z̈) with respect to the world frame, angular
stabilization and tracking tasks. velocities (ṗ, q̇, ṙ) with respect to the drone’s body frame, and,
Index Terms—Model Reference Adaptive Controller, Lin- lastly, the Euler rates (φ̇, θ̇, ψ̇).
earization, Quadcopter, Parrot Rolling Spider, Nonlinear Con-
troller.
T
I. I NTRODUCTION ẍ = − [cos(φ) sin(θ) cos(ψ) + sin(φ) sin(ψ)]
m
When one tries to control a physical plant/system, an
accurate dynamics model is crucial. Traditional control laws T
are designed assuming the estimated plant parameters are ÿ = − [cos(φ) sin(θ) sin(ψ) − sin(φ) cos(ψ)]
m
ideal. This poses a potential problem, since failure to obtain
the plant model and parameters correctly would lead to a T
failure in the control tasks. But as we know, the real world z̈ = − cos(φ) cos(θ) + g
m
is unpredictable and not only could the system parameters
change over time, but also the properties of the environment. τx + Iy qr − Iz qr
Adaptive Control techniques are capable of dealing with such ṗ =
Ix
parameter uncertainty problems. By the inverse Lyapunov
functions approach, we can design feedback controllers with τy − Ix pr + Iz pr
dynamic gains that can adapt to the uncertainties, as opposed q̇ =
Iy
to the fixed gains in the traditional static controllers.
τz + Ix pq − Iy pq
We will go through several steps to design a functional ṙ =
Iz
adaptive controller for a quadcopter, specifically the Parrot
Rolling Spider, and show that this controller is better able to Let Θ = [φ, θ, ψ]| and let w = [ṗ, q̇, ṙ]| . Using the following
control the drone for stabilization and tracking tasks than the transformation we can obtain the Euler Rates from the Body
traditional controllers. rates.
θ̇ = q cos(φ) − r sin(φ)
r cos(φ) q sin(φ)
ψ̇ = +
cos(θ) cos(θ)
B. State-Space Representation III. S TEP 1: L INEAR A DAPTIVE C ONTROL
Now we have to go from the equations of motion to the A. Linearization
state-space representation. The latter will define the states of
the system, in our case the quadcopter, that are relevant to us. We will linearize the equations of motion about hover, so
These states are (xi , i = 1, ..., 12), which together make up that the linearized state and control inputs have an equilibrium
our state vector X as follows: at Xeq with the linearized control input. We will establish
the corresponding performance specifications for the system
X = [x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9 , x10 , x11 , x12 ]| and design a linear feedback controller that will stabilize the
Components xi , i = 1, ..., 12 forming the state vector X system and meet established specifications.
correspond to the following (in the same order).
We had previously defined the state dynamics as Ẋ, where
X = [x, y, z, φ, θ, ψ, ẋ, ẏ, ż, p, q, r]| Ẋ = f (X, U ) and f ∈ R12 . At hover f must meet
Then, the dynamics of the state vector X, also known as f (Xeq , Ueq ) = 0. The equilibrium point at the hover, and the
state dynamic, are given by the vector Ẋ = [x˙1 , x˙2 , ..., x˙12 ]| , corresponding input to achieve it correspond to:
whose components are defined as follows:
Xeq = [xeq , yeq , zeq , 0, 0, ψeq , 0, 0, 0, 0, 0, 0]|
[x˙1 , x˙2 , x˙3 ]| = [x7 , x8 , x9 ]| (1)
Ueq = [weq 2 , weq 2 , weq 2 , weq 2 ]|
x˙4 = x10 + sin(x4 ) tan(x5 )x11 + cos(x4 ) tan x5 x12 (2) Where Ueq corresponds to the input U (Equation 12) needed
to achieve hover.
x˙5 = cos(x4 )x11 − sin(x4 )x12 (3) U = [u1 , u2 , u3 , u4 ]| = [w12 , w22 , w32 , w42 ]| (12)
sin(x4 ) cos(x4 ) Notice that to achieve hover, the rotational speeds of all
x˙6 = x11 + x12 (4)
cos(x5 ) cos(x5 ) the propellers must be equal. Also, the thrust T must counter
the force due to gravity on the drone (T = mg). From the
T definition of thrust (Equation 11) we get:
x˙7 = − [cos(x4 ) sin(x5 ) cos(x6 ) + sin(x4 ) sin(x6 )] (5)
m
r
mg
T weq =
x˙8 = − [cos(x4 ) sin(x5 ) sin(x6 ) − sin(x4 ) cos(x6 )] (6) 4ka
m
As we know, by linearizing a nonlinear time-invariant
T
x˙9 = − cos(x4 ) cos(x5 ) + g (7) system we can only get local properties. In order to obtain
m the linear representation of the system ∆Ẋ = A∆X + B∆U
τx Iy − Iz we need to get the Jacobian matrices A and B. Here, ∆X
x˙10 = + x11 x12 (8) and ∆U are the perturbation about the equilibrium point. The
Ix Ix
actual state and input are re-defined as X = Xeq + ∆X and
τy −Ix + Iz U = Ueq + ∆U .
x˙11 = + x10 x12 (9)
Iy Iy
τz Ix − Iy ∂f
x˙12 = + x10 x11 (10) A= (X, U )|(Xeq ,Ueq )
Iz Iz ∂X
where T , τx , τy , τz are defined as: ∂f
B= (X, U )|(Xeq ,Ueq )
∂U
T = Ka (w1 2 + w2 2 + w3 2 + w4 2 ) (11) Utilizing the previous two equations and our system defini-
tion, Ẋ = f (X, U ), we found A and B to be:
τx = Ka l(w4 2 − w2 2 )
τy = Ka l(w1 2 − w3 2 )
O6x6 I6x6
2 2
τz = Km (w1 − w2 + w3 − w4 ) 2 2 A= (13)
Λ O6x6
The variables wi2 , i = 1, 2, 3, 4, are the squared angular
velocities of the propellers. They represent the four direct
O8x4
inputs to the system and are are grouped in a single input B= (14)
∆
vector U , as equation 12 shows in III-A. These and all other
variables as well as all other constants are defined in the Where Oixj and Iixj are the zero matrix and the identity
Appendix section. matrix respectably, of size ixj. Λ and ∆ are defined as follows:
Here pm stands for Parameter Mismatch, and Apm = A
0 0 0 g sin(ψeq ) g cos(ψeq ) 0
since the linearized matrix A doesn’t depend on any parameter
0 0 0 −g cos(ψeq ) g sin(ψeq ) 0 of the drone. We obtained Bpm assuming a miscalculation of
0 0 0 0 0 0
m and l by a factor of 1.5, which gives us an overestimation
Λ=
0 0 0
of 50%.
0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 Reference Model: ẋm (t) = Am xm (t) + Bm r(t)
K Ka Ka Ka
a
m m m m For the reference model we used the real linearized model
0 − KIxa l 0 Ka l
Ix
of our system, since this is how ideally the plant should
∆ = Ka l
0 − KIya l 0 behave. This means that Am = A and Bm = B. In our
Iy
Km
Iz − KIzm Km
Iz − KIzm case r(t) is the reference model control input that makes ẋm
achieve hover at the desired location (x,y,z) = (2,2,3).
B. Linear Controller design
With the linearization done, designing the linear controller
Controller:
is simple: we just need to find a gain matrix K such that the
close-loop system has all the eigenvalues in the left half plane.
Fig. 3: States [x7 , x8 , x9 ]| = [ẋ, ẏ, ż]| Fig. 5: States [x1 , x2 , x3 ]| = [x, y, z]|
Fig. 6: States [x4 , x5 , x6 ]| = [φ, θ, ψ]| Fig. 8: States [x10 , x11 , x12 ]| = [p, q, r]|
x˙09 = x¨03 we can write the entire state dynamics in the following
1
T + λ(x210 + x211 ) cos x4 cos x5
= −m matrix form:
h
−Ix +Iy −Iz τx
i (21)
+λ Ix x11 x12 + Ix sin x4 cos x5 Ẋ 0 = A00 X 0 + B 00 [U + α| Φ(X 0 )]
h i
−Ix +Iy +Iz τ
−λ Iy x10 x12 + Iyy sin x5 + g Where,
The next step is to transform g so that it can be factored
into the span of the B matrix as well. By inspection, one can B 00 [U + α| Φ]
1
find that by decomposing g into the following three terms: −m T + λ(x210 + x211 ) + c(x4 )c(x5 )g
cos x4 cos x5 g, (22)
00 λ( −Ix +Iy −Iz x x τx
=B 11 12 + Ix ) + s(x4 )c(x5 )g
Ix
sin x4 cos x5 g,
sin x5 g −I +I +I
−λ( x y z x x + y ) + s(x )g
τ
Iy 10 12 Iy 5
− Kma a − λK al Ka λKa l
Iy c, − m a − Ix b,
0 0
0 1 0 0 κ1 = − Kma d − λK al Ka λKa l
Iy f, − m d − Ix e,
0 0
0 0 1 0
0
− Kma g − λK al Ka λKa l
Iy i, − m g − Ix h,
00 0
0 0 0 1
A =0
0
0 0 0 0
0 0
0 0 0 0
− Kma a − λK al Ka λKa l
0 0
0 0 0 0 Iy c, − m a − Ix b
κ2 = − Kma d − λK al Ka λKa l
Iy f, − m d − Ix e
03x3 − Kma g − λK al Ka λKa l
Iy i, − m g − Ix h
00
B =
R
where,
R = R1 R2 R3
α| = Λ+ Υ .
Ẋ 0 = A0 X 0 + B 0 [U + α| Φ(X 0 )] x08 = x8 + λ[s(x6 )(s(x4 )s(x5 )x10 − c(x5 )x11 ) + c(x4 )c(x6 )x10 ]
Where,
A0 = A00 x09 = x9 + λ[s(x4 )c(x5 )x10 + s(x5 )x11 ]
0 03x3 Then the control input will depend on X(t) instead of X 0 (t).
B =
κ Therefore, we get the expression for u(t) with everything
expressed in the original coordinates.
κ = κ1 κ2
Fig. 9: States trans. coord. [x01 , x02 , x03 ]| = [x0 , y 0 , z 0 ]| Fig. 10: States trans. coord. [x07 , x08 , x09 ]| = [ẋ0 , ẏ 0 , ż 0 ]|
C. Results
The simulation plots for the nonlinear MIMO MRAC
controller (Fig. 9 to Fig. 12) and the fixed-gain linear
controller (Fig. 13), as well as the response of the nonlinear
system to the Linear MIMO MRAC (Fig. 14 and Fig.
15) are provided in this section for comparison. The plant
parameter mismatch is the same as before (overestimation by
50%). The plots include graphs of the states of the actual
plant xno. (t), and the corresponding states of the model
reference xmno. (t), in both the transformed coordinates and
the original coordinates. Now, the desired hover state is set
at [x, y, z] = [1, 1, 1], and λ is 0.01, which means that the
virtual point is just above the drone’s center of mass.
B. Constants
Definitions of the parameters used throughout the report
which are specific to the drone being used, the Parrot Rolling
Spider:
m = 68 grams
l = 6.24 cm
g = 9.81 sm2
Ka = 4.72x10−8 kg · m
Km = 1.1393x10−10 kg · m2
Ix = 6.86x10−5 kg · m2
Iy = 9.2x10−5 kg · m2
Iz = 1.366x10−4 kg · m2
VI. REFERENCE
Lyu, Haifeng, ”Multivariable Control of a Rolling Spider
Drone” (2017). Open Access Master’s Theses. Paper 1064.
http://digitalcommons.uri.edu/theses/1064