0% found this document useful (0 votes)
63 views10 pages

Modelling and Genetic Algorithm Based-PID Control of H-Shaped Racing Quadcopter

Uploaded by

hawi aboma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views10 pages

Modelling and Genetic Algorithm Based-PID Control of H-Shaped Racing Quadcopter

Uploaded by

hawi aboma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Arab J Sci Eng

DOI 10.1007/s13369-017-2433-2

RESEARCH ARTICLE - ELECTRICAL ENGINEERING

Modelling and Genetic Algorithm Based-PID Control


of H-Shaped Racing Quadcopter
Ahmed Alkamachi1 · Ergun Erçelebi2

Received: 24 June 2016 / Accepted: 19 January 2017


© King Fahd University of Petroleum & Minerals 2017

Abstract This work presents a detailed mathematical mod- 1 Introduction


elling of H -shaped racing quadcopter. The complete nonlin-
ear dynamic model is obtained by exploiting Newton–Euler Unmanned aerial vehicles (UAVs) have shown an increasing
method as a common technique used in quadcopter mod- interest thanks to the revolution in technologies which made
elling. A trajectory tracking controller is proposed, in which the quadcopter affordable to civilian applications. Quad-
four PID controllers are designed to stabilize the quadcopter copters have received a significant attention from researchers
and to achieve the required altitude and orientation. How- due to their broad range of applications in both military and
ever, a nested loop PID controllers are designed to track the civil fields.
desired x and y position of the quadcopter. The PID coeffi- Racing-type quadcopters which fulfil several important
cients for the aforementioned proposed controllers are tuned applications are not well discovered yet, and they are still
using genetic algorithm (GA). The objective function for the in their infancy. The translational speed of the UAV is of
GA was set so as to minimize the absolute tracking error, considerable importance in several application like rescue,
peak overshoot, and settling time for a step inputs. A MAT- emergency, civil defence, and martial field; and consequently,
LAB/Simulink environment is used to conduct the system racing quadcopters are gathering people and researchers
model and the designed controller. The closed loop system attention rapidly.
performance is depicted for individual step inputs and for a The racing quadcopter consists of “H”-shaped main body
predefined trajectory. Simulation results show a perfect step frame with four rotor groups distributed on its tips as shown
response performance and excellent trajectory tracking capa- in Fig. 1. Each rotor group consists of a brushless DC motor
bility with a very low error budget. Finally, the controller that drives a fixed pitch propeller directly. Two opposite pro-
robustness is examined and it is shown that the designed con- pellers are spinning in clockwise (CW) direction, while the
troller is robust against sensor noise, external disturbances, remaining are spinning in counter clockwise (CCW) direc-
and model parameters uncertainties. tion. The reason behind this configuration is to zero the
resultant drag torque of the spinning propellers so the quad-
Keywords Genetic algorithm (GA) · H -shaped quadcopter · copter body will not revolve around itself during hover.
Newton–Euler model · PID controller · Racing quadcopter The quadcopter can control its six DOFs by speeding up or
slowing down its rotors’ speed individually. The altitude can
be controlled by either increasing or decreasing the angular
B Ahmed Alkamachi velocity of the four rotors simultaneously. The quadcopter
[email protected]; [email protected]
body can be rotated around the vertical axis (yawing) by
Ergun Erçelebi making a difference in revolving speed between the CW
[email protected]
and CCW propellers while maintaining the overall gener-
1 Al-Khwarizmi College of Engineering, University of ated thrust constant. The quadcopter body can also be leaned
Baghdad, Baghdad, Iraq around the lateral axis (pitching) or around the longitudi-
2 Department of Electrical and Electronics Engineering, nal axis (rolling). For pitching, the speed of rotors 2 and
University of Gaziantep, Gaziantep, Turkey 3 should be increased (decreased), while reducing (increas-

123
Arab J Sci Eng

mechanics is used to write a mathematical model for the


hardware in the loop (HIL) test platform, and PD controller
is designed to control the derived model in [9]. Çetinsoy [10]
derives a model for holonomic quadcopter UAV and designs
eight PID controller to control the quadcopter pose.
In the controller robustness point of view, some authors
examined their designed controllers ability in rejecting dis-
turbances, suppressing noise, and reducing the model uncer-
tainties effects. Benallegue et al. [11] discuss the robustness
of a feedback linearization-based controller against external
disturbances and model uncertainties. A multivariable PD
controller is designed to stabilize the quadcopter attitude,
and the controller is tested for its robustness against the vari-
ation in the model parameters in [12]. Li and Li [13] test a
PID controller for its robustness in regulating a quadcopter
6 DOFs.
Fig. 1 Racing quadcopter configuration and reference frames The main contribution of this work is to derive a mathe-
matical model for H -shaped racing quadcopter. Furthermore,
a PID controller is proposed in which its parameters are
ing) that of rotors 1 and 4 with the same amount to maintain tuned using GA with an objective function that compromise
the quadcopter at the same altitude. In the same way, the between the tracking error, peak overshoot, and the settling
quadcopter can make rolling motion by speeding up (slow- time of the output signal.
ing down) rotors 1 and 2 and slowing down (speeding up) The rest of the paper sections is set as follows: Section
rotors 3 and 4. The quadcopter can move by tilting its body 2 describes the static and dynamic mathematical model of
to the desired direction. It can move along x direction if it the quadrotor type under consideration. The proposed con-
is pitched and in y direction if it is rolled. In general, the trol algorithm and design is presented in Sect. 3. Section 4
more the quadcopter tilts, the faster it travels along the tilt presents a trajectory tracking test, while the controller robust-
direction. ness is discussed in Sect. 5. Finally, the paper concludes in
Motivated by the UAVs advantages and applications, Sect. 6.
comprehensive modelling and control methods have been
proposed. Quadcopter’s dynamic models have been studied
by the researchers who obtained their models using Newton– 2 System Modelling
Euler and/or Lagrangian approach(s). In Erginer et al. [1],
describe the quadcopter model mathematically and design The dynamic model of a system is the mathematical equa-
a PD controller to stabilize it. In [2], the authors propose tions that integrates all the forces that can act on a system at
a dynamic model for X-type quadcopter. The gyroscopic a given time [14].
and aerodynamic effect is considered through the modelling. The quadcopter is a multi-input multi-output (MIMO)
A nonlinear model for a quadcopter is presented in [3], system and has a complex structure with high nonlinear
where the authors emphasize on the rotational motion con- dynamics, thus obtaining its mathematical model is not an
trol. Zemalache et al. propose a quadcopter with two of its easy task [1,15]. In this section, the detailed mathematical
rotors are bidirectional, and they derive a dynamic model for model for the H -shaped quadcopter is developed.
it in [4]. They make use of backstepping method to control
the proposed quadcopter. Tayebi and McGilvray [5] propose 2.1 Reference Frames
a PD2 feedback controller for exponential stabilization of
quadcopter attitude. Bouabdallah et al. design and control In this part of the work, two main reference frames are defined
an indoor micro quadcopter in [6]. They use a classical con- and the matrices used to switch between the reference frames
troller (PID) for a simplified model and a modern approach are developed. These frames are the earth frame (Fe ) and the
(LQ) based on a more complete dynamics. Both methods body frame (Fb ) as shown in Fig. 1.
are tested in simulation environment and on a test bench The earth (inertial) frame is defined with ordered triplet
[7]. Bresciani [8] uses Newton–Euler formalism to obtain vectors: X e , Ye , and Z e which are pair-wise perpendicular.
the dynamic system model of a quadcopter helicopter. He In what follows, the variables resolved to the earth frame are
designs a PID controller and evaluates the complete sys- subscripted with letter “e”. The body frame is described by
tem by means of simulation and a test platform. Lagrangian the orthonormal basis vectors: X b , Yb , and Z b . In the follow-

