Вы находитесь на странице: 1из 9

Identification and Validation of a Quadrotor’s Model Dynamics

Rui Miguel Martins de Oliveira


rui.oliveira@tecnico.ulisboa.pt
Instituto Superior Técnico
Formation Control for Unmanned Aerial Vehicles i
October 2014

Formation Control for Unmanned Aerial Vehicles


Abstract— The dynamic simulation of Unmanned Aerial in conjunction with a non-linear model to learn the errors.
Vehicles (UAVs) is an essential tool for the development Henrique Ribeiro of TheDelgado
experiments da were
Silvaperformed in a lab environment and
autonomous behaviors for these platforms. ISR & The goal
Instituto of this
Superior Técnico,itTechnical
was not affected
University by wind
of Lisbon, disturbances.
Portugal.
thesis is to identify a Quadrotor’s dynamics using a black-box henrique.ribeiro@ist.utl.pt
approach, allowing the development of a simulation platform. Currently, there is a motion capture system, Vicon 1 , which
It is aimed to stablish not only the physical model of the is based on multiple cameras with very high frame rates,
Abstract
quadcopter, but also to identify the stability controller and other capable of detecting short and sharp movements. There are
internal processes. In a robot team, one of the essential factors to achieve a cooperation
variety ofis its capacity to maintain
motivations to use any thisdesired
typegeometric
of system [5],
The first part ofconfiguration,
this thesisbypresents a quadrotor’s
using appropriate model, for the
control techniques
for relative poses between teammates. Formation control methods
example, to acquire high precision position and posture
must be robust
by defining its kinematics and toitsseveral types of as
dynamics, disturbances,
well as the so that the desired geometry is achieved. But, at the same time, it must
be flexible
development of control methods. enough to change its geometry, so that the teamdata
can of the
handle vehicle,
environment necessary
spacial for system
constraints (e.g., identification
moving from and
The second part,an open area to a narrow corridor). Artificial potential fields
describes the identification methods used, control methods,
validation. based on also
This system
the control method for formations of unmanned aerial vehicles (UAVs), specifically quadrotors.
harmonic functions
allows were chosenas
external control of the
firstly the Process Models, andpart
The first secondly
of this the
thesisGaussian concept of a vehicle
Processes.
presents the quadrotorthrough thedefining
vehicle, by data obtained. In [6],
its kinematics and ititsisdynamics,
used to perform
In the last part and
of also
thispresents
thesis, the
thestudy
results of the proposed
and development acrobatic
of several control maneuvers.
methods. Both implemented in Simulink. The second part
identification methods
firstlyare presented,
describes the panelfirstly
methodin a simulation
based on harmonic potential functions and lastly presents the formation control method
environment based with
on the quadrotor’s
UAVs. Finally, inmathematical model,
the last part of this thesisandthe results of flightII.
testsQwith a real quadrotor
UADROTOR M ODELare presented.
AND C ONTROL
afterwards applied to theUnmanned
Keywords: real system. Finally,Quadrotor,
Aerial Vehicles, after analyzing
Artificial Potential Fields, Formation Control, Rigid Formations, Dynamic Formations.
the results, the simulation platform is implemented. A. Definitions and Basis Concepts
Index Terms— Unmanned Aerial Vehicles, Quadrotor, Black- Tofunctions
describe the movement and 4attitude
1 INTRODUCTION is described and in Section presents of thethe quadrotor,
formations
Box Identification, Process Models, Gaussian Processes.
In recent years, the study of groups of multiple autonomous it’s necessary to define two coordinate systems [7]. The
control method with UAVs. Section 5 presents the results of the
first flight
Inertial Frame tests{I}
with aisreal quadrotor.
fixed and centered in OI with xI
robots, which exhibit cooperative behavior, has emerged and has
I. I NTRODUCTION
become a major area of research activities. The recent advancespointing in 2 QUADROTOR
towards North,MODEL y pointing towards West and z I
I
the miniaturization of sensors, actuators
In the last few years, technological innovation has been pointing and technology in gen-
eral, enabled the creation of distributed networks of robots for
2.1 upwards
Definitions and Basic
as shown Concepts
in Figure 1(a). The second frame,
growing significantly, namely such
several applications, in robotics, due tosurveillance,
as reconnaissance, its great search {B},Forisseveral
a moving
reasons, itreferential fixed to
is usually necessary onusethe quadrotor
different coordi- and
diversity and and
applicability
rescue or cargo in different
transportation areas. A particular
in cooperation. Obviously, nate systems [9],
centered in OB , when the working
center with aerial vehicles like a quadro-
of mass of the vehicle, with
these
field of robotics, is systems require
the aerial more complex
robotics, architectures
especially in order to dealB tor. To describe its movement and its attitude,Ba reference frame
Unmanned
with all the robots. x pointing
called Inertialtowards
Frame quadrotor’s
{I}, centered on OI , isy set pointing
front, on the groundtowards
Aerial Vehicles Different
(UAVs).approaches
For thiscangrowth contributed,
be classified according to fordifferent
quadrotor’s
and points right
towardsandNorth zB(xI ), West (y I )upwards
pointing and Up (z I as shown in
),as shown
example, size optimization
criteria. According of sensors andapproaches
to [1], these actuators, be classified into in Figure 1(a). A second frame {B} is fixed on the quadrotor and
canessential
Figure 1(b). Vectors B expressed ofinthethe inertial frame are
three groups: leader-following [2], behavioral [3],virtual structure centered on O , the center of mass quadrotor, thus called
factor for increasing the flexibility and usability of such marked with the superscript
[4]. Another possible criterion takes into account the rigidity of Body-Fixed Frame, shown in Figure 1(b). Vectors
I
and vector expressed
expressedininbody
vehicles in many applications.
the formation geometry:UAVs have([5])
some authors anspecify
extremely frame
the full geom- thehave
inertialtheframe are markedBwith
superscript . the superscript I andB vectors
varying application
etry anddomains that include
others [6] consider bothasindoor
the formation a dynamic andgeometry expressed in the body-fixed frame have the superscript .
structure.
outdoor applications. Some of those applications include
In this work, there is particular interest in the leader-follower
aerial surveillance, aerial
approach withphotography
flexible geometries, andie,video, monitoring
in the approach where there
is a leader
and traffic pattern whichmaintenance,
analysis, can be virtual, search followinganda predefined
rescue path,
and that brings with it his followers according to a geometry
([1]). previously defined, but that at can be modified at any moment
In order to correctly
to deal withcontrol
changes in this
the kind of vehicles, a very
environment.
good model of the Leonard
system and is
Fiorelli [7] introduced
required, the concept of artificial
and identification is a po-
tential fields between vehicles in formation. The major draw-
crucial step forback
theofdevelopment of these platforms.
this approach is the problem of local minima, which
Several
methods have maybeenprevent
proposed to identify
the group from never thereaching
UAVs’themodels,
desired forma-
(a) Inertial Frame (b) Body-Fixed Frame
for instance in tion.
[2], The harmonic
a Neural potentialwas
Network functions
used,were introduced
where input-by Kim
and Khosla [8]. These functions enable the creation of artificial
output data waspotential
provided from
fields withouta nonlinear
local minima simulation of a X-solution,
and with unique Fig. 1: Coordinate
Figure 1: ReferenceSystems
Frames. [8].
Cell 60 helicopter.
whichIn [3], them
makes a time domain
ideal for this system
work. identification
method was applied The remaining of this paper
in extracting a islinear
organized as follows: in Section
time-invariant The inertial frame is used to define the position of the quadro-
2 is presented the quadrotor model, which defines its kinematics Intor, the inertial
denoted Γ I =frame
[X, Y, Z]it
T is defined the position of the
, corresponding to the displacement
system model, andwhere the acquired model was used to
dynamics, and also presents the development of two control design quadrotor, e OB , andΓits
from OI denoted I attitude, that T
= [X, Y, Z]defines , thatthecorresponds
rotation of to
a feedback controller.
methods. In Section 3 the panel method, based on harmonic the body-fixed frame to theI inertial B
the displacement from O to O , and its attitude Θ = frame. In aeronautic liter- I
Gaussian Processes (GP) is a probabilistic framework [φ, θ, ψ]T , that defines the rotation of the body frame rela-
approach, which have been
Henrique R. D.applied
da Silva to the problem of system tively to the inertial frame. In the body frame April 2012 the
is defined
identification from training data. In [4], it was used to
identify and control a blimp. Here a GP model was used 1 Vicon motion capture: http://www.vicon.com/ [Consulted in 2014].
Formation Control for Unmanned Aerial Vehicles ii

