analysis and model based control of a quadrotor...
TRANSCRIPT
Pazmany Peter Catholic University
Faculty of Information Technology
Computer Engineering
Analysis and model based control
of a quadrotor helicopter
by
Ilona Sonnevend
Supervisor: dr Gabor Szederkenyi
Budapest, 2010.
Contents
Contents i
List of Symbols v
1 Introduction and motivations 1
1.1 Related works in the literature . . . . . . . . . . . . . . . . . . . . . 2
2 Controller design in continuous time 4
2.1 The applied model . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Simulink model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Angle stabilization using LQ-servo control technique . . . . . . . . . 9
2.3.1 Theoretical background . . . . . . . . . . . . . . . . . . . . . 10
2.3.2 Controller design and simulation results . . . . . . . . . . . 12
2.4 Height stabilization using LQ-servo control technique . . . . . . . . 15
2.4.1 Design of the controller and simulation results . . . . . . . . 15
2.5 Height stabilization using bounded LQR technique . . . . . . . . . 17
2.5.1 Theoretical background . . . . . . . . . . . . . . . . . . . . . 17
2.5.2 Design of the controller and simulation results . . . . . . . . 18
2.6 Height stabilization using non-linear feedback input-output lineari-
sation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.6.1 Theoretical background . . . . . . . . . . . . . . . . . . . . . 19
2.6.2 Design of the controller and simulation results . . . . . . . . 20
2.6.3 Comparison between the performances of the linear and non-
linear controller . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.7 Position stabilization using non-linear feedback control technique . . 22
2.7.1 Design of the controller and simulation results . . . . . . . . 22
3 Discrete time analysis and control 27
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2 Theoretical background . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.3 Discretization of the angle controller . . . . . . . . . . . . . . . . . 30
3.3.1 Estimation of the sampling time . . . . . . . . . . . . . . . . 30
3.3.2 Simulation results . . . . . . . . . . . . . . . . . . . . . . . . 32
3.4 Discretization of the height controller in linear case . . . . . . . . . 34
CONTENTS ii
3.4.1 Estimation of the sampling time . . . . . . . . . . . . . . . . 35
3.4.2 Simulation results . . . . . . . . . . . . . . . . . . . . . . . . 35
3.5 Discretization of the height controller in linear bounded case . . . . 35
3.6 Discretization of the height controller in the case of non-linear feedback 36
3.6.1 Simulation results . . . . . . . . . . . . . . . . . . . . . . . . 37
3.7 Discretization of the position controller in non-linear case . . . . . . 38
3.7.1 Simulation results . . . . . . . . . . . . . . . . . . . . . . . . 38
3.8 Robustness testing of the position controller under Gaussian noise . 39
4 Summary and Conclusions 41
4.1 Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Bibliography 42
List of Figures 44
Tartalmi kivonat
A szakdolgozat temaja negyrotoros helikopter, vagy masneven quadrokopter mod-
ellezese, szabalyozasa es szimulacioja. A helikopter modelljet es a szabalyozokat
MATLAB kornyezetben implementaltam. A szakdolgozat folytonos es diszkret
idoben (halozati kommunikacios kornyezet feltetelezesevel) egyarant vizsgalja, hogy
milyen hatekonysaggal mukodnek a kulonbozo linearis es nemlinearis szabalyozasi
technikak.
Szog-, magassag- es pozıcioszabalyozokat terveztem LQR, LQ-szervo, polus-
athelyezeses, nemlinearis input-output es feedback linearizacios szabalyozasi tech-
nikak felhasznalasaval. Ahol lehetseges, ott egyazon problema megoldasara tobb
szabalyozot is bemutatok, ıgy lehetoseg nyılik a szabalyozok teljesıtmeny alapu
osszehasonlıtasara is. Eloszor a folytonos ideju szabalyozok tervezeset ismertetem,
majd azt, hogy hogyan lehet olyan maximalis mintaveteli idot becsulni a szabalyozo
diszkretizalasahoz, amely mellett a szabalyozott rendszer stabilitasi tulajdonsagai
garantaltan nem romlanak. Ez a ma ismert legelesebb becslesi technika alapjan
tortent.
A szakdolgozat linearis es nemlinearis szabalyozasi korok egyedi kombinaciojat
mutaja be a szog-, magassag, es pozıcioszabalyozashoz. Ugyanakkor bemutatja a
nemlinearis szabalyozasi technikak alkalmazasanak elonyeit es hatranyait. Vegul
pedig diszkret ideju, implementalasra kesz szabalyozokat ismertet, ahol a mintaveteli
ido hatarait elmeleti es szimulacios modszerekkel vizsgalja.
Abstract
This thesis deals with the modelling, control and simulation of a helicopter with
four rotors, also referred as quadrocopter. Helicopter model and controllers are
built in MATLAB Simulink environment. The thesis also investigates the perfor-
mance of various linear and non-linear control strategies, both in continuous and
discrete time assuming a networked communication model.
Angle, height and position controllers are designed and presented using LQR,
LQ-servo, pole placement, non-linear input-output feedback and feedback lineari-
sation techniques. Where it was possible, several controllers were developed for
the same task to compare the performance and effectiveness of the various control
strategies. Firstly, controllers are designed in continuous time, and then I try to
give an estimation for such a maximal sampling time that maintains the stabil-
ity properties of the original closed loop system. For the estimation, I used the
sharpest technique that is presently known.
This thesis introduces a new combination of linear and non-linear control loops
for angle-, height-, and position controlling. It shows also the benefits and deficits
of using non-linear techniques. Finally, it provides controllers in discrete time,
ready for implementation, where the limit of the sampling time was estimated on
a theoretical basis.
List of Symbols
A propeller disk area [m2]
Ac fuselage area [m2]
b thrust factor [Ns2]
c propeller chord [m]
C propulsion group cost factor
d drag factor [Nms2]
g acceleration due to gravity [kgms2
]
h vertical distance: Propeller center to CoG [m]
H hub force [N]
Ixx,yy,zz inertia moments [kgm2]
Jr rotor inertia [kgm2]
l horizontal distance: propeller center to CoG [m]
m overall mass [kg]
n number of propellers
Q drag moment [Ns]
R rotation matrix
Rm rolling moment [Ns]
T thrust force [N]
U control input vector
x, y, z position in body coordinate frame [m]
Φ pitch angle [rad]
ρ air density [ kgm3 ]
Θ roll angle [rad]
Ψ yaw angle [rad]
Ω propeller angular rate [ rads
]
Ωr overall residual propeller angular speed [ rads
]
CHAPTER 1Introduction and motivations
Lately, significant research work have been performed in the fields of modeling and
control of UAVs (Unmanned Autonomous Vehicles). Flying objects have ever ex-
erted a great fascination on man and given the motivation to all kinds of research.
Nowadays they have been proved to be very useful in many areas, not only for mil-
itary applications: for certain kinds of dangerous observations, like measurements
in radioactive zones etc. it is easier to send unmanned vehicles.
There are many different types of UAVs from mini-aircrafts to mini helicopters.
It took a long time until the technology made it possible to precisely control a
helicopter with plenty of degrees of freedom. In this thesis research and analysis
is done on a 6 DOF aircraft with four rotors, also known as quadrocopter. This
vehicle is hard to be controlled manually but with the development of control-
technology, research started to turn to this construction again, and tried to control
it automatically.
The model of a quadrocopter, investigated in the thesis, consists of 12 differen-
tial equations, and it is highly non-linear. It is an ideal model for trying to test the
performances of linear control strategies against non-linear ones. Literature shows,
that many linear and non-linear controllers were made to the quadrocopter, but
very few provided a real analysis on the performance of various applied controllers.
The implementation of linear controllers is easy, but robustness and appropriate
time-domain behaviour are also required here that are difficult to guarantee. That
leads us to the development and test of non-linear controllers. However, it is im-
portant to investigate when it is worth to choose a non-linear controller over an
easy-to-implement linear one.
Most often, the starting phase of nonlinear controller design is performed in
continuous time, but the practical implementation requires a stable controller in
discrete time. This thesis also deals with a theoretical estimation of the sampling
times in the case of the linear controllers, and gives a working sampling time to
each of the controllers. A state of the art, and most effective known estimation
CHAPTER 1. INTRODUCTION AND MOTIVATIONS 2
technique is introduced here briefly and applied to the controllers working on a
linear system model.
This thesis provides new controller combinations for the angle-, height-and
position control tasks, were non-linear and linear controllers are working together,
based on a backstepping schema, both in continuous and discrete time, ready for
implementation. The analysis described here can be useful to one dealing with a
quadrotor helicopters to implement the controllers, and also to one interested in
control theory.
1.1 Related works in the literature
As mentioned before, numerous papers and theses are dealing with the problem of
modelling and controlling a quadrotor aircraft. The most detailed publication from
this thesis point of view is the PhD thesis [1]. In this paper a highly non-linear
model of a quadrocopter is introduced that describes the dynamics very precisely,
but also makes some simplifications with respect to indoor flying. The thesis also
applies various control strategies to the model, like PID, PD, LQR, Lyapunov sta-
bilisation and backstepping control design. But there were also other interesting
papers, that affected this thesis. Paper [2] deals with designing non-linear control
strategy for stabilization. It deals with a similar but partially simplified model,
than the one described in the thesis mentioned above. Controllers based on Lya-
punov stabilisation and backstepping based PID controlling were constructed here.
Paper [3] deals with a non-linear but very simple state-space model, and it shows
explicitly, that applying non-linear control theory can improve the performance of
the controller and enable tracking of aggressive trajectories. It implies that way,
that it is worth to apply non-linear control techniques, that are more difficult to
implement than linear ones, to achieve more robust controllers. This paper also
introduced the idea to handle stabilisation of the different angles and position
coordinates with independent control loops (with one control loop one angle and
position coordinate is handled). It also applies some simplifications during the
design of non-linear controller, that enables to get still easy to implement non-
linear feedbacks. These simplification ideas also inspired the designs introduced in
my thesis.
Thesis [4] also deals with non-linear control of a quadrocopter. The model
used here is also a highly non-linear one, but it is given in a quite different form
than in the mentioned PhD thesis [1]. It applies LQR technique, backstepping
control schema and the inversion method. The applied thechniques here are very
interesting, but the non-linear control strategies made the control sometimes very
complicated.
Paper [7] shows, that the model of a quadrocopter is suitable to apply advanced
control techniques, because of its complexity. It gives inspiration to apply further
control techniques, and analyse them using this model, even though various con-
CHAPTER 1. INTRODUCTION AND MOTIVATIONS 3
trollers were presented in the past few years solving angle and height stabilisation
and trajectory tracking issues. This paper also presents controllers to trajectory
tracking and planning suitable for surveillance.
The paper [8] deals with the control of a large quadrocopter robot. Hence it
deals with a quite different model under the circumstances of outdoor flying. But
one interesting thing about it is, that it explicitly deals with the discretisation of
the controller designed in continuous time. It estimates the sampling time with
the matched pole-zero discretisation method, so it tries to find a good sampling
time analytically, not only based on simulation results. Another paper [9] from
the same journal introduces a H1 controller design to the very same model then
described in paper [1].
Many other papers are dealing with developing VTOLs (vertical take off and
landing UAVs), or implementing some applications to a quadrocopter like obser-
vation or object tracking. These show, how important it is to have a precisely
working controller with a very high performance. Paper [5] e.g. deals with devel-
oping non-linear controller techniques related to visual flow [6].
It can be seen, that the controllers described in the literature use mostly LQR,
PID and backstepping control schema. The feedbacks resulting from the non-linear
controllers are often very complex ones. Only just few of the articles and theses
are dealing seriously with the issue of discretisation.
In my thesis, further linear and non-linear strategies are used to control the
quadrocopter, like LQ-servo, bounded LQR, and non-linear feedback technique,
with the aim to find easy to implement feedbacks. This thesis also gives a unique
construction of linear and non-linear controllers, and it deals with finding sampling
times analytically for dicretisation of the controllers, with the sharpest known
sampling time estimation technique.
Sandor Alpar, former student at the Pazmany University, built a quadrotor
robot [10] and presented a simple angle controller. Controllers developed by this
thesis are suitable to the built robot, and were simulated using its parameters.
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 5
2.1 The applied model
The literature about quadrocopters is nowadays very extensive. Lots of papers are
dealing with finding a good physical model to a quadrocopter. The solutions, one
can find in the literature are very diverse. Some of them include lots of simpli-
fication making the model less non-linear to be able to implement linear control
strategies more easily. Some others consider too many actuators, to make an as
good as possible approach to the dynamics of the actuators in the case of out-door
flying.
After doing some research, the physical model described in thesis [1] was cho-
sen. On one hand those actuator dynamics can easily be incorporated into the
model which are important in the case of a quadrocopter, and its assumptions are
applicable in case of designing controllers to a mini-helicpoter for in-door flying.
On the other hand, Sandor Alpar, former student at the Pazmany University, built
a mini-quadrotor, and used the same physical model to design an angle-controller
[10]. Since the goal of this thesis is both to obtain some results in the analysis of
the different control strategies and to prepare the controllers for implementation on
the existing mini-aircraft, using the mentioned physical model was the best choice.
The physical model. Since the applied physical model was developed for in-door
flight of a mini-helicopter, the following assumptions can be made:
• The structure is supposed to be rigid.
• structure is assumed to be symmetric.
• The center of gravity (CoG) and the body fixed frame origin are assumed to
coincide.
• The propellers are supposed rigid.
• Thrust and drag are proportional to the square of propeller’s speed.
The physical model given in Newton-Euler formalism [1] (list of symbols and their
untis can be found at page vi):
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 6
IxxΦ = ΘΨ(Iyy − Izz) + JrΘΩr + l(−T1 + T4)− h(∑4
i=1Hyi) +∑4
i=1(−1)(i+1)Rmxi
IyyΘ = ΦΨ(Izz − Ixx)− JrΦΩr + l(T1 − T3) + h(∑4
i=1Hxi) +∑4
i=1(−1)(i+1)Rmyi
IzzΨ = ΘΦ(Ixx − Iyy) + JrΩr +∑4
i=1(−1)iQi + l(Hx2 −Hx4) + l(−Hy1 +Hy3)
mz = mg − (cΨcΦ)∑4
i=1 Ti
mx = (sΨsΦ + cΨsΘcΦ)∑4
i=1 Ti −∑4
i=1Hxi − 12CxAcρx|x|
my = (−cΨsΦ + sΨsΘcΦ)∑4
i=1 Ti −∑4
i=1Hyi − 12CyAcρy|y|
To get a better understanding of the equations above, figure 2.1 gives a schematic
draw of the quadrocopter indicating the most important parameters [2], and fig-
ure 2.2 shows the quadrotor concept motion description, where the arrow width is
proportional to propeller rotational speed [11].
Figure 2.1: Schematic draw of the quadrocopter
The derived state-space model. To be able to design controllers, these equations
must be rewritten as a state-space model. Since the equations above are highly
non-linear, the resulting state-space model is also a non-linear one. Non-linear
input affine state-space models can be written in the following form:
x = f(x) + g(x)U
State variables:
x = (x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12) = (Φ Φ Θ Θ Ψ Ψ z z x x y y)
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 7
Figure 2.2: Quadrotor concept motion description, the arrow width isproportional to propeller rotational speed.
Inputs:
U = (U1 U2 U3 U4)
With:U1 = b(Ω2
1 + Ω22 + Ω2
3 + Ω24)
U2 = b(−Ω22 + Ω2
4)
U3 = b(Ω21 + Ω2
3)
U4 = b(−Ω21 + Ω2
2 − Ω23 + Ω2
4)
The resulting state-space model after some simplifications (hub forces and rolling
moments are neglected and thrust and drag coefficients are supposed constant) can
be written as:
f(x) =
x2a1x4x6 + a2Ωrx4
x4a3x2x6 + a4Ωrx2
x6a5x4x2x8−gx100
x120
g(x) =
0 0 0 0
0 b1 0 0
0 0 0 0
0 0 b2 0
0 0 0 0
0 0 0 b30 0 0 0
ut1m
0 0 0
0 0 0 0
ux1m
0 0 0
0 0 0 0
uy1m
0 0 0
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 8
Parameter Value
Ixx 8.11858e-005Iyy 8.11858e-005Izz 6.12233e-005Jr 6e-5l 0.235b 3.13e-5d 7.5e-7m 0.506
Table 2.1: Model parameter values
With:a1 = Iyy−Izz
Ixxb1 = l
Ixx
a2 = JrIxx
b2 = lIyy
a3 = Izz−IxxIyy
b3 = lIzz
a4 = JrIyy
a5 = Ixx−IyyIzz
ut = cosΦcosΘ
ux = (cosΦsinΘcosΨ + sinΦsinΨ)
uy = (cosΦsinΘcosΨ− sinΦcosΨ)
At this point it must be noticed, that the speeds of the propellers are the real
inputs and outputs of the system, but the state-space model deals only with Us.
The propeller speeds can be calculated easily with the following linear relation:Ω2
1
Ω22
Ω23
Ω24
=
0.25 0 0.5 0.25
0.25 −0.5 0 0.25
0.25 0 −0.5 −0.25
0.25 0.5 0 0.25
·U1/b
U2/b
U3/b
U4/b
It can be seen, that this system is an under-actuated system, because the
number of inputs is four, but the degree of freedom is six (three angles and three
coordinates). It can be also seen, that the positions depend on the angles, but
not on each other, and the angles only depend from each other but not from the
positions. That way it is possible to decompose the height and position control
loops.
The values of the parameters in the state space model can be found in [10],
where these values are estimated based on the built model at the Pazmany
university. These parameters can be seen at table 2.1 .
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 9
2.2 Simulink model
The model based on the described state-space model above was built in MATLAB
Simulink. Each controller, even the linear ones, are applied to this model.
Figure 2.3: Model built in Simulink
The block on the top is computing the equations related to the angles, and
the block on the bottom computes the equations related to the positions. The
sequence of the lines corresponds to the sequence of the state variables.
2.3 Angle stabilization using LQ-servo control tech-
nique
To perform various tasks with a quadrocopter, the first step is always to be able to
control the angles. In this physical system, the angles have a dedicated role. The
angles determine whether the helicopter hovers, or heads toward a direction. To
be able to control this construction, fast and robust angle controllers are needed.
That is why the angle controller is the ”heart” of every robot-pilot designed to a
quadrocopter.
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 10
2.3.1 Theoretical background
To be able to hover with the quadrocopter is not the only goal here, therefore a
control strategy was needed that is capable of performing a reference tracking. LQ-
servo is such a technique, and usually it handles the differences between a linear
and non-linear system model quite well, so it is also known as a sufficiently robust
control technique.
The idea beyond the construction of an LQ-servo control loop is to extend the
model with an error variable, that shows the difference between the desired and
the actual state [17]. So the task is find a feedback that brings the value of the
error vector to zero.
We have the following linear time invariant state-space model:
x = Ax+Bu
y = Cx
This system can be extended with an error vector. r stands for a desired constant
reference value.x = Ax+Bu
z = r − y = r − CxIn matrix form: (
x
z
)=
(A 0
−C 0
)(x
z
)+
(B
0
)u+
(0
I
)r
The goal is to make z asymptotically converge to zero. This means that a full
state feedback must be applied, with other words, the value of K feedback must
be calculated: u = −K(x
z
),where K is a block matrix:
K =(Kx Kz
)The feedback gain K is designed using the LQR control strategy, that solves the
Control Algebraic Ricatti equation minimizing the J functional:
J =
∫ ∞0
xTQx+ uTRudt
We remark that K can also be computed using other stabilizing controller design
methods (e.g. pole-placement), but the advantageous robustness properties of the
LQ loop might be lost in this case.
The linear state-space model To design the K feedback in a linear way, a linear
state space model is needed, so the non-linear state-space model must be linearised.
The non-linear state space model:
x = f(x) + g(x)U
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 11
Figure 2.4: Schema of the LQ-sevo controller
The equilibrium point of a model is following:
(x∗, U∗) : f(x∗) + g(x∗)U∗ = 0
The linear model is:
A =∂f
∂x|x=x∗
B = g(x∗)
The equilibrium point of the quadrocopter:
(U∗, x∗) :
U∗1 = mg
U∗2 3 4 = 0
x∗1 2 3 4 5 6 8 10 12 = 0
x∗7 9 11 = constant
That means, that the quadrocopter hovers in its equilibrium point, so the angles
are zero, and each position is a constant. The resulting linear model is:
A =
0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0
B =
0 0 0 0
0 b1 0 0
0 0 0 0
0 0 b2 0
0 0 0 0
0 0 0 b30 0 0 01m
0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 12
2.3.2 Controller design and simulation results
Design servo feedback using pole-placement technique. It is known, that a linear
system is asymptotically stable, if the real part of its poles are negative. The
idea of the pole-placement technique is to design a feedback, that shifts the real
part of the poles to the desired places. This technique can provide a smooth
stabilization curve, without any big overshoots and oscillations. But usually it
does not guarantee the robustness of controller. If we assume that the angles are
close to the zero equilibrium (so that there are no big differences between the
linearised and the non-linear state space model), using pole-place is expected to
be a good approach. The state-space model used at the angle controller is the
following:
A =
0 1 0 0 0 0
0 0 0 0 0 0
0 0 0 1 0 0
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 0 0 0
B =
0 0 0
b1 0 0
0 0 0
0 b2 0
0 0 0
0 0 b3
C =
1 0 0 0 0 0
0 0 1 0 0 0
0 0 0 0 1 0
In this model, we only obtain the equations corresponding to the angles. The
input U1 is considered to be constant (mg), so the matrix B only has three rows.
C shows, that the angles are the outputs of the system.
The extended system for the design of the servo controller:
A =
0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0
−1 0 0 0 0 0 0 0 0
0 0 −1 0 0 0 0 0 0
0 0 0 0 −1 0 0 0 0
B =
0 0 0
b1 0 0
0 0 0
0 b2 0
0 0 0
0 0 b30 0 0
0 0 0
0 0 0
By choosing the values for the poles it must be considered, that the values of thepoles can not be too close to each other, otherwise we may face numerical problemswhen trying to solve the pole placement task. But the real parts of the poles cannot be too far from zero, otherwise that would make the controller too hard in termsof necessary control inputs. Using poles (−1 −1.5 −2 −2.5 −3 −3.5 −4 −4.5 −5)we got the feedback:
K =
0.01 0.0031 −0.0012 −0.0002 0.0006 0.0001 −0.0151 0.0025 −0.0012−0.0015 −0.0002 0.0114 0.0034 0.002 0.0003 0.0031 −0.0177 −0.00440.0002 0 0.0003 0 0.0027 0.0007 −0.0005 −0.0007 −0.0046
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 13
Figure 2.5: The LQ-servo controller in Simulink
The initial state of the angles is: Φ0 = 0.3, Θ0 = −0.5, Ψ0 = 0.5, the references
are zeros, respectively. Using the above described controller with K feedback, we
get following results:
Figure 2.6: Angles and angular speeds controlled with a servo controllerusing pole-placement technique
It can be seen at 2.6, that the controller works effectively it handles the non-
linear system well and the overshooting is acceptable.
It must be remarked that equipping the original linearised model with addi-
tional integrators through the servo control scheme will allow us to follow not only
constant but also more complex angle references that will be useful later when the
position is controlled using a cascade structure.
Design LQ-servo feedback using LQR technique. It’s difficult to design effective
controllers with the pole-placement technique, if the angles are not near zero,
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 14
so if the difference between the linear and the non-linear model is getting more
significant. LQR technique is known as a very robust control strategy, so in case of
the angle controller is better to rely on that technique. The idea of this technique is
to find a K feedback, that minimizes the J functional, with given Q and R matrices:
J =
∫ ∞0
xTQx+ uTRudt
solving the Control Algebraic Ricatti equation:
ATx+ xA− xBR−1BTx+Q = 0
The property of the controller can be given with the Q and R matrices. The
performance of the controller depends essentially on the ratio between the norms
of the matrices Q and R.
Q = 0.001 ·
20 0 0 0 0 0 0 0 0
0 20 0 0 0 0 0 0 0
0 0 20 0 0 0 0 0 0
0 0 0 20 0 0 0 0 0
0 0 0 0 20 0 0 0 0
0 0 0 0 0 20 0 0 0
0 0 0 0 0 0 8 0 0
0 0 0 0 0 0 0 8 0
0 0 0 0 0 0 0 0 8
R =
1 0 0
0 1 0
0 0 1
Having these Q and R matrices we get the feedback:
K =
0.4384 0.1425 0 0 0 0 −0.6057 0 0
0 0 0.4384 0.1425 0 0 0 −0.6057 0
0 0 0 0 0.4372 0.1416 0 0 −0.6045
If we look at the structure of K it can be seen, that finally the LQ optimal
control design procedure gives a PID controller structure. This also justifies the
use of additional integrators through the servo design method. The proportional,
derivator and integrator coefficients can be found in each row. That means, that
the angle stabilization can be solved with 3 independent PID control loops, so K
gives an optimal and easy to implement controller.
The initial states of the angles are: Φ0 = −1.2, Θ0 = 1.5, Ψ0 = 1.1, the
references are zeros, respectively. Using the above described controller with K
feedback, we get following results:
It can be seen at 2.7, that the controller works effectively, with less overshooting
than the pole-placement controller, and it handles the non-linear system very well,
even if the angles are not near zero.
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 15
Figure 2.7: Angles and angular speeds controlled with LQ-servo controller
2.4 Height stabilization using LQ-servo control tech-
nique
The controllers described above only affect the angles. That means, that even if the
controller manages to control the angles, that does not mean, that the helicopter
will stay in one position. That is why further control loops are needed to the height
and positions control. The first step is to design a height controller. This task is
also a reference-tracking task, so an LQ-servo technique can be used here, too.
2.4.1 Design of the controller and simulation results
Linear controller with one control loop. Since the height stabilization is also a ref-
erence tracking issue, it is possible to find a solution to the angle and height
stabilization with one LQ-servo control loop. This means, that besides the system
described in the angle stabilization, the equations describing the motion among the
z coordinate are also needed, and the error vector must be extended with the dif-
ference between the z coordinate and the desired height. So the resulting extended
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 16
linearised system is the following:
A =
0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
−1 0 0 0 0 0 0 0 0 0 0 0
0 0 −1 0 0 0 0 0 0 0 0 0
0 0 0 0 −1 0 0 0 0 0 0 0
0 0 0 0 0 0 −1 0 0 0 0 0
B =
0 0 0 0
b1 0 0 0
0 0 0 0
0 b2 0 0
0 0 0 0
0 0 b3 0
0 0 0 0
0 0 0 1/m
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
The construction using pole-placement based servo controller did not produce
satisfying results, so an LQ design is described below.
Q = 0.1 ·
20 0 0 0 0 0 0 0 0 0 0 0
0 20 0 0 0 0 0 0 0 0 0 0
0 0 20 0 0 0 0 0 0 0 0 0
0 0 0 20 0 0 0 0 0 0 0 0
0 0 0 0 20 0 0 0 0 0 0 0
0 0 0 0 0 20 0 0 0 0 0 0
0 0 0 0 0 0 20 0 0 0 0 0
0 0 0 0 0 0 0 20 0 0 0 0
0 0 0 0 0 0 0 0 8 0 0 0
0 0 0 0 0 0 0 0 0 8 0 0
0 0 0 0 0 0 0 0 0 0 8 0
0 0 0 0 0 0 0 0 0 0 0 8
R =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Having these Q and R matrices, we got K feedback:
K =
2.13 1.41 0 0 0 0 0 0 −0.89 0 0 0
0 0 2.13 1.41 0 0 0 0 0 −0.89 0 0
0 0 0 0 2.13 1.41 0 0 0 0 −0.89 0
0 0 0 0 0 0 2.40 2.10 0 0 0 −0.89
The structure of K gives PID controller again, so with these methods, an opti-
mal and easy to implement feedback could be found.
Simulation results with initial states Φ0 = −1, Θ0 = 1, Ψ0 = 1,z0 = 0 and
references (0, 0, 0, 1), respectively:
It can be seen at 2.8, that with besides a quite significant undershooting the
controller handles the height stabilization together with the angle stabilization.
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 17
Figure 2.8: Angles and angular speeds, inputs and height controlled withLQ-servo controller using LQR technique
2.5 Height stabilization using bounded LQR tech-
nique
At the height stabilization problem, where the task is getting quite difficult, it is
important to watch the output of the controller, that means to pay attention to the
magnitude of the inputs. The model built in our robotics laboratory can handle
a maximum 25 N thrust force. So it is important to keep the inputs below that
range. Bounded input controller can be designed using bounded LQR technique.
2.5.1 Theoretical background
Considering the linear system:
x = Ax+Bu
y = Cx
There exists a stabilizing state feedback K such that for every initial condition x(0)
with ‖x(0)‖ ≤ 1 , the resulting control satisfies ‖u(t)max‖ < Umax for all t ≥ 0,
if and only if there exist an matrix Q and an matrix R satisfying the equality
constraint [18]:
Q−QT = 0
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 18
and the inequality constraints:
Q ≥ 0
−AQ−QAT −BR−BTRT > 0(U2maxI R
RT Q
)> 0
in which case one such K can be constructed as:
K = RQ−1
2.5.2 Design of the controller and simulation results
The same LQ-servo structure will be used as in the section above, but inside the
LQ-servo controller, the error vector will be driven to zero with bounded LQR
technique. Having A and B matrices as above, the set of matrix equalities and
inequalities need to be solved. This can be easily done in MATLAB using the
yalmip toolbox [14]. Setting Umax = 800 the resulting Q and R matrices are:
R = −103
0.27 0.13 0 0 0 0 0 0 0.068 0 0 0
0 0 0.27 0.13 0 0 0 0 0 0.068 0 0
0 0 0 0 0.048 0.024 0 0 0 0 0.012 0
0 0 0 0 0 0 2600 1700 0 0 0 750
Q = 105·
4.7 −1.9 0 0 0 0 0 0 1.9 0 0 0
−1.9 7.8 0 0 0 0 0 0 1.5 0 0 0
0 0 4.7 −1.9 0 0 0 0 0 1.9 0 0
0 0 −1.9 7.8 0 0 0 0 0 1.5 0 0
0 0 0 0 4.7 −1.9 0 0 0 0 1.9 0
0 0 0 0 −1.9 7.8 0 0 0 0 1.5 0
0 0 0 0 0 0 4.7 −1.8 0 0 0 1.9
0 0 0 0 0 0 −1.8 6.5 0 0 0 1.5
1.9 1.5 0 0 0 0 0 0 7.8 0 0 0
0 0 1.9 1.5 0 0 0 0 0 7.8 0 0
0 0 0 0 1.9 1.5 0 0 0 0 7.8 0
0 0 0 0 0 0 1.9 1.5 0 0 0 7.8
The resulting K feedback is:
K = 10−5·
84 42 0 0 0 0 0 0 −21 0 0 0
0 0 84 42 0 0 0 0 0 −21 0 0
0 0 0 0 15 7.52 0 0 0 0 −3.69 0
0 0 0 0 0 0 8900 5800 0 0 0 −2400
The structure of K gives a PID controller again, so the bounded input problem
can be solved with four optimal PID control loops (three to the angles and one to
the height).
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 19
Simulation results with initial states Φ0 = −1, Θ0 = 1, Ψ0 = 1,z0 = 0 and
references (0, 0, 0, 1), respectively (same as at the section above):
Figure 2.9: Angles and angular speeds, inputs and height controlled withLQ-servo controller using bounded LQR technique
It can be seen in 2.9, that the performance of the controller slows down, because
of the input bounds. At the linear height controller in the section above, the norm
of the vector U was 836.4056, in the bounded case, we got an U vector with bound
62.859, which is about ten times smaller.
2.6 Height stabilization using non-linear feedback input-
output linearisation
Since the height stabilization problem can be handled independently from the angle
stabilization it became worth to try non-linear control strategies, like the feedback
input-output linearisation [15].
2.6.1 Theoretical background
[15] The basic idea of input-output linearisation is to find a nonlinear static feed-
back that makes the system look linear from the input-output point of view. The
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 20
non-linear state-space model:
x = f(x) + g(x)U
y = h(x)
The relative degree of this system at x0 is r, if following statements are true:
• LgLrkh(x) = 0 for all x in the near of x0 for all k < r − 1
• LgLr−1f h(x0) 6= 0
The goal is to find U in the form U = α(x)+β(x)·v, so that the system looks linear
from the input to the output. That way, a linear control strategy can be applied
to the system. The relative degree of freedom of the system can be maximum n,
where n is the dimension of the state-space.
2.6.2 Design of the controller and simulation results
While designing a control loop to the height stabilisation problem, the following
two equations are considered:
x7 = x8
x8 = (cosx1cosx3)1
mU1 − g
The steps of the input linearisation are the followings: Let U1 = (cosx1cosx3)1mU1.
Then we will have the following equations:
x7 = x8
x8 = U1 − g
Let U1 = U1− g, and let x7 = href −x7, since we have also a reference tracking
issue at the height stabilisation. Then we will have the following equations:
x7 = x8
x8 = U1
The resulting equations form a linear system, it is now possible to define the matrix
form of the linearised state-space model.
A =
(0 1
0 0
)B =
(0
1
)
This is a controllable system, that can be stabilized with a U1 = K
(x7x8
)feedback.
From that we can compute the value of U1 :
U1 =g − U1
cosx1cosx3
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 21
We can get the K feedback with LQR technique:
Q =
(1 0
0 1
)R = 1 K =
(0.1 0.04583
)Simulation results with initial states Φ0 = −1, Θ0 = 1, Ψ0 = 1,z0 = 0 and
references (0, 0, 0, 1), respectively:
Figure 2.10: Angles and angular speeds, inputs and height controlled withLQ-servo and non-linear feedback input-output linearisation
It can be seen in 2.10, that with a smooth overshooting, the controller handles
the task very well, even with initial angle values, that are not near to zero. This
controller, combined from linear and non-linear control loops (linear LQ-servo for
angle stabilisation, and feedback input-output linearisation for the height stabili-
sation) works quite well.
2.6.3 Comparison between the performances of the linear and
non-linear controller
In the linear case the resulted feedback is an optimal PID controller, so the task in
the linear case can be solved with four independent PID loops, and the performance
of the controller is satisfactory. In the non-linear case an optimal PID controller
can be used to the angle stabilization as well, but the feedback to the height
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 22
stabilization task is a non-linear one, but it is easy to handle, since only cosine
functions are needed.
In 2.11 angles and height can be seen in the linear case at the top, and in the
non-linear case at the bottom, with initial states Φ0 = −0.1, Θ0 = 0.1, Ψ0 =
0.15,z0 = 0 and references (0, 0, 0, 1), respectively. Having these small, near zero
initial values to the angle, it can be seen, that the non-linear controller works
more satisfactory since it produces no undershoot. The angle stabilisation remains
satisfactory in both cases.
At 2.12 angles and height can be seen in the linear case at the top, and in
the non-linear case at the bottom, with initial states Φ0 = −1.4, Θ0 = 1.5, Ψ0 =
1.3,z0 = 0 and references (0, 0, 0, 5), respectively. Having these more significant
initial values to the angles, it can be seen, that the non-linear controller shows a
quite better performance to the angle stabilisation as well.
One other important advantage of the non-linear controller is, that it is very
easy to tune its parameters. In the linear case, the controller was very sensitive
to its parameters. Even small changes in the parametrization could lead to an
unstable controller. But in the non-linear case, the parameters can be changed
easily, depending on the needed performance.
2.7 Position stabilization using non-linear feedback
control technique
At the height stabilization it was shown that even if the controller stabilizes the
angles, it is not guaranteed, that the helicopter will stay in a given position. So
it is necessary to deal with position stabilization as well. Also when we want to
perform trajectory tracking tasks, it is important to be able to move the helicopter
to a given position. Controllers were designed in a back-stepping schema, which
is a non-linear schema [16], so for the height and the position stabilization only
non-linear controllers will be shown .
2.7.1 Design of the controller and simulation results
To perform the position stabilization, separate control loops must be applied to
the state variables x9, x10 and x11, x12. These loops were designed with the non-
linear input-output feedback control technique. To simplify the equations, let us
assume that x5 = 0, so that the rotation around the z axis is zero. The controller
applied to x7, x8 gives the feedback to U1. At the position stabilization it has to be
calculated, which angles are needed to take the helicopter into the given position.
So we consider x1 and x3 as inputs here. Let us design the controller to stabilize
the y coordinate first.
˙x11 = x12
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 23
Figure 2.11: Comparison of the linear and non-linear controllers in caseof small, near zero angles and small height reference
˙x12 = uy1
mU1
with uy = cosx1sinx3sinx5 − sinx1cosx5 = −sinx1.Let x11 = yref − x11 and let uy = uy
1mU1. Then we have the following linear
equations:˙x11 = x12
˙x12 = uy
The resulting state-space model:
A =
(0 1
0 0
)B =
(0
1
)
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 24
Figure 2.12: Comparison of the linear and non-linear controllers in caseof large, near zero angles and small height reference
This is a controllable model, which can be stabilized with an
uy = K ·(x11x12
)feedback. This feedback can be designed using LQR technique. Having Q and R
matrices as described at the non-linear height stabilization, we get the feedback:
K =(0.1000 0.04583
)This means, that
uy =uym
U1
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 25
From uy we can calculate the value of x1 easily:
x1 = arcsin(−uy)
Now let us design a controller, that stabilizes the x coordinate.
x9 = x10
˙x10 = ux1
mU1
with ux = cosx1sinx3cosx5 + sinx1sinx5 = cosx1sinx3.
Let x9 = xref − x9 and let ux = ux1mU1. Then we have the following linear
equations:˙x9 = x10
˙x10 = ux
The resulting state-space model:
A =
(0 1
0 0
)B =
(0
1
)This is a controllable model, which can be stabilized with an
ux = K ·(x9x10
)feedback. This feedback can be designed using LQR technique. Having Q and R
matrices as described at the non-linear height stabilization, we get the feedback:
K =(0.1000 0.04583
)This means, that
ux =uxm
U1
From ux we can calculate the value of x3 easily:
x3 = arcsin(ux
cosx1)
where the value of x1 is calculated from the feedback at the control loop for co-
ordinate y. Now we have two feedbacks to x1 and x3. These feedbacks will give
the reference values to the LQ-servo control loops at the angle stabilization. The
non-linear height stabilization stays as an independent control loop.
We got the following results with initial values: x7 = 0, x9 = 0, x11 = 0, and
reference values 10, 12, 15 respectively:
It can be seen in 2.13 that the controller combined from linear and non-linear
control loops handles the position stabilizing in a very satisfying way. Overshoot-
ing is acceptable, and the different loops do not slow down the performance of
each other. To get a better view on the helicopters trajectory during the position
stabilizing 2.14 shows the 3D curve of the motion of the helicopter.
CHAPTER 2. CONTROLLER DESIGN IN CONTINUOUS TIME 26
Figure 2.13: Angles and angular speeds, inputs and positions controlledwith LQ-servo and non-linear feedback input-output linearisation
Figure 2.14: Position curve of the quadrocopter
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 28
3.1 Introduction
The goal of this thesis is not only to provide working controllers to the quadrocopter
and analyse the applied control strategies, but to prepare these controllers for
implementation. To implement the controllers, they must work in discrete time.
So it is a remaining question, how to choose a working sampling time to these
controllers. In this chapter sampling times to the controllers described in chapter
1 will be provided.
3.2 Theoretical background
Where it is possible, this chapter will give an estimated sampling time based on
the paper [12]. This work provides the sharpest estimation technique known today,
based on that, a sampling time can be given, to which it is proven, that the discrete
system keeps the main stability properties of the continuous time system.
Usually the actuators, sensors and controllers are connected via a separate or
shared network, as it can be seen in figure 3.1 [13].
Figure 3.1: networked control system
Variables:
xp plant state vector
xc controller state vector
y plant output
u controller output
y most recently transmitted plant output
u most recently transmitted controller output
We assume that data is transmitted between the nodes (individual sensors and
actuators connected to the network) at time instants t0, t1, ..., ti where i ∈ N. The
transmission time instants satisfy:
ε < tj+1 − tj ≤ τ for j ≥ 0, where ε, τ > 0
The upper interval bound τ is called the maximum allowable transfer interval,
MATI. Error caused by the network transmission:
e(t) =
(y(t)− y(t)
u(t)− u(t)
)
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 29
The equations of the networked control system:
x = f(t, x, e, w), t ∈ [ti−1, ti]
e = g(t, x, e, w), t ∈ [ti−1, ti]
with x = [xTp xTc ]T ∈ R, and disturbance vector w. The change of e during trans-
mission instants:
e(t+i ) = (I −Ψ(i, e(ti)))e(ti)
e(t+i ) = ∧(i,Ψ(i, e(ti))e(ti), (ti))
with e decision vector of the network scheduler, Ψ scheduling function, and ∧decision update function.
Theorem(Tabbara et al, 2007): Suppose that the NCS scheduling protocol is
uniformly persistently exciting in time T and the following assumptions hold:
• There exists Q positive definite symmetric matrix and continuous output of
the form y(x,w) = G(x) + w so that the error dynamics e = g(t, x, e, w)
satisfies:
g(t, x, e, w) Qe+ y(x,w)
for all (x, e, w) for t ∈ (ti, ti+1) and for all i ∈ N. Note, that x y ≡ xi ≤yi for i = 1, ..., n, and x = [|x1|, ..., |xn|]T
• x = f(t, x, e, w) is Lp stable from (e, w) to G(x) with gain γ for some p ∈[1,∞]
• The MATI satisfies τ ∈ (ε, τ ∗), ε ∈ (0, τ ∗), where
τ ∗ =ln(v)
|Q|T
with v solution of
v(|Q|+ γT )− γTv1−1T − 2|Q| = 0
Then the NCS is Lp stable form w to (G(x), e) with linear gain. Naturally, equidis-
tant discretization in time can be regarded as a special case of networked control
described above. This means, that with a t < τ ∗ sampling time the system can be
safely discretized with a zero order hold function.
We remark that the sampling time need not to be constant as long as it is less
than the computed MATI. This means that the examined continuous time control
laws can be directly applied in discrete time in a network environment if the MATI
condition is satisfied.
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 30
3.3 Discretization of the angle controller
The mentioned paper [12] provides a method, how to compute τ ∗. The computation
is quite straightforward in case of linear systems and linear controllers but it can
be challenging in the case of nonlinear models. Now, the method is applied to the
discretization of the angle controller, described at section 2.3, that uses LQ-servo
control strategy.
3.3.1 Estimation of the sampling time
[13]At the following computations we assume, that
• zero order hold is at the controller output
• network or discretization induced error is simplified to e = y − y
• w = 0
The system model is:
xp = Apxp +Bpu
y = Cpxp
with feedback:
ut = Ky = KCxp
So the closed loop state equation is:
xp = (Ap +BpKCp)xp
We have the following error term
e(t) = y(t)− y(t) =⇒ y = e+ y
Then the actual state equation is
xp = (Ap +BpKCp)xp +BpKe
and the error dynamics is:
e = −y = −Cpxp = −Cp(Ap +BpKCp)xp − CpBpKe
NCS model form:
xp = Φ11x+ Φ12e
e = Φ21x+ Φ22e
Finding Q and y for the elementwise inequality:
g(t, x, e, w) = Qe+ y(x,w)
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 31
g(t, x, e, w) = Φ21x+ Φ22e
a good choice in the linear case is:
qij = max|[Φ22]ij|, |[Φ22]ji|
y = Φ21x
So the Lp gain γ should be computed for:
x = Φ11x+ Φ12e
y = Φ21x
Then we have to solve the equation:
v(|Q|+ γT )− γTv1−1T − 2|Q| = 0
and finally we get τ ∗ = ln(z)|Q|T .
In this case T = 4 and the Φ matrices are:
Φ11 =
0 1.00 0 0 0 0 0 0 0
−7.75 −4.14 0 0 0 0 9.28 0 0
0 0 0 1.00 0 0 0 0 0
0 0 −7.75 −4.14 0 0 0 9.28 0
0 0 0 0 0 1.00 0 0 0
0 0 0 0 −26.70 −10.33 0 0 35.35
−1.00 0 0 0 0 0 1.00 0 0
0 0 −1.00 0 0 0 0 1.00 0
0 0 0 0 −1.00 0 0 0 1.00
Φ12 =
0 0 0 0 0 0 0 0 0
−7.75 −4.14 0 0 0 0 9.28 0 0
0 0 0 0 0 0 0 0 0
0 0 −7.75 −4.14 0 0 0 9.28 0
0 0 0 0 0 0 0 0 0
0 0 0 0 −26.70 −10.33 0 0 35.35
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 32
Φ21 =
0 1.00 0 0 0 0 0 0 0
−7.75 −4.14 0 0 0 0 9.28 0 0
0 0 0 1.00 0 0 0 0 0
0 0 −7.75 −4.14 0 0 0 9.28 0
0 0 0 0 0 1.00 0 0 0
0 0 0 0 −26.70 −10.33 0 0 35.35
−1.00 0 0 0 0 0 1.00 0 0
0 0 −1.00 0 0 0 0 1.00 0
0 0 0 0 −1.00 0 0 0 1.00
Φ22 =
0 0 0 0 0 0 0 0 0
−7.75 −4.14 0 0 0 0 9.28 0 0
0 0 0 0 0 0 0 0 0
0 0 −7.75 −4.14 0 0 0 9.28 0
0 0 0 0 0 0 0 0 0
0 0 0 0 −26.70 −10.33 0 0 35.35
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
So we have
Q =
0 7.745 0 0 0 0 0 0 0
7.745 4.14 0 0 0 0 9.28 0 0
0 0 0 7.75 0 0 0 0 0
0 0 7.75 4.14 0 0 0 9.28 0
0 0 0 0 0 26.70 0 0 0
0 0 0 0 26.70 10.33 0 0 35.35
0 9.28 0 0 0 0 0 0 0
0 0 0 9.28 0 0 0 0 0
0 0 0 0 0 35.35 0 0 0
and γ = 122.91. That gives us τ ∗ = 1.4528e − 005. So with a minimum 670 kHz
sampling time the resulting discrete model will be stable.
3.3.2 Simulation results
The initial states of the angles are: Φ0 = −1.2, Θ0 = 1.5, Ψ0 = −1.1, the refer-
ences are zeros, respectively, same as at section 2.3 . Having the same controller, as
described in section 2.3, (LQ-servo controller), and sampling time 100 kHz (MAT-
LAB could not handle a smaller sampling time), we got following results: It can
be seen at 3.2 that there is essentially no difference between the performance of
the continuous (figure 2.7) and the discrete controller.
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 33
Figure 3.2: Angles and angular speeds controlled with LQ-servo controller,discrete case, sampling frequency 100 kHz
But the sampling time can not be increased arbitrarily, because if a lot bigger
sampling time is applied, then the estimated optimal bound, the controller can
loose lot from its performance. If the model is discretized with 5 kHz, the perfor-
mance of the controller slows down significantly, as it can be seen at 3.3, and under
1 KHz the controller becomes unstable.
Figure 3.3: Angles and angular speeds controlled with LQ-servo controller,discrete case, sampling frequency 5 kHz
It can be seen, that the MATI estimation is very sensitive to γ, the Lp gain
of the system. So to increase the sampling time, the parameters of the controller
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 34
must be reconfigured. Having the same controller, as above, but with different Q
and R matrices:
Q = 10−8 ·
20 0 0 0 0 0 0 0 0
0 20 0 0 0 0 0 0 0
0 0 20 0 0 0 0 0 0
0 0 0 20 0 0 0 0 0
0 0 0 0 20 0 0 0 0
0 0 0 0 0 20 0 0 0
0 0 0 0 0 0 8 0 0
0 0 0 0 0 0 0 8 0
0 0 0 0 0 0 0 0 8
R =
1 0 0
0 1 0
0 0 1
Using the matrices above to design the controller, a sampling time 0.0037 could
be achieved, which is more than 102 times better, than the one before. Using
the modified controller with the new sampling time, we got following simulation
results:
Figure 3.4: Angles and angular speeds controlled with LQ-servo controller,discrete case, sampling frequency 1 kHz
It can be seen at 3.4, that the controller got ’weaker’, so its performance became
slower, but the system could be indeed discretized with 1 kHz.
3.4 Discretization of the height controller in linear
case
In section 2.4 a linear controller can be seen, designed for the angle and height
stabilisation task. It could be seen, that this controller only works at angle values,
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 35
that are near zero. In this section, a discertization time will be estimated for this
controller, with the technique introduced at the section before.
3.4.1 Estimation of the sampling time
Making the same computations as above, with the controller settings used in section
2.4, the upper bound of MATI became 5 · 10−8. Matlab Simulink could not handle
the task with a sampling time like that, so the parameters of the controller needed
to be changed. The Lp gain of the closed loop with the controller form 2.4 was
4.7 · 106 which very high. Setting the matrices Q and R to the values as following:
Q = 0.01·
20 0 0 0 0 0 0 0 0 0 0 0
0 20 section0 0 0 0 0 0 0 0 0 0
0 0 20 0 0 0 0 0 0 0 0 0
0 0 0 20 0 0 0 0 0 0 0 0
0 0 0 0 20 0 0 0 0 0 0 0
0 0 0 0 0 20 0 0 0 0 0 0
0 0 0 0 0 0 20 0 0 0 0 0
0 0 0 0 0 0 0 20 0 0 0 0
0 0 0 0 0 0 0 0 8 0 0 0
0 0 0 0 0 0 0 0 0 8 0 0
0 0 0 0 0 0 0 0 0 0 8 0
0 0 0 0 0 0 0 0 0 0 0 8
R =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
we got γ = 8.5 · 105, and τ ∗ = 2.84 ∗ 107which means, that with 10 MHz the model
can be discretized.
3.4.2 Simulation results
Since τ ∗ computed above is only an estimation, simulations were tried with 10
kHz. Simulation has shown, as it can be seen at 3.5 that the performance of the
controller in discrete time was satisfactory, so there is no remarkable difference
between the behaviour of the continuous and discrete controller.
3.5 Discretization of the height controller in linear
bounded case
Applying the same computations using the controller described at section 2.5, τ ∗
became 0.020863. That means, that with 50 Hz the system can be discretized.
This very low sampling frequency can be explained with the input bounds that
were applied to the design of the controller. These bounds make the controller
’weaker’ in the sense that they do not allow the controller to create control inputs
with high norm. Therefore, the less aggressive the behaviour of the controller
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 36
Figure 3.5: Angles, angular speeds, forces and height controlled with linearLQ-servo control, discrete case, sampling frequency 10 kHz
is, the more the sampling time can be increased. The simulation results with a
sampling time of 50 Hz, can be seen at 3.6. These results are essentially the same,
as in the continuous case, seen at 2.9.
3.6 Discretization of the height controller in the case
of non-linear feedback
In the non-linear case, the necessary computations (and some estimations in par-
ticular) to compute the MATI are quite hard. Therefore the sampling times to the
controllers designed at section 2.6 and 2.7 will be examined only through simula-
tions. At section 3.3 it could be seen, that the angle controller must be ’weakened’
to get a better and easier to implement sampling time. So the LQ-servo angle
controller loop in the case of the non-linear height and position stabilisation will
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 37
Figure 3.6: Angles, angular speeds, forces and height controlled withbounded linear control, discrete case, sampling frequency 50 Hz
be designed with the following Q and R matrices:
Q = 10−6·
20 0 0 0 0 0 0 0 0 0 0 0
0 20 0 0 0 0 0 0 0 0 0 0
0 0 20 0 0 0 0 0 0 0 0 0
0 0 0 20 0 0 0 0 0 0 0 0
0 0 0 0 20 0 0 0 0 0 0 0
0 0 0 0 0 20 0 0 0 0 0 0
0 0 0 0 0 0 20 0 0 0 0 0
0 0 0 0 0 0 0 20 0 0 0 0
0 0 0 0 0 0 0 0 8 0 0 0
0 0 0 0 0 0 0 0 0 8 0 0
0 0 0 0 0 0 0 0 0 0 8 0
0 0 0 0 0 0 0 0 0 0 0 8
R =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
3.6.1 Simulation results
Simulation has shown that with 1000 Hz the height controller described, at section
2.6 can be discretized properly. It can be seen at 3.7, that there are no essential
differences compared to the results in the continuous case, seen at 2.10 besides,
that we use a ’weaker’ angle controller in this case to get a satisfactory sampling
time.
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 38
Figure 3.7: Angles, angular speeds, forces and positions with non-linearcontrol, discrete case, sampling frequency 1 kHz
3.7 Discretization of the position controller in non-
linear case
The controller examined here was described in section 2.7. In this case, the sam-
pling time was examined using simulations, too.
3.7.1 Simulation results
Simulation has shown that with 1000 Hz the system can be discretized properly. It
can be seen at 3.8, that there are no essential differences compared to the results
in the continuous case, seen at 2.13 besides, that we use a ’weaker’ angle controller
in this case to get a satisfactory sampling time.
But again, it needs to be mentioned, that the sampling time can not be in-
creased lot further. With sampling frequency lower than 100 Hz, the controller got
unstable. But at 3.9 it can be seen, that even with 100 Hz sampling frequency, the
controller keeps its robustness, so the simulation results show no essential difference
to the results of the continuous one, seen at 2.13.
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 39
Figure 3.8: Angles, angular speeds, forces and positions with non-linearcontrol, discrete case, sampling frequency 1 kHz
3.8 Robustness testing of the position controller un-
der Gaussian noise
Since the position controller incorporates all the designed controllers (angle and
height controller loops are also included in it), by testing the performance of this
construction the robustness of all control subsystems can be shown. The tests are
aim to prove that the non-linear height and position stabilizing loops hold their
performance even under significant noise in the sensor data.
During the simulation 100 Hz sampling frequency was applied. The angle sensor
data were corrupted with additive Gaussian white noise in the range of degrees
(between -3 and +3 degree), the height and position sensor data were added with
an Gaussian white noise in the range of centimetres (between -15 and +15 cm).
Figure 3.10 shows, that the controller maintains its robustness and performance.
CHAPTER 3. DISCRETE TIME ANALYSIS AND CONTROL 40
Figure 3.9: Angles, angular speeds, forces and positions with non-linearcontrol, discrete case, sampling frequency 100 Hz
Figure 3.10: Angles, angular speeds, forces and positions with non-linearcontrol, discrete case, sampling frequency 100 Hz, Gaussian noise appliedto sensor data
CHAPTER 4Summary and Conclusions
In this thesis various controllers were provided to stabilize angles, height and po-
sition of a quadrocopter. Each controller is ready for implementation, and an
appropriate sampling time was given for each either through an analytic estima-
tion or through simulations. The most meaningful achievement in this thesis is
the construction of a unique control strategy to the position stabilizing task. The
controller described combines linear and non-linear controllers in a non-linear back-
stepping based schema. That means, that to the tasks, where linear controllers can
be used, the easy to implement linear controllers can be kept, and to those parts,
that are more successfully handled with a non-linear controller, an appropriate
non-linear control loop can be designed. To the purely linear controllers, there is
a sampling time provided, which was estimated based on the sharpest estimation
technique known today [12]. To estimate a realistic sampling time with this tech-
nique is also considered as an achievement. That way it is proven, that with the
given sampling time, the closed loop system will keep its stability properties, and
its behaviour will not change significantly in discrete time.
4.1 Acknowledgement
At first place I would like to thank Gabor Szederkenyi, my supervisor for guiding
my studies for more than over a year, and for his attention and ideas. I would
also like to thank Gyorgy Cserey for giving me the idea to deal with the control
of a quadrocopter. And finally thanks to Alpar Sandor who built the quadro-
copter model in our robotic laboratory, and so made it possible to implement the
controllers in the future.
Bibliography
[1] Samir Bouabdallah, Design and control of quadrotors with application to au-
tonomous flying. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE
Phd thesis, 2007. [cited at p. 2, 3, 5]
[2] Ashfaq Ahmad Mian, Wang Daobo, Modeling and Backstepping-based Nonlin-
ear Control Strategy for a 6 DOF Quadrotor Helicopter. College of Automa-
tion Engineering, Nanjing University of Aeronautics and Astronautics, China.
Chinese Journal of Aeronautics, 2008. [cited at p. 2, 6]
[3] Pedro Castillo, Rogelio Lozano and Alejandro Dzul, Experimental implemen-
tation of linear and nonlinear control laws: Stabilization of a Mini Rotor-
craft with Four Rotors. IEEE Control Systems Magazine, December, 2005.
[cited at p. 2]
[4] Muriel Labadille, Non-linear Control of a Quadrotor. Cranfield University
School of Engineering, MSc Thesis, 2007. [cited at p. 2]
[5] Bruno Herisse, Tarek Hamel, Robert Mahony, Francois-Xavier Russotto, A
terrain-following control approach for a VTOL Unmanned Aerial Vehicle using
average optical flow. Springer Science+Business Media, LLC, 2010. [cited at p. 3]
[6] Srinivasan M., Zhang S., Chahl J. S., Barth E., Venkatesh S., How hon-
eybees make grazing landings on flat surfaces. Biological Cybernetics, 2000.
[cited at p. 3]
[7] Ian D. Cowling, Oleg A. Yakimenko, James F. Whidborne, Alastair K. Cooke,
Direct Method Based Control System for an Autonomous Quadrotor. Pub-
lished online, US Government, 2010. [cited at p. 2]
[8] P. Pounds, R.Mahony, P.Corke, Modelling and control of a large quadrotor
robot. Control Engineering Practice, Elsevier. 2010. [cited at p. 3]
[9] Guilherme V. Raffo, Manuel G. Ortega, Francisco R. Rubio, An integral pre-
dictive nonlinear H1 control structure for a quadrotor helicopter. Departa-
mento de Ingenierıa de Sistemas y Automatica, Universidad de Sevilla, Spain.
Control Engineering Practice, Elsevier. 2010. [cited at p. 3]
BIBLIOGRAPHY 43
[10] Sandor Alpar, Negyrotoros kishelikopter epıtese, iranyıtasa es kulonbozo szen-
zori adatok alapjan szabalyzassal torteno stabilizalasa. Pazmany Peter Kato-
likus Egyetem OTDK, 2007. [cited at p. 3, 5, 8]
[11] SAMIR BOUABDALLAH, PIERPAOLO MURRIERI, ROLAND SIEG-
WART, Towards Autonomous Indoor Micro VTOL. Springer Science + Busi-
ness Media, 2005. [cited at p. 6]
[12] Mohammad Tabbara, Dragan Nesic, Andrew R. Teel, Stability of Wireless
and Wireline Networked Control Systems. IEEE Transactions and automatic
control, vol. 52., NO.9 September 2007. [cited at p. 28, 30, 41]
[13] Gabor Szederkenyi, Katalin Hangos, Passivity based control and its use in the
stability and performance analysis of networked control loops. 9th International
PhD Workshop on Systems and Control 2008. [cited at p. 28, 30]
[14] Developped by Dr Johan Lofberg, downloaded from
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.HomePage
[cited at p. 18]
[15] K. M. Hangos, J. Bokor, G. Szederkenyi, Analysis and Control of Nonlinear
Process Systems. Springer, 2004. [cited at p. 19]
[16] P. Kokotovic and M. Arcak, Constructive Nonlinear Control: A Historical
Perspective. Automatica, 37:637-662, 2001. [cited at p. 22]
[17] W. N. Wonham, Linear Multivariable Control - A Geometric Approach.
Springer-Verlag, New York (Third Edition) 1985. [cited at p. 10]
[18] G. F. Wredenhagen, P. R. Belanger Piecewise-linear LQ control for systems
with input consternates. Automatica, 30:403-416, 1994. [cited at p. 17]
List of Figures
2.1 Schematic draw of the quadrocopter . . . . . . . . . . . . . . . . . . . 6
2.2 Quadrotor concept motion description, the arrow width is proportional
to propeller rotational speed. . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Model built in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Schema of the LQ-sevo controller . . . . . . . . . . . . . . . . . . . . . 11
2.5 The LQ-servo controller in Simulink . . . . . . . . . . . . . . . . . . . . 13
2.6 Angles and angular speeds controlled with a servo controller using pole-
placement technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.7 Angles and angular speeds controlled with LQ-servo controller . . . . . 15
2.8 Angles and angular speeds, inputs and height controlled with LQ-servo
controller using LQR technique . . . . . . . . . . . . . . . . . . . . . . 17
2.9 Angles and angular speeds, inputs and height controlled with LQ-servo
controller using bounded LQR technique . . . . . . . . . . . . . . . . . 19
2.10 Angles and angular speeds, inputs and height controlled with LQ-servo
and non-linear feedback input-output linearisation . . . . . . . . . . . . 21
2.11 Comparison of the linear and non-linear controllers in case of small,
near zero angles and small height reference . . . . . . . . . . . . . . . . 23
2.12 Comparison of the linear and non-linear controllers in case of large, near
zero angles and small height reference . . . . . . . . . . . . . . . . . . . 24
2.13 Angles and angular speeds, inputs and positions controlled with LQ-
servo and non-linear feedback input-output linearisation . . . . . . . . 26
2.14 Position curve of the quadrocopter . . . . . . . . . . . . . . . . . . . . 26
3.1 networked control system . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2 Angles and angular speeds controlled with LQ-servo controller, discrete
case, sampling frequency 100 kHz . . . . . . . . . . . . . . . . . . . . . 33
3.3 Angles and angular speeds controlled with LQ-servo controller, discrete
case, sampling frequency 5 kHz . . . . . . . . . . . . . . . . . . . . . . 33
3.4 Angles and angular speeds controlled with LQ-servo controller, discrete
case, sampling frequency 1 kHz . . . . . . . . . . . . . . . . . . . . . . 34
3.5 Angles, angular speeds, forces and height controlled with linear LQ-
servo control, discrete case, sampling frequency 10 kHz . . . . . . . . . 36
LIST OF FIGURES 45
3.6 Angles, angular speeds, forces and height controlled with bounded linear
control, discrete case, sampling frequency 50 Hz . . . . . . . . . . . . . 37
3.7 Angles, angular speeds, forces and positions with non-linear control,
discrete case, sampling frequency 1 kHz . . . . . . . . . . . . . . . . . . 38
3.8 Angles, angular speeds, forces and positions with non-linear control,
discrete case, sampling frequency 1 kHz . . . . . . . . . . . . . . . . . . 39
3.9 Angles, angular speeds, forces and positions with non-linear control,
discrete case, sampling frequency 100 Hz . . . . . . . . . . . . . . . . . 40
3.10 Angles, angular speeds, forces and positions with non-linear control,
discrete case, sampling frequency 100 Hz, Gaussian noise applied to
sensor data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40