123
Arab J Sci Eng

ing sections, a “b” letter subscript is used to denote variables


resolved to the body frame. The earth and body frames differ
in that the origin of the body frame can be drawn from that of
the earth frame, and the axes of the body frame can change
orientation with respect to those of the earth frame. To move
from (Fe ) to (Fb ) and vice versa, a rotation matrix is required.
The rotation matrix from (Fe ) to (Fb ) , also called direction
cosine matrix, is a multiplication of the three canonical rota-
tion matrices Rx(φ), Ry(θ ), and Rz(ψ) with a predefined
sequence [16], i.e.,

Rib = Rx(φ) ∗ Ry(θ ) ∗ Rz(ψ)


⎡ ⎤
Cθ Cψ Cθ Sψ −Sθ (1)
Fig. 2 Racing quadcopter schematic diagram
= ⎣−Cφ Sψ + Sφ Sθ Cψ Cφ Cψ + Sφ Sθ Sψ Sφ Cθ ⎦
Sφ Sψ + Cφ Sθ Cψ −Sφ Cψ + Cφ Sθ Sψ Cφ Cθ
– The body frame origin attached to the centre of gravity
where C and S are the cosine and sine function, respectively. (COG) of the quadrotor’s body, with X b along the forward
The sequence of rotation in (1) is z y x (yaw with angle ψ movement direction as shown in Figs. 1 and 2.
about z axis) → (pitch with angle θ about y axis) → (roll – According to blade element theory (BET), the thrust and
with angle φ about x axis). drag torque are assumed to be proportional to the square
In order to go from the body to the earth coordinates, the of the propeller revolving speed [20].
inverse of Rib should be obtained. Since the matrices used to
calculate Rib are orthogonal, then Rbi is simply the transpose
of Rib [17], that is,
 T 2.3 Mathematical Model