linear velocity V B = [u, v, w]T , and the angular velocity B. Kinematics and Dynamics
B T
= [p,
ωature, q, r]angles
. 2.2 The
Kinematics
I
Euler
T
are used and the attitude is described by: Kinematics&ofDynamics
the quadrotor relate state variables on
= [φ, θ, ψ] are
ΘQuadrotors . The body-fixed
aircraft that frame is used towith
are equipped define theidenti-
four linear Thedifferent coordinate
kinematics frames.
and dynamics Equation
of the 1 relates
quadrotor can be de position
summa-
B T B
velocity, V = [u, v, w] , the angular velocity,
cal rotors in a cross configuration. BAs shown on Figure ω = [p, q, r]T ,
1(a),
the forces, usually named thrust, F = [Fx , Fy , Fz ]T , and the
rized
vector ΓI with (1-4)
in equations in accordance
the linear [9]: V B , and equation 2
velocitytovector
the blades are paired and each pair rotates in a different di-
torques of the vehicle, τ B = [τx , τy , τz ]T . relates the attitude vector ΘI with the angular velocity vector
rection. Motorshave (1) four
and (3) have rotors,
a counter-clockwise Γ̇ I = RΘ V B (1)
each of them isrotation,
B
Quadrotors identical respon- ω .
and
siblemotors (2) and
for a certain (4) of
amount have
forceclock-wise
and torque rotation.
around itsAlthough
center of
rotation. As shown Θ̇ I = TΘ ω B (2)
the quadrotors haveonsix Figure 1, theof
degrees propellers
freedomare(DOF),
paired and
theyeachare
pair rotates in a different direction. Motors (1) and (3) have to a Γ̇I = RΘ V B (1)
only equipped with four propellers, so it is not possible
counter-clockwise rotation when looked from above whilst motors F B = m(V̇ B + ω B × V B ) (3)
control all the 6 DOF, but only 4. However, thanks to its
(2) and (4) have a clockwise rotation. Since the quadrotor is an Θ̇I = TΘ ω B (2)
structure, it is trivial
underactuated system,to ie,chose
althoughtheitvariables
is a system towith
control.
6 DOF These
1
, it τ B
= I ω̇ B + ω B × (Iω B ) (4)
four
onlyvariables
has 4 motors,correspond to the
so it is not four to
possible basic movements
directly of the
control all the In these equations, RΘ is the rotation matrix and TΘ is
6 DOF, which
vehicle, but only 4. However,
allow to reachdue to the vehicle
a desired altitudestructure, it is
and attitude. Equations (1) and (2) represent the kinematics of the vehicle
the transformation matrix, defined as:
relatively
To obtain simple to choose thethe
these movements, variables
angular to speed
be controlled. These
of the motors and relate state variables on different coordinate frames. Equa-
variables correspond to T the four basic movements which enable tion 1 defines the linear movement of the quadrotor as the deriva-
Ω = [Ω1 , Ω2 , Ω3 , Ω4 ] are adjusted (Figure 2). It follows the
the vehicle to reach a certain altitude and attitude (Figure 2).To 
tive of the position