Rbi = Rib (2)
This portion presents a detailed derivation of the Newton–
The transformation from one frame to the other is necessary Euler 6 DOFs equations of motion for the quadcopter under
since not all the states are measured in on frame. For example, consideration.
the thrust forces generated by the propellers are measured in
the body frame, while the gravitational force is in the earth
frame. 2.3.1 Static Model
To express the relationship between the Euler rates η̇ =
[φ̇ θ̇ ψ̇]T which are measured in the earth frame and the The static model for the quadcopter is obtained by expressing
body angular velocities ωb = [ p q r ]T , the following trans- the forces and torques acting on its body mathematically.
formation is used [18,19]:

η̇ = T ∗ ωb (3) Forces The forces acting on the quadcopter are divided into
two types: the propulsive force and the gravitational force.
where Each of the four propellers produces a propulsive force when
⎡ ⎤ spinning. The overall generated force is the algebraic sum of
1 sin(φ) tan(θ ) cos(φ) tan(θ ) that produced by the four propellers. The propulsive force
⎣ π π
T = 0 cos(φ) − sin(φ) ⎦ − < θ < for the ith rotor expressed in the body frame is:
2 2
0 sin(φ) sec(θ ) cos(φ) sec(θ )
⎡ ⎤
2.2 Simplification Hypotheses 0
FRi =⎣ 0 ⎦ for i = 1, 2, 3, 4. (4)
The following are some important assumptions that are used K th ∗ Ωi2
to simplify writing the system mathematical model. Without
these hypotheses, the system equations of motion will be where K th is the thrust coefficient and Ωi is the spinning
complicated. speed of the ith propeller.
Then the overall force of the four propellers is the vector
– The structure supposed to be symmetrical and rigid. sum of the individual forces.

123
Arab J Sci Eng


4
The total torque due to the four rotating propellers is:
FT = FRi
i=1
⎡ 2⎤ 
4
⎡ ⎤ Ω1 (5) MT = MRi (10)
0 0 0 0 ⎢Ω 2 ⎥
=⎣ 0 0 0 0 ⎦∗⎢ 2⎥
⎣Ω 2 ⎦
i=1

K th K th K th K th 3
Ω42 substituting (9) in (8) and the resulting equation into (10) and
let L x = L y = L, yield:
Not only the propulsive force affects the quadcopter motion
but also the gravitational force tries to pull it down to the ⎡ 2⎤
⎡ ⎤ Ω1
ground. The gravitational force in the earth frame is deter- L ∗ K th L ∗ K th −L ∗ K th −L ∗ K th ⎢Ω 2 ⎥
mined by: MT = ⎣−L ∗ K th L ∗ K th L ∗ K th −L ∗ K th ⎦ ∗ ⎢ 2⎥
⎣Ω 2 ⎦
⎡ ⎤ KD −K D KD −K D 3
0 Ω42
F Ge = ⎣ 0 ⎦ (6) (11)
−M ∗ g
2.3.2 Control Vector U
where M is the total mass of the quadcopter and g is the
gravitational constant. At this stage and for the purpose of better understanding
The total force applied on the quadcopter is a couple of the mathematical model of the quadcopter, it is important
the propulsive and gravitational forces: to define a control vector U that is consist of four inputs
U 1, U 2, U 3, and U 4.
Fe = F G e + Rbe ∗ FT (7) The first control input (U 1) is the total forces generated by
the rotors in the z axis direction. It is responsible of altitude
In the above equation, the rotation matrix is inserted to trans- control.
fer the propulsive force from the body to the earth coordinate
 
so that, it can be added to the gravitational force. U 1 = FTz = K th ∗ Ω12 + Ω22 + Ω32 + Ω42 (12)

Torques The torques that affect the rotational motion of the


quadcopter are the reactive and the drag torques, where both The second control input (U 2) is the resulting moment
of them are a result of propeller rotation. The torque due to around x axis and is responsible of roll angle control.
the ith rotor is:  
U 2 = MTx = L ∗ K th ∗ Ω12 + Ω22 − Ω32 − Ω42 (13)
MRi = L Ob →Pi × FRi − MDi (8)
The third control input (U 3) represents the moments around
where L Ob →Pi is a vector from the origin of the body frame
y axis so it affects the pitch angle of the quadcopter.
to the centre of the ith propeller and is equal to:
 
L Ob →P1 = [ L x , L y , 0]T , U 3 = MTy = L ∗ K th ∗ −Ω12 + Ω22 + Ω32 − Ω42 (14)
L Ob →P2 = [ −L x , L y , 0] ,
T

L Ob →P3 = [ −L x , −L y , 0]T , The fourth control input (U 4) is in charge of controlling the


yaw angle since it is simply the resultant moment around z
L Ob →P4 = [ L x , −L y , 0]T axis.
and L x , L y are shown in Fig. 2.  
The drag torque for the ith propeller is: U 4 = MTz = K D ∗ Ω12 − Ω22 + Ω32 − Ω42 (15)

⎡ ⎤
0 Equations (12) through (15) can be combined into one matrix
MDi =⎣ 0 ⎦ for i = 1, 2, 3, 4. (9) equation as follow:
(−1)i ∗ K D ∗ Ωi2
⎡ ⎤ ⎡ 2⎤
U1 Ω1
where K D is the drag coefficient and (−1)i is negative for CW ⎢U 2⎥ ⎢Ω 2 ⎥
⎢ ⎥ = K ∗ ⎢ 2⎥ (16)
rotated propellers (1 and 3) and positive for CCW propellers ⎣U 3⎦ ⎣Ω 2 ⎦
3
(2 and 4). U4 Ω42

123
Arab J Sci Eng

where K ∈ R 4×4 is the coefficient matrix and equal to: then the following set of equations, which describes the trans-
lational motion of our model, can be obtained.
⎡ ⎤
K th K th K th K th
⎢ L ∗ K th L ∗ K th −L ∗ K th −L ∗ K th ⎥ ẍCθ Cψ + ÿCθ Sψ − (z̈ + g)Sθ = 0 (21)
K =⎢
⎣−L ∗ K th

L ∗ K th L ∗ K th −L ∗ K th ⎦ ẍ(Sφ Sθ Cψ − Cφ Sψ ) + ÿ(Sφ Sθ Sψ
KD −K D KD −K D
+Cφ Cψ ) + (z̈ + g)Sφ Cθ = 0 (22)

The rotation speed of the rotors for a specific control input ẍ(Cφ Sθ Cψ + Sφ Sψ ) + ÿ(Cφ Sθ Sψ
vector can be calculated by: U1
−Sφ Cψ ) + (z̈ + g)Cφ Cθ = (23)
M
⎡ ⎤
⎡ ⎤
Ω1 U1 Rotational motion equations According to Newton–Euler

⎢Ω2 ⎥ ⎢U 2⎥
⎢ ⎥ = K −1 ∗ ⎢ ⎥ (17) formalism, the rotational motion equations are derived and
⎣Ω3 ⎦ ⎣U 3⎦ expressed in the body coordinates.
Ω4 U4
MT = I ∗ ω˙b + (ωb × I ∗ ωb ) (24)
2.3.3 Dynamic Model
where I ∈ R 3×3 is a moment of inertia matrix of the quad-
The dynamic model of the quadcopter describes its behaviour copter. The quadcopter assumed to be symmetrical in Sect.
over the time. Unlike terrestrial mobile robots in which 2.2, so the moment of inertia matrix is expected to be diag-
it is possible to describe their models kinematically, the onal.
quadcopter modelling requires their dynamics to be con- ⎡ ⎤
sidered which involves the gravitational effects [21]. There Ix x 0 0
are two methods used to represent the dynamic model, the I =⎣ 0 I yy 0 ⎦ (25)
Lagrangian and the Newton–Euler method, and both are 0 0 Izz
consistent in describing the quadcopter dynamic model.
Nevertheless, Newton–Euler method is more continent in The set of rotational equation of motion can be obtained by
describing the physics of the system and so it is easy to be means of (13–15) and (24) as follows:
understood [22]. The dynamics of a standard quadcopter falls ⎛⎡ ⎤ ⎞
U1
into two categories: a translational motion (x, y, and z) which
ω˙b = I −1 ∗ ⎝⎣U 2⎦ − (ωb × I ∗ ωb )⎠ (26)
is underactuated and a rotational motion (roll φ, pitch θ , and
U3
yaw ψ) which is fully actuated.
To this end, we have obtained the complete dynamics for
Translational motion equations Newton’s second law of the H -shaped quadcopter and the next step is to propose and
motion can be applied to describe the translational motion design a suitable trajectory tracking controller.
of the quadcopter in the earth frame.