description of these movements:
obtain this maneuvers the speed of each motor is adjusted. The
cψ cθandcequation (2) definessψthe
ψ sθ sφ − sψ cφ cφ angular
+ cψ sθ velocity

as derivative of
angular speeds of the motors are written Ω = [Ω1 , Ω2 , Ω3 , Ω4 ]T . RΘ = sattitude.
ψ cθ cψ cφ + sψ sθ cφ sψ sθ cφ − cψ sφ  (3)
Equations (3) and (4) represent the dynamics of the vehicle.
−s
Both equations wereθ derived fromcθ sφNewton’s second cθlaw
cφ and relate
the forces and moments applied  with state variables  of the vehicle.
The relation between these forces1 sand φ tθmoments
cφ tθ with the angular
velocity of the motors TΘis =
shown
0 in equations
cφ −s(5)
φ
-(7). (4)
  
0 sφ /cθ cφ /c
θ  
(a) (c) (e) (g) Fx 0 0
In the 
previous  T 
 equations   notation
the following  
F B =  Fy      +  0  has(5)been
 0 et ≡
 =  sRΘ≡ sin(k)
adopted:ck≡ cos(k),  
tan(k).
k k
The dynamics −mgcan be described
Fz of the quadrotor U1 in equa-

tions (5-6), using Newton’s  
τx secondU2law:
   
(d) (f) (h) τB =   
 τy B = BU3 
 (6)
(b)
F = mV̇ + ω × (mV B )
B
(5)
τz U4
Positive Thrust Negative Pitch   B 2B 2 B 2 
Negative Thrust Positive Pitch
U1 τ = b(Ω I ω̇1 ++Ωω 2 +Ω + Ω24B))
×3 (Iω (6)
   
Negative Roll Negative Yaw  U2   b l(Ω24 − Ω22 ) 
   
Positive Roll Positive Yaw
where m[Kg]
 is = mass of the quadrotot and
the  I[N.m.s(7)2 ] is
 U3   b l(Ω23 − Ω21 ) 
   
the inertia matrix, which is considered diagonal due to the
Fig. 2: Figure 2: Basic Maneuvers [10].
Quadrotor Basic Movements [9]. d(Ω22 + Ω24 + Ω21 + Ω23 )
symmetry ofUthe4 vehicle.
• Thrust - U1 [N ] - This maneuver is obtained by equally In The
theseprevious
equationsequations
RΘ is the relate
rotationthe
matrix andand
forces TΘ moments
is the
augmenting or diminishing the angular speed of all motors, transformation
applied withmatrix,
state which are defined
variables of theas:vehicle. The relation
• Thrust [N ]: 2(a) and (b).
U1Figure
as shown- on  
between these cψforces
cθ cψand
sθ sφ moments
− sψ cφ swith
ψ sφ +the
cψ sangular
θ cφ velocity
• The
Roll vertical
- U2 [N.m]movement is obtained
- The roll motion by increasing
corresponds (or
to a rotation of the 
motors are shown in equations (7-9). 
decreasing) all the propeller B R = s c
Θ  ψ θ c c +s s s
ψ φ s s c −c s 
ψ θ φ ψ θ φ ψ φ 
of the quadrotor around the xspeeds by the
axis and same amount
is obtained when
Ω2 shown
as increases
on(or decreases)
Figure 2(a) eand(b).Ω4 decreases (or increases). −sθ F
  c s
0 cθ cφ
   
B x
θ φ

0 (8)
This -maneuver
• Roll U [N.m]: is shown on Figure 2(c) and (d).
2 F 1= sF φ tyθ =cφtθR−1  0  +  0  (7)
• The Θ
Pitchroll 3 [N.m] - The
- Umovement pitch motiontocorresponds
corresponds a rotationtoofa ro-
the  
tation of the quadrotor B
Babout the y and is obtained when TΘ = 
 0
F
cφz −sφ  
−mg U1
quadrotor about the x axis, it is obtained by increasing
Ω1 increases (or decreases) and Ω3 decreases (or increases). 0 sφ /cθ cφ /c
(or decreasing) Ω2 and by
This maneuver is shown
decreasing (or increasing) Ω4 .
on Figure 2(e) and (f). τx
  
U2
θ
This movement is shown on Figure 2(c) e (d). where ck ≡ cos k, sk ≡ τ Bsin ke t
= τ k ≡
= tan
U3k. The inertia ma- (8)
• Yaw - U4 [N.m] - The yaw motion corresponds to a rotation y
• Pitch - U3 [N.m]: trix I[N.m.s2 ] is diagonal due to the symmetry of the quadrotor,
of the quadrotor about the z B and is obtained when the pair τz U4
−2
The
Ω1 - pitch movement
Ω3 increases corresponds
(or decreases) and Ωto2 -a Ωrotation the m[Kg] is the mass of the quadrotor, g[m.s ] is the gravitational
of (or
4 decreases
acceleration l[m]is the
 distance between the center of the  quadro-
quadrotor
increases). about the y B axis,
This maneuver it is obtained
is shown on Figureby increasing
2(g) and (h). 
b(Ω21 + Ω222+ 2
Ω24 ) coefficient
tor and the centerUof1 a propeller, b[N.s ] isΩthe
3 +thrust
(or decreasing)
1 Degrees Ω1 and by decreasing (or increasing) Ω3 . and d[N.m.s2 ] isU bl(Ω24 − Ω22 )
 the
2 moment
Of Freedom   coefficient. 
This movement is shown on Figure 2(e) e (f). U3  =  2 2 (9)
 
bl(Ω3 − Ω1 ) 
• Yaw - U4 [N.m]:
Henrique R. D. da Silva U4 d(Ω22 + Ω24 − Ω21 − Ω23 )April 2012
The yaw movement corresponds to a rotation of the
quadrotor about the z B axis, it is obtained by increasing where g[m.s−2 ] is the gravitational acceleration, b[N.s2 ]
(or decreasing) the pair Ω1 − Ω3 and by decreasing (or is the thrust coefficient, d[N.m.s2 ] is the drag coefficient and
increasing) the pair Ω2 − Ω4 . This movement is shown l[m] the distance between the center of the propeller and the
on Figure 2(g) e (h). center of the quadrotor.
C. Control It is now possible to write the three controllers in the
In this section are presented two controllers, that will Laplace domain:
be implemented in the simulator which is based on the
theoretical model of the quadrotor, and which will allow a
  
Kiφ
first phase of tests of the proposed identification methods. U2 = Kpφ + eφ (s) − sKdφ φ .Ixx
s
In this thesis it is used a modified Proportional-Integral-
Derivative (PID) controller, because the traditional PID struc-   
Kiθ
ture presents a drawback. A sharp movement can saturate U3 = Kpθ + eθ (s) − sKdθ θ .Iyy
the actuators and push away the system from a linear zone s (13)
[10]. For this reason, the PID architecture shown in Figure
Kiψ̇
  
3, presents the derivative action of the system output. This
modified PID structure can be written according to the U4 = Kpψ̇ + eψ̇ (s) − sKdψ̇ ψ̇ .Izz
s
equations:

Kp 2) Position Control: Figure 5 shows the architecture of


the position control.
t
e (t ) + u (t )
r (t ) +
-
Ki ∫ .dt
0
+
-
System y (t )

d
Kd
dt Ω1
Ω2
Outer Loop Inner Loop
Ω3 Quadrotor Model
Controller Controller
Fig. 3: PID Modified Structure. Ω4

Z t
d
u(t) = Kp e(t) + Ki e(τ )dτ − Kd y(t) (10) Fig. 5: Position Control.
0 dt

It can be seen from the figure that there are two controllers:
Inner Loop Controller and Outer Loop Controller. The first
Ki one is constituted by the stability and altitude control (Z).
u(s) = (Kp + )e(s) − sKd y(s) (11)
s The second one controls de horizontal position (X, Y ). In the
1) Stability Control: Figure 4 shows the architecture of Outer Loop Controller the pitch and roll angles are used to
the stability control. control position in xI and y I . Assuming hovering conditions
as before, and according to [11] and [12], by linearizing
Ω1 equation 1 one obtains the equations used in control:
Ω2
Remote
Control
Controller Ω3 Quadrotor Model 
Ω4  Ẍ
 = θr cψ + φr sψ
1
Ÿ = θr sψ − φr cψ (14)
 U1
 Z̈ = −g + (cθ cφ )
m
Fig. 4: Stability Control. It is now possible to write the two Outer Loop controller
in the Laplace domain:
It can be seen in the figure, that this controller is associated
with a remote control as will later be used in the simulator.
 
Ki
Since we want the quadrotor to work near hovering con- Ẍ = KpX + X eX (s) − sKdX X
s
ditions (θ ≈ 0◦ and φ ≈ 0◦ ), the Coriolis effects can be
neglected, and by substituting equation 8 in equation 6, one
  (15)
Ki
obtains the equations used in control: Ÿ = KpY + Y eY (s) − sKdY Y
s

U2

 φ̈ =



 I xx and the last Inner Loop Controller:
 U3
θ̈ =
"  #
(12) KiZ
 
m

 Iyy U1 = K( pz ) + eZ (s) − sKdZ Z + g .

 U4 s cφ cθ
 ψ̈ =


Izz (16)
III. Q UADROTOR I DENTIFICATION Black-Box
Model
A. Black-Box Identification
Roll
When a process is too complex to be described by some Dynamics

idealized physical laws or there is not enough information


available, it is usual to resort to the black-box identification.
Pitch
The black-box identification dispenses knowledge of physical Dynamics

or chemical laws and is based only on the relationship


between the input and the system output.
Yaw Rate
In this work it was used a black-box identification, because Dynamics

one of the goals is to make the identification of a quadrotor,


where some internal processes of the vehicle are unknown, Thrust
1 1
for example, the PID structure used in the stability control. Dynamics

The typical design cycle during a system identification