Fe = M ∗ v˙b (18) 3 System Controller Design

where v˙b = [ẍ, ÿ, z̈]T is the quadcopter linear accelera- The MATLAB/Simulink environment on a personal com-
tion. puter with 2.5 GHz processing speed and 6 GB RAM is used
By substituting (7), (12) into the above equation, we can to verify the derived dynamical model and to carry out all the
get: subsequent tests in the following sections. The quadcopter
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ model parameters that are used during the simulation are
ẍ 0 0 shown in Table 1. The complete block diagram for the model
⎣ ÿ ⎦ = ⎣ 0 ⎦ + Rbi ∗ ⎣ 0 ⎦ (19) with the controllers is shown in Fig. 3. The following is the
z̈ −g U1
M detailed description for each individual controller.

and after some arrangement we can get: 3.1 Altitude Control


⎡ ⎤ ⎡ ⎤
ẍ 0 The altitude (z position) of the quadcopter is subtracted from
Rib ∗ ⎣ ÿ ⎦ = ⎣ 0 ⎦ (20) the desired altitude Z d to form the error signal as shown in
z̈ + g U1
M
Fig. 4. The resulting error signal is fed to a PID controller

123
Arab J Sci Eng

Table 1 Quadcopter model parameters


Parameter Value

M 1.2 kg
L 0.3 m
K th 7.5e-05 N s2 /rad2
KD 1.7e-06 Nm s2 /rad2
Ix x 0.01987 kg m2
I yy 0.01987 kg m2 Fig. 5 Attitude feedback control block diagram
Izz 0.03848 kg m2
Ωmin 100 rad/s
Ωmax 750 rad/s

Fig. 6 x − y position feedback control block diagram

angles should be calculated to achieve the desired x − y


Fig. 3 Racing quadcopter overall controller block diagram position. Two PID controllers are used to produce the desired
roll and pitch angles for a specific x − y position as shown
in Fig. 6.

Roll (φ) angle calculation The required roll angle φ can be


obtained by subtracting (22) ∗ cos(φ) from (23) ∗ sin(φ) that
results in:

1
U 1 sin(φ) = ẍ sin(ψ) − ÿ cos(ψ) (27)
M
Fig. 4 Altitude feedback control block diagram
then the desired roll angle φ can be extracted by rearranging
the above equation as:
that will adjust the value of the control input U1 to achieve
 
the desired altitude. (ẍ sin(ψ) − ÿ cos(ψ))
φd = sin−1 M ∗ (28)
U1
3.2 Attitude Control
Pitch (θ ) angle calculation In our design, it is assumed that
The attitude controller is a combination of 3 PID controllers. φ and θ angles are in the ±90◦ range. With this in mind, (21)
These controllers are responsible of producing a control sig- can be divided by cos(θ ) = 0 then:
nal U2, U3, and U4 to orient the quadcopter to the required
roll φ, pitch θ , and yaw ψ angle, respectively. Attitude con-
ẍ cos(ψ) + ÿ sin(ψ) − (z̈ + g) tan(θ ) = 0 (29)
trol block diagram is shown in Fig. 5.

3.3 X–Y Position Control and the desired pitch angle (θ ) can be obtained as:
 
In contrast to the altitude and attitude control, the x and y −1 ẍ cos(ψ) + ÿ sin(ψ)
θd = tan (30)
position cannot be controlled directly. The desired x and y (z̈ + g)
position can be obtained by tilting the quadcopter body with
a specific roll and pitch angles. The required roll and pitch In view of (20), we can get:

123
Arab J Sci Eng
⎛ ⎡ ⎤⎞T ⎛ ⎡ ⎤⎞ ⎡ ⎤T ⎡ ⎤
ẍ ẍ 0 0
⎝ R b ⎣ ÿ ⎦⎠ ∗ ⎝ R b ⎣ ÿ ⎦⎠ = ⎣ 0 ⎦ ∗ ⎣ 0 ⎦ (31)
i i
z̈ + g z̈ + g U1
M
U1
M
⎡ ⎤T ⎡ ⎤ ⎡ ⎤T ⎡ ⎤
ẍ ẍ 0 0
T
⎣ ÿ ⎦ R ∗ R ⎣ ÿ ⎦ = ⎣ 0 ⎦ ∗ ⎣ 0 ⎦
b b (32)
i i
z̈ + g z̈ + g U1
M
U1
M

then

U 1 2 Fig. 7 PID controller configuration
(z̈ + g) = − ẍ 2 − ÿ 2 (33)
M Table 2 PID controller parameters
substitute (33) into (30) yield: Control Kp Ki Kd
⎛ ⎞
z position (z d = 1 m) 14.88 0.7994 0.4734
⎜ ẍ cos(ψ) + ÿ sin(ψ) ⎟ Yaw (ψd = 20◦ ) 0.4768 0.00864 0.512
θd = tan−1 ⎜
⎝   2

⎠ (34)
Roll (φd = 10◦ ) 2.151 0.0019 0.1723
U1
M − ẍ 2 − ÿ 2
Pitch (θd = 10◦ ) 1.454 0.00239 0.2134
x position (xd = 1 m) 1.0083 0.0096 0.4965
3.4 PID Parameters Tuning Using GA y position (yd = 1 m) 9.7023 0.0099 0.5420

GA is a search heuristic method that imitates the natural


selection process [23]. The outline for the GA optimization In our work, the following values are used to initialize the
algorithm is: GA process: A = 0.4, B = 0.4, C = 0.2, population size =
100, and the number of generation for termination = 100.
– Generate a random population. The population consists Another code is added to the above algorithm to ensure that
of individuals which are in our work the PID parameters the GA tuning process converges to a controller parameters
(proportional gain K p , integral gain K i , and the derivative that produce actuators signals within the physical limits of
gain K d ). The PID controller configuration, that is used the rotors:
in this work, is shown in Fig. 7.
– The algorithm is then evaluate the individuals’ fitnesses
according to an objective function and it is in our case is (Ωmin < Ωi < Ωmax for i = 1, 2, 3, 4).
set to be:
It means that if the selected PID parameters cause the con-
Obj = A ∗ err + B ∗ ts + C ∗ MP (35) troller output to exceed the actuators’ limits, then its objective
function value is assigned to an extremely high weight so
where err is the difference between the desired and the
that it will not be reselected again. An algorithm is written
actual output response, ts is the settling time, MP is the
in MATLAB to calculate the objective function for every set
peak overshoot of the response, A, B, C are positive con-
of PID parameters. The code takes the response data from
stants subject to A + B + C = 1.
the quadcopter Simulink model to calculate the individu-
– A new population is then reproduced with their individ-
als’ fitnesses. The optimization process is repeated for the 6
uals using the following GA functions
PID controllers, and the resulting tuned parameters and step
– Evolution response are shown in Table 2. The response to a desired
– Crossover step values in Table 2 is shown in Fig. 8 with their associated
– Mutation settling times and percentage peak overshoots.
– An evaluation process is then repeated for the new indi-
viduals from the new population using (35) to test their
merit. 4 Trajectory Tracking Test
– The fittest individuals from the first and second popula-
tion are then chosen to generate a third population. As a trajectory tracking test, we assumed that the quadcopter
– The above steps are repeated as iterations until the termi- initially at hover (z = 1 m) and it should follow a horizontal
nation criterion is met, and it is in our case set to be the infinity like shape (∞) trajectory. The desired position profile
maximum number of generations. is shown in Fig. 9a and can be expressed as:

123
Arab J Sci Eng

X position (m)
1.5 1.5 2

Y position (m)

Z position (m)
1 1
0.5 ts =1.50 sec 0.5 ts =1.92 sec 1
Mp =1.56 % Mp =1.44 %
0 0
0 1 2 3 4 5 0 1 2 3 4 5
0
Time (sec) Time (sec) 1
Y
(a) (b) po
sit
0
ion -1 0.5 1 1.5 2
(m 0

Roll angle (deg)


1.5 15
Z position (m)

)
X position (m)
1 10
(a)
0.5 ts =1.66 sec 5 ts =0.45 sec
Mp =1.97 % Mp =0.06 %

X error (mm)

Y error (mm)
0 0 10
0 1 2 3 4 5 0 1 2 3 4 5 20
Time (sec) Time (sec) 0 0
-20
(c) (d) -10
0 10 20 30 0 10 20 30
Yaw angle (deg)
Pitch angle (deg)

15 30 Time (sec) Time (sec)


10 20 (b) (c)
5 ts =0.57 sec 10 ts =1.31 sec
Mp =0.06 % Mp =0.53 % 1 ×10-3

Z error (mm)

Yaw error (deg)


0 0 1
0 1 2 3 4 5 0 1 2 3 4 5
Time (sec) Time (sec) 0 0
(e) (f) -1 -1
0 10 20 30 0 10 20 30
Time (sec) Time (sec)
Fig. 8 Simulation results for step inputs a x position response, b y
position response, c z position response, d roll φ response, e pitch θ (d) (e)
response, f yaw ψ response