(Black Box Identification) involves two tasks: the identifica-
Fig. 7: Quadrotor Black-Box Model.
tion of a model and its validation[13](Figure 6). Hence, two
data sets are necessary, one to identify and one to validate.
start simplicity. The structure of a process model is a simple
continuous-time transfer function that describes linear system
Identification
dynamics in terms of one or more of the following elements:
experiments • Static gain Kp - characterize the sensitivity of the
validation
output to the input signal.
System model
• Time delay Td - Time before the system output
Fig. 6: Typical design cycle responds to the input(dead time).

Experiment design is an important step in identification, • Time constant Tp - Characterize the speed of response
in which it is decides which signals to measure, and in of a system. It is a measure of the time necessary for a
which the input signals are selected. The next step is data process to adjust to a change in the input.
acquisition, the actual collection of the data needed for In this thesis it was used the System Identification
identification, and model selection. After identification, a ToolboxTM [15] of the Matlab R
software, to run the Process
validation is needed, where a comparison is made between Models, which allows the user to create different types
the obtained model and the real system. A new input signal is of transfer functions to approximate the system dynamics.
applied to both and their outputs are compared. One way to Figure 8, shows the graphical environment of the toolbox.
compare the result of two identification methods, is applying
the root mean square error:
r Pn
2
i=1 (ŷi − yi )
RM SE = (17)
n
The method that presents a lower RMSE value may be
considered more effective. In the case of obtaining similar
values, it is necessary to resort to other types of analysis,
such as the computational load of each method.
To apply the black-box identification to the quadrotor, it
is essential to identify the system inputs. Since the vehicle
is maneuvered by remote control, the system inputs are the
commands sent. In the case of the quadrotor, used in the
thesis, the signals sent by the remote control are the desired
roll angle φr , the desired pitch angle θr , the desired yaw
angle rate ψ˙r and the thrust U1 . Therefore, the system can
be decoupled into four subsystems which will be identified Fig. 8: Process Models of the System Identification
separately [14](Figure 7). ToolboxTM .

B. Process Models As mentioned before, the goal is to identify the vehicle


Process models (PM) are popular for describing system by decoupling its dynamics into four subsystems, which
dynamics in many industries and apply to various produc- will be identified separately. Roll, pitch and yaw angle rate
tion environments. The advantages of these models is their dynamics are approximated with a 1st order system and a
N
Based on a set of N training data pairs, xi , y i i=1 , the

delay element, while the thrust dynamics is approximated
with a static gain. Figure 9 shows a sketch of the architecture goal is to find the predictive distribution of y ∗ corresponding
of the simulator, where the four dynamics are associated to to a new given input x∗ . We can write:
equation 1 for calculating accelerations.  
y
∼ N (0, KN +1 ), (21)
y∗
Black-Box Simulator
Model with covariance matrix:

1+ 1
   
 K  k(x∗ )

1+
 