xd = 1 − ρ ∗ cos(0.2 ∗ (t))
yd = ρ ∗ sin(0.4 ∗ (t))
zd = 1

where ρ(t) = 2/(3 − cos(0.4 ∗ (t))).


The simulation result shows that the maximum tracking (f)
error percentage in x − y position is approximately 1.5%. Fig. 9 Trajectory tracking results a 3D desired position trajectory, b
The other important quantities are: tracking error in x position, c tracking error in y position, d z position
drift, e yaw ψ tracking error, f rotors behaviour
– The peak linear velocity of the quadcopter body is ẋ =
0.18 and ẏ = 0.43 m/s;
– The maximum linear acceleration during the path follow- position is 43 mm which implied the controller capability of
ing is ẍ = 0.57 and ÿ = 0.21 m/s2 . suppressing noise.

5.2 Model Uncertainties


5 Robustness Test
For the model uncertainty test, we assume that the quad-
Simulation environment is used to implement three tests to copter weight is increased by 35% due to an added payload.
verify the robustness of the designed controller. A simulation is implemented with this uncertainty, and the
quadcopter is ordered to follow the infinity shape trajec-
5.1 Random Noise tory in Fig. 9a. The position tracking error is shown in Fig.
11a, b. It can be seen from the rotors behaviour in Fig.
A white Gaussian random noise (shown in Fig. 10a) is gen- 11c that the actuators did not exceed their upped and lower
erated with a maximum absolute amplitude of 0.01. It is then limits.
injected in the feedback loops to simulate the sensor noise.
In order to simulate the rotors’ actuator, a saturation block 5.3 External Disturbances
is added to limit the calculated rotor’ upper and lower speed
to its physical limits stated in Table 1. Simulation results in In this test, we assume that the racing quadcopter received a
Fig. 10b, c show that for the infinity shape trajectory track- sudden disturbance force while it is at hover (z = 1 m). The
ing in the previous section, the maximum error in x and y disturbance force of 1N is applied in the upward direction

123
Arab J Sci Eng

6 Conclusion

Racing quadcopters are of great importance for their several


serious application related to human life rescue. In contrast
with this quadcopter type importance, there is no attention
(a) for its model derivation and control. In this paper, a com-
plete mathematical model for H -Shaped racing quadcopter
X error (mm)

Y error (mm)
40 50
has been obtained. The dynamics of the model have been
0 0 described in a comprehensive and systematic way. A PID
-40 -50
control scheme has been proposed to control the six DOFs
0 10 20 30 0 10 20 30
of the quadcopter. Besides, the PID coefficients have been
Time (sec) Time (sec)
tuned using GA with a novel objective function that compro-
(b) (c)
mises between three important step response characteristics.
Fig. 10 Random noise test results a noise signal, b x position error, c The GA set the PID coefficients to achieve the best perfor-
y position error mance that minimize the tracking error, the settling time, and
the peak overshoot while maintaining the actuators in the
normal operation limits. The derived model along with the
X error (mm)

Y error (mm)

40
10
0 0
designed controller has been implemented in the Simulink
-10 environment. The system has been commanded to follow a
-40
0 10 20 30 0 10 20 30 desired infinity-shaped trajectory, and the simulation results
Time (sec) Time (sec)
have shown a perfect trajectory tracking performance with a
(a) (b) very low tracking error. In the final analysis, the controller
has been tested for its robustness in terms of sensor noise sup-
pression, disturbance rejection, and the sensitivity to model
parameters uncertainties. The robustness test results revealed
the designed controller effectiveness and performance.

(c) References
Fig. 11 Model uncertainty test results a x position error, b y position 1. Erginer, B.; Altug, E.: Modeling and PD control of a quadrotor
error, c rotors behaviour VTOL vehicle. In: IEEE Intelligent Vehicles Symposium, pp. 894–
899. IEEE (2007)
2. Hamel, T.; Mahony, R.; Lozano, R.; Ostrowski, J.: Dynamic mod-
Disturbance (N)

100
Z error (mm)

1 50
elling and configuration stabilization for an X4-flyer. IFAC Proc.
0.5
Vol. 35(1), 217–222 (2002)
0
0
3. Mokhtari, A.; Benallegue, A.: Dynamic feedback controller of
-50
0 5 10 0 5 10 Euler angles and wind parameters estimation for a quadrotor
Time (sec) Time (sec) unmanned aerial vehicle. In: IEEE International Conference on
(a) (b) Robotics and Automation (ICRA’04), vol. 3, pp. 2359–2366 (2004)
4. Zemalache, K.M.; Beji, L.; Marref, H.: Control of an under-
actuated system: application a four rotors rotorcraft. In: IEEE
International Conference on Robotics and Biomimetics-ROBIO,
pp. 404–409 (2005)
5. Tayebi, A.; McGilvray, S.: Attitude stabilization of a VTOL
quadrotor aircraft. IEEE Trans. Control Syst. Technol. 14(3), 562–
571 (2006)
(c) 6. Bouabdallah, S.; Murrieri, P.; Siegwart, R.: Design and control
of an indoor micro quadrotor. In: IEEE International Conference
Fig. 12 Disturbance test results a disturbance input, b z position error, on Robotics and Automation (ICRA ’04), vol. 5, pp. 4393–4398
c rotors behaviour (2004)
7. Bouabdallah, S.; Noth A.; Siegwart, R.: PID vs LQ control
techniques applied to an indoor micro quadrotor. International Con-
directly under the COG point and it is continued for 1 s. The ference on Intelligent Robots and Systems (IROS 2004), vol. 3, pp.
2451–2456 (2004)
controller shows the capability to reject the disturbance and
8. Bresciani, T.: Modelling, Identification and Control of a Quadrotor
maintain the stability and the position of the system. The Helicopter. In: Department of Automatic Control. Master Thesis
simulation results are shown in Fig 12. Lund: Lund University (2008)

123
Arab J Sci Eng

9. Bayrakceken, M.; Kemal, M.; Kursat Y.; Aydemir A.; Abdurrah- 16. Gruber, D.: The mathematics of the 3D rotation matrix. In: The
man K.: HIL simulation setup for attitude control of a quadrotor. Xtreme Game Developers Conference (2000)
In: IEEE International Conference on Mechatronics (ICM), pp. 17. Padfield, G.D.: Helicopter Flight Dynamics. Wiley, New York
354–357. IEEE, Havard (2011) (2008)
10. Çetinsoy, E.: Design and flight tests of a holonomic quadrotor UAV 18. Cai, G.; Chen, B.M.; Lee, T.H.: Unmanned Rotorcraft Systems.
with sub-rotor control surfaces. In: IEEE International Conference Springer, Berlin (2011)
on Mechatronics and Automation (ICMA), pp. 1197–1202. IEEE 19. Leishman, R.C.; Macdonald, J.C.; Beard, R.W.; McLain, T.W.:
(2013) Quadrotors and accelerometers: state estimation with an improved
11. Benallegue, A.; Moktari, A.; Fridman, L.: Feedback linearization dynamic model. IEEE Control Syst. 34(1), 28–41 (2014)
and high order sliding mode observer for a quadrotor UAV. In: Pro- 20. Mahony, R.; Kumar, V.; Corke, P.: Multirotor aerial vehicles: mod-
ceedings of the 2006 International Workshop on Variable Structure eling, estimation, and control of quadrotor. IEEE Robot. Autom.
Systems (2006) Mag. 19(3), 20–32 (2012)
12. Lara, D.; Romero, G.; Sanchez A.; Lozano, R.: parametric robust 21. Salih, A.L.; Moghavvemi, M.; Mohamed, H.A.; Gaeid, K.S.: Flight
stability analysis for attitude control of a four-rotor mini-rotorcraft. PID controller design for a UAV quadrotor. Sci. Res. Essays 5(23),
In: Proceedings of the 45th IEEE Conference on Decision and 3660–3667 (2010)
Control, pp. 4351–4356. San Diego (2006) 22. Zhang, X.; Li, X.; Wang, K.; Lu, Y.: A survey of modelling and
13. Li, J.; Li, Y.: Dynamic analysis and PID control for a quadrotor. In: identification of quadrotor robot. Abstr. Appl. Anal. 2014, 1–16
IEEE International Conference on Mechatronics and Automation, (2014)
pp. 573–578. Beijing (2011) 23. Mitchell, M.: An Introduction to Genetic Algorithms. MIT press,
14. Gupte, S.; Mohandas, P.I.T.; Conrad, J.M.: A survey of quadrotor Cambridge (1996)
unmanned aerial vehicles. In: Proceedings of IEEE Southeastcon,
pp. 1–6 (2012)
15. Stingu, E.; Lewis, F.: Design and implementation of a structured
flight controller for a 6DoF quadrotor using quaternions. In: IEEE
17th Mediterranean Conference on in Control and Automation
MED’09, pp. 1233–1238 (2009)

123

You might also like