1
1 = (sin( sin( + cos( sin( cos( KN +1 = (22)
 
1 1
1
Γ$

= (−cos( sin( + sin( sin( cos(
 
1
! = −" + (cos( cos(
h i 
1
T ∗


1+
k(x∗ ) k(x )
1

where y = [y 1 , ..., y N ]T is an N ×1 vector of training targets,


1
1 k(x∗ ) = [C(x1 , x∗ ), ..., C(xN , x∗ )]T is the N × 1 vector of
covariances between training inputs and the test input and
k(x∗ ) = C(x∗ , x∗ ) is the autocovariance of the test input.
Fig. 9: Process Models Simulator Architecture. We can divide this joint probability into a marginal and a
conditional part. The marginal part gives us the likelihood of
the training data: y|X ∼ N (0, K), where X is the N × D
C. Gaussian Processes matrix of training inputs.
Gaussian Processes (GP) is a powerful, non-parametric The unknown hiperparameters of the covariance function,
tool for regression. A GP is a Gaussian random function, as well as the noise variance v0 , can be estimated by
fully characterized by its mean and covariance function. GP maximization of the log-likelihood [17]:
can be viewed as collection of random variables which have a
joint multivariate Gaussian distribution: f (x1 ), ..., f (xn ) ∼ 1 1 N
L(Θ) = log(p(y|X)) = − log(|K|)− yT K−1 y− log(2π),
N (0, Σ), where Σpq gives the covariance between f (xp ) 2 2 2
(23)
and f (xq ) and is a function of the corresponding xp e xq :
where Θ = [w1 , ..., wD , v0 , v1 ] is the vector of parameters
and K is the N × N training covariance matrix. The
Σpq = C(xp , xq ) (18) optimization requires the computation of the derivatives of
L with respect to each of the parameters:
The covariance function C(., .) can be of any kind, pro-
viding it generates a positive definite covariance matrix.  
∂L(Θ) 1 −1 ∂K 1 ∂K −1
Assuming a stationary process [16], a common choice of = − trace K + yT K−1 K y
covariance function is the squared exponential: ∂Θi 2 ∂Θi 2 ∂Θi
(24)
" # This involves the computation of the inverse of the
D covariance matrix K, which can become computationally
p q 1X p q 2
C(x , x ) = v1 exp − wd (xd − xd ) , (19) demanding for large N . In this thesis it was used the Guas-
2
d=1 sian Process Regression and Classification Toolbox 2 , which
Where D is the length of vector x and v1 , w1 , ..., wd are allows to choose the desired covariance matrix, and given a
free parameters, usually called hyperparameters. Typically, training data set it is possible to estimate the parameters Θ.
covariance functions are chosen so that points close together After optimizing the covariance function hiperparameters,
in the input space are more correlated than points far apart. it is possible to obtain a prediction of the GP model for a
The parameter v1 controls the magnitude of the covariance new input x∗ . The conditional part of equation 21 gives the
and hyperparameters wd represent the relative importance of predictive distribution of y ∗ :
each component xd of the vector x. p(y, y ∗ )
The training set T = (x1 , y 1 ), (x2 , y 2 ), ..., (xN , y N ) is p(y ∗ |y, X, x∗ ) =

(25)
p(y|X)
assumed to be drawn from the noisy process:
it can be shown that this distribution is Gaussian with mean
i i and variance[17]:
y = f (x ) + , (20)
T
where xi is an input vector in RD and y i is a scalar output µ(x∗ ) = k(x∗ ) K−1 y (26)
in R. The noise term  is drawn from N (0, v0 ). Within 2 Guassian process regression and classification toolbox:
this probabilistic framework, we have y 1 , ..., y N ∼ N (0, K), http://www.gaussianprocess.org/gpml/code/matlab/doc/ [Consulted in
with K = Σ + v0 I, where I is the N × N identity matrix. 2014].
T
σ 2 (x∗ ) = k(x∗ ) − k(x∗ ) K−1 k(x∗ ) + v0 Black-Box Simulator
(27) Model

Z-1 PG
The equation 26 is new prediction for a new input, and Z-2
Z-1
Z-2
equation 27 is the uncertainty of the prediction.
Z-1 PG
The goal is to use the GP to model dynamic systems. Z-2
Z-1 = (sin( sin( + cos( sin( cos(
1

1 1
1
Given the model of equation 20, where: 1
= (−cos( sin( + sin( sin( cos( Γ
Z-2

1
Z-1 PG = − + (cos( cos(
-2
Z
Z-1
Z-2
x(t) = [y(t − 1), y(t − 2), ..., y(t − L), u(t − 2), ..., u(t − L)] ,
1 1
(28) Z-1
Z-2
PG
Z-1
is the state vector at t, composed of the previous outputs y Z-2

and inputs u, up to a given lag L.


The task is to model the dynamic system using GP,
Fig. 11: Gaussian Process Simulator Architecture.
in order to make multiple-step ahead prediction. One way
Simulator
to do multiple-step ahead predictions is to make one-step
predictions iteratively by feeding back the predicted output Task

Pilot ~= 0 Task
RCInput
(Figure 10). Constant
Switch State Vector
Omega

Stability Control

In1 Out1
( )
State Vector' State Vector StateVector Omega Vector
Rate Transition1
( − 1)
Ζ -1
Position Control Sensors
Dynamics
Rate Transition2

.. State Vector
.
( − ) Gaussian Process ( ) 3D View

Ζ -L
Model State Vector

Data

Fig. 12: Simulator Architecture

( − 1)
Ζ -1
V. E XPERIMENTAL P LATFORM
( − 2) The vehicle in which it is intended to identify the system,
Ζ -2
is a quadrotor developed by UAVision 3 R
company. It was
..
. acquired the model UX-4001 Mini (Figure 13).
( − )
Ζ -L

Fig. 10: Gaussian Process Model Dynamic System Identifi-


cation

In the case of the dynamics of the quadrotor, the GP model


is used for modeling each one of the subsystems. It was used
the value L = 2, because for higher values there weren’t Fig. 13: Quadrotor UX-4001 Mini[18].
relevant improvements. Figure 11, shows a sketch of the
architecture of the simulator using GP.
A. Motion Tracking
IV. S IMULATION P LATFORM To enable the acquisition of the position and attitude of
In order to test the proposed identification methods, a the quadrotor with high precision, it was used the Motion
simulator based on the mathematical model of the quadrotor Tracking of the Biomechanics Laboratory of Lisbon4 . This
was created. This simulator was implemented and modified lab is equipped with 14 infra-red cameras Qualisys ProReflex
from [8], using Simulink R
tool from the Matlab R
software. MCU 500/1000. For the data acquisition, a frequency of 100
Figure 12 shows the architecture of the created simulator. Hz and five markers were used. The disposition of the five
It was used the option for manual flight, using the joypad markers is shown in Figure 14.
from the RCInput block. Four flights were made to identify After data collection, it is necessary to estimate the attitude
the dynamics of each subsystem and a flight was made for and position of the vehicle. Determining the relationship
testing and validation. The results obtained in simulation between two coordinate systems through the use of sets
allowed to assess the methods of identification before being 3 Uavision: http://www.uavision.com, [Consulted in 2014].
applied to the real vehicle, and both methods have shown 4 Motion tracking: http://lbl.tecnico.ulisboa.pt/Resources [Consulted in
great efficacy in a simulation environment. 2014].
φ = atan2(r32 , r33 )
p
θ = atan2(−r31 , 2 + r2 )
r32 (37)
33

Fig. 14: Five Markers Disposition. ψ = atan2(r21 , r11 )

B. Results
of corresponded features measurements is known as the The procedure used was similar to that used in the
absolute orientation problem. Given two corresponding point simulation. It was acquired two distinct data sets, one for
sets {mi } e {di }, i = 1, ..., N , such that they are related by: system identification and the other to make predictions and
validate the model. Figures 15-18 , shows the error between
di = Rmi + T + Vi , (29) the two models predictions and the real values.

where R is the 3 × 3 Rotation matrix, T is the translation 0.1


GP Error
vector and Vi a noise vector. To obtain the optimal trans- 0.08
PM Error

formation [R̂, T̂], that maps de set{mi } in {di }, requires 0.06


minimizing a least squares error criterion given by:
0.04

N
X 2 0.02

Σ2 = di − R̂mi − T̂ (30)

Error [rad]

0

i=1
-0.02

To estimate the rotation matrix R̂, the point sets {mi } and -0.04

{di } shoud have the same centroid. By defining: -0.06

1 PN -0.08
d¯ = di , dci = di − d¯
N i=1 -0.1
0 5 10 15 20 25 30 35 40 45 50 55
(31) Time [s]

1 PN
m̄ = mi , mci = mi − m̄ Fig. 15: Roll error GP vs PM.
N i=1
Equation 30 can be rewritten and reduced to:
0.1
2 GP Error

2
PN PM Error
Σ = i=1 di − R̂mi
0.08

PN (32)
T T T 0.06
= i=1 (dci dci + mci mci − 2dci R̂mci )
0.04

This equation is minimized when the last term is maxi- 0.02


mized, which is equivalent to maximizing Trace(R̂, H) [19],
Error [rad]

0
where H is the correlation matrix defined by:
-0.02
N
X
mci dTci
-0.04
H= (33)
-0.06
i=1

If the singular value decomposition of H is given by -0.08

H = UΛVT , then the rotation matrix, R̂, that maximizes -0.1


0 5 10 15 20 25 30 35 40 45 50 55
Time [s]
the desired trace is [19]:
Fig. 16: Pitch error GP vs PM.
R̂ = VUT (34)
and the translation is given by: One way to evaluate and compare the identification meth-
ods used, is using the root mean square error. Table I, shows
T̂ = d¯ − R̂m̄ (35) the root mean square error of both methods for each variable
prediction.
The attitude angles can be obtained from estimated rota-
tion matrix. Considering the generic matrix: RMSE
  Method Roll (rad) Pitch (rad) Yaw rate (rad.s−1 ) Thrust (N )
r11 r12 r13 GP 1.84 × 10−2 1.95 × 10−2 7.42 × 10−2 2.62 × 10−1
R = r21 r22 r23  (36) PM 1.72 × 10−2 1.73 × 10−2 7.42 × 10−2 6.10 × 10−1
r31 r32 r33
TABLE I: Predictions Root Mean Square Error.
The attitude angles are given by:
2
GP Error GP Error
0.25 PM Error PM Error
1.5
0.2

0.15 1

0.1
0.5
0.05
Error [rad.s-1]

Error [m.s -2]


0 0

-0.05
-0.5
-0.1

-0.15 -1

-0.2
-1.5
-0.25

0 5 10 15 20 25 30 35 40 45 50 55 -2
5 10 15 20 25 30 35 40 45 50 55
Time [s] Time [s]

Fig. 17: Yaw rate error GP vs PM. Fig. 19: X Acceleration error GP vs PM.
3
GP Error 2
PM Error GP Error
PM Error

2 1.5

1
1

0.5
Error [N]

Error [m.s -2]


0
0

-0.5
-1

-1

-2

-1.5

-3
5 10 15 20 25 30 35 40 45 50 55 -2
5 10 15 20 25 30 35 40 45 50 55
Time [s]
Time [s]

Fig. 18: Thrust error GP vs PM. Fig. 20: Y Acceleration error GP vs PM.

It can be observed from the data that for both methods, In the case of the acceleration in the z, the Gaussian Process
the predictions of roll, pitch and yaw dynamics approximates model shows a better result. This result matches the fact that
quite well the real quadrotor behaviour. Concerning the thrust the prediction of the thrust is better using this method. The
prediction, the Gaussian process is more effective. thrust prediction is more prevalent in the calculation of the
C. Validation acceleration in z axis than in the other axes.

To validate the simulator architecture presented in


chapterIII, it is not enough to analyse the dynamics predic- D. Final Simulator
tions. To make the complete validation of the model, it is The development of the final simulation platform, which
necessary to compare the real accelerations with accelera- simulates real quadrotor behaviour, was based on the ob-
tions calculated with the predictions. Figures 19-21 , shows tained results. Since the Gaussian processes have a high
the error between the real accelerations and the two models computational burden, it was chosen to do a combination
predictions. of the two methods. Thus it was used Process Models to
Again it will be used the root mean square error to make prediction of the roll, pitch and yaw rate dynamics
compare the methods. Table II shows the root mean square and Gaussian Process to make thrust predictions.
errors for the accelerations for both methods. In the implementation of the simulator, it was used again
RMSE (m.s−2 ) the Simulink R
tool. Figure 22 presents the final architecture
Method x Acceleration y Acceleration z Acceleration of the simulator. Where the block Dynamics has the structure
GP 2.68 × 10−1 1.89 × 10−1 1.82 × 10−1 presented in the chapter III.
PM 2.13 × 10−1 1.94 × 10−1 3.96 × 10−1
The implemented simulator was tested by regular drivers
TABLE II: Accelerations Root Mean Square Errors. of the actual vehicle, and the feedback was very positive,
being the flight sensations of the simulator quite similar
to the real quadrotor. The only negative aspect was that
It can be observed from the data that both methods do a the simulator is controlled via a joypad and has a different
good approximation of the acceleration in the x and y axis. sensitivity compared to the remote control of the vehicle.
2
GP Error
PM Error
B. Future Work
1.5
As future goals, the final platform developed can be tested
1 in closed loop. For this, it is necessary to introduce more
processing power on the vehicle to be able to estimate the
0.5
global position.
Error [m.s -2]

0 Another improvement that may be made is to replace the


joypad from the simulator with the remote control of the
-0.5
quadrotor, allowing a comparison between flight sensations
-1 of simulator and the real system more accurately. This
-1.5
substitution also allows inexperienced people to have a first
contact in maneuvering a quadrotor before moving to the
-2
5 10 15 20 25 30 35 40 45 50 55 actual vehicle.
Time [s]

Fig. 21: Z Acceleration error GP vs PM. R EFERENCES


[1] R. Mahony and V. Kumar, “Aerial robotics and the quadrotor [from
the guest editors],” Robotics & Automation Magazine, IEEE, vol. 19,
no. 3, pp. 19–19, 2012.
Task RCInput Pred Pred [2] I. E. Putro, A. Budiyono, K.-J. Yoon, and D. Kim, “Modeling of un-
manned small scale rotorcraft based on neural network identification,”
RCInput 3D View
Dynamics in Robotics and Biomimetics, 2008. ROBIO 2008. IEEE International
Conference on. IEEE, 2009, pp. 1938–1943.
Fig. 22: Final Simulator. [3] D. H. Shim, H. J. Kim, and S. Sastry, “Control system design for
rotorcraft-based unmanned aerial vehicles using time-domain system
identification,” in Control Applications, 2000. Proceedings of the 2000
IEEE International Conference on. IEEE, 2000, pp. 808–813.
VI. C ONCLUSIONS AND F UTURE W ORK [4] J. Ko, D. J. Klein, D. Fox, and D. Haehnel, “Gaussian processes and
reinforcement learning for identification and control of an autonomous
blimp.” in ICRA, 2007, pp. 742–747.
A. Conclusions [5] C. H. Chamberlain, “System identification, state estimation, and
control of unmanned aerial robots,” Master’s thesis, Brigham Young
University, 2011.
In this thesis, two methods have been proposed to perform [6] S. Lupashin, A. Schollig, M. Sherback, and R. D’Andrea, “A simple
de identification of the quadrotor’s system dynamics, which learning strategy for high-speed quadrocopter multi-flips,” in Robotics
allowed the development of a platform that simulates the real and Automation (ICRA), 2010 IEEE International Conference on.
IEEE, 2010, pp. 1642–1648.
behaviour of the vehicle. This platform allows a first phase [7] T. Bresciani, “Modelling, identification and control of a quadrotor
of tests on new developments before they are implemented helicopter,” Master’s thesis, Lund University, 2008.
in the real quadrotor. [8] H. R. D. da Silva, “Controlo de formações de veı́culos aéreos não
tripulados,” Master’s thesis, Instituto Superior Técnico, 2012.
To achieve the proposed objectives, it was necessary to [9] S. Bouabdallah, M. Becker, and V. De Perrot, “Computer obstacle
develop the dynamics and kinematics of the vehicle, as avoidance on quadrotors,” in Proceedings of the XII International
well as control methods. Two types of controllers were Symposium on Dynamic Problems of Mechanics, 2007.
[10] E. J. Morgado, Controlo de Sistema Dinâmicos - uma Introdução -,
implemented, the stability control and the position control. 2007.
Through the mathematical model presented, it was pos- [11] D. Mellinger, N. Michael, and V. Kumar, “Trajectory generation
and control for precise aggressive maneuvers with quadrotors,” The
sible to create a simulator that allowed the test of the International Journal of Robotics Research, 2012.
proposed identification methods, before being applied to the [12] H. Bolandi, M. Rezaei, R. Mohsenipour, H. Nemati, and S. M.
real vehicle.The architecture of the simulator is similar to the Smailzadeh, “Attitude control of a quadrotor with optimized pid
controller,” Intelligent Control and Automation, vol. 4, p. 335, 2013.
system to identify, receiving the same commands through a [13] R. Smith and H. Koeppl, “Lecture 1: Introduction to System Identifi-
joypad, and equipped with a stability controller. cation,” Setembro 2011.
For the identification of the quadrotor’s system dynamics, [14] R. Andreas, “Dynamics identification & validation, and position
control for a quadrotor,” Master’s thesis, Swiss Federal Institute of
it was used a black-box approach by applying two methods: Technology Zurich, 2010.
Process Models and Gaussian Processes. The Process Models [15] L. Ljung, “System identification toolbox,” The Matlab user’s guide,
are a simpler approach, which approximates the dynamics of 1988.
[16] J. Kocijan, “Gaussian process models for systems identification,” in
the vehicle in a linear manner, and the estimation of a set of Proc. 9th Int. PhD Workshop on Sys. and Cont, 2008.
parameters is necessary. In the case of Gaussian Processes, [17] C. E. Rasmussen and C. K. I. Williams, Gaussian Processes for
it is a probabilist approach which allows the identification Machine Learning. The MIT Press, 2006.
[18] T. G. Carreira, “Quadcopter automatic landing on a docking station,”
of non-linearities of the system, and its main disadvantage Master’s thesis, Instituto Superior Técnico, 2013.
is the high computational burden. [19] D. W. Eggert, A. Lorusso, and R. B. Fisher, “Estimating 3-d rigid body
transformations: a comparison of four major algorithms,” Machine
The results of the system’s identification were satisfactory Vision and Applications, vol. 9, no. 5-6, pp. 272–290, 1997.
for both methods, just noting an advantage of using Gaussian
Processes for thrust predictions. For this reason, the imple-
mentation of the final simulator is a combination of the two
methods used.

Вам также может понравиться