Using Neural Network and Reference Model
Using Neural Network and Reference Model
Abstract— This paper describes nonlinear dynamics model of an m Total mass of the Quadcopter
unmanned aerial vehicle of type quadcopter using Newton-Euler x, y, z Cartesian coordinates
modeling technique. Usually UAVs systems are unstable and Roll angle (Rotation around x-axis)
stabilization control plays a very important role. More than half
θ Pitch angle (Rotation around y-axis)
of industrial controllers in use today are PID. Thus, the
adjustment aspect of proportional integral derivative (PID) ψ Yaw angle (Rotation around z-axis)
controllers becomes a challenge for research. To tune the ωi Angular speed of the ith rotor
controller, two main approaches are proposed. One is linear;
the PD gains are fixed in optimal way by using reference model
method, while the other is nonlinear and consists of an adaptive I. INTRODUCTION
hybrid Neural Network based PD (NNPD) control. Hence, Nowadays, UAVs (unmanned aerial vehicles) have
simulation results have been performed under obtained considerable development and are becoming more
MATLAB/Simulink and prove that proposed adaptive hybrid popular. This can be easily observed in the military and civil
Neural Network based PD (NNPD) controller and reference
areas. It is constituted by four rotors placed at the end of
model method give better results in the term of settling time and
precision in Quadrotor UAV application. a cross, where two diagonal motors turn in the same direction
Keywords— Quadcopter; PD tuning; Neural Network; whereas the others turn in the other direction to eliminate the
Reference model. anti-torque. This vehicle has six degrees of freedom with four
independent thrust forces generated by four rotors. Therefore,
NOMENCLATURE is an under-actuated dynamic vehicle (four input and six
AFGS-SMC Adaptive Fuzzy Gain-Scheduling Sliding Mode outputs). Thus it can be controlled by varying the speed of the
Control rotors in order to produce the required forces and moments
ANNs Artificial Neural Networks [1][2].
BP Backpropagation Several studies related to design control techniques of
DOF Degree of freedom Quadcopter have been proposed. In [3], the second order
IntSMC Integral Sliding Mode Control sliding mode control to direct the position and attitude
MLP MultiLayer Perceptron tracking of a small Quadcopter UAV is considered. The
NN Neural Network backstepping technique has been used to solve the
NNPID Neural Netwok based PID stabilization and trajectory tracking problems[4][5]. A novel
PID, PD Proportional, Integral and Derivative adaptive fuzzy gain-scheduling sliding mode control (AFGS-
RBFNN Radial Basis Function Neural Network SMC) approach is proposed [6]. PID and Fuzzy-PID control
RM Reference Model model for Quadcopter Attitude with disturbance parameter
RMPD Reference Model based PD [7][8]. PID and LQR controllers were proposed to stabilize
UAVs Unmanned Aerial Vehicles the attitude [9]. An attitude control strategy based on Ziegler-
VTOL Vertical Take-Off and Landing Nichols rules for tuning PD is proposed in [10]. A
b, d Lift and Drag coefficients generalized proportional integral (GPI) control approach is
g Gravitational constant presented in [11] for regulation and trajectory tracking
I x, I y, I z Inertias around x, y and z axis problems in a nonlinear, multivariable Quadcopter system
Jr Rotor inertia model.
kftx, kfty, kftz Translation drags coefficients Artificial neural network has several features such as
kfax, kfay, kfaz Frictions aerodynamics coefficients. nonlinear, self-learning and adaptability [12]. In recent years,
L Half size of Quadcopter it has attracted great attention, by fact that is nowadays
Copyright IPCO-2018
ISSN 2356-5608
Conférence Internationale en Automatique & Traitement de Signal (ATS-2018)
Proceedings of Engineering and Technology – PET
Vol.35pp.40-46
becoming widely used in many applications. The NN control produce yaw motion as needed. The motion of Quadcopter
has been proved to be effective for controlling uncertain can be controlled to desired values by changing the rotation
nonlinear systems. Recently, the researchers have focused on speed of four rotors. The vertical take-off/Landing can be
the study of Quadcopters for its increasing importance. A adjusted by increasing or decreasing the rotation speed of the
decentralized PID neural network (PIDNN) control scheme four rotors simultaneously. The yaw motion is obtained from
was applied to a Quadcopter subjected to wind disturbance the difference in the counter torque between each pair of
[12]. Adaptive RBFNNs and double-loop integral sliding propellers. The up (down) motion is achieved by increasing
mode control (IntSMC) control is introduced for the position (decreasing) the rotor speeds altogether with the same
tracking [13]. Artificial neural network’s direct inverse magnitude. Forward (backward) motion which is related to
control system for Quadcopter attitude dynamics is suggested the pitch, angle can be obtained by increasing the back (front)
[14]. An adaptive neural network control to stabilize a rotor thrust and decreasing the front (back) rotor thrust.
Quadcopter under the presence of external disturbances is Finally, a laterally motion which is related to the roll, angle
proposed in [15]. The lack of the neural network is to define can be achieved by increasing the left (right) rotor thrust and
the best topology of the network, the number of neurons to decreasing the right (left) rotor thrust. The Quadcopter has six
place in the hidden layer (s), the choice of the initial values of degrees of freedom, nonlinear, unstable, and multivariable,
the neural weights and the setting of the learning rate, which strongly coupled [12][5].
play an important role in the speed of convergence.
The Proportional-Integral Derivative (PID) controller is
one of the earlier developed control strategies widely used in
industrial because of its easy implementation. For achieving
appropriate closed loop performance, three parameters of
the PID controller must be tuned, the proportional gain K P,
the integral gain KI and the derivative gain KD. Many
studies have been proposed the Proportional-Integral
Derivative (PID) control of a Quadcopter by using linearized
model [16]-[18]. Tuning methods of PID parameters are
classified as traditional and intelligent methods. Usually
conventional methods such as Ziegler and Nichols not give
good tuning. Recently, the intelligent approaches such as
genetic algorithm, Particle Swarm Optimization (PSO) and
neural network were used in PID tuning for controlling of
Quadcopter [2][19]. Fig.1 Quadcopter Configuration
The hybrid systems of PID control and the artificial neural
networks control have been widely studied [20]-[22]. Using the Euler- Newton formalism, the dynamic
Commonly, neural network is used to tune the control gains equations are written in the following form :
of PID controllers. Therefore, PID Neural Network (PIDNN)
is a novel control strategy that includes the advantages of PID
control and neural network control.
The aim of this paper is to get an ideal response for the
highly nonlinear Quadcopter focus on attitude and altitude
stabilization during control. Reference model method and a (1)
Neural Network approaches are chosen to obtain optimal
gains of PD controller. J is a symmetric positive definite constant inertia matrix.
This paper is organized into five sections. Section II
(2)
presents the stages of modeling of the Quadcopter using
Newton Euler formalism. The control techniques used to : is the angular velocity of the fixed airframe
adjust the controllers parameters are presented in sections III
and IV. Section V describes the obtained results. Finally,
Section VI provides concluding remarks.
Copyright IPCO-2018
ISSN 2356-5608
Conférence Internationale en Automatique & Traitement de Signal (ATS-2018)
Proceedings of Engineering and Technology – PET
Vol.35pp.40-46
(I y I z )
s c c c c c
is a skew-symmetric matrix. For a given vector
it is defined as in (5). Ix
(14)
J r r
k fax l u 2
c c s 2 s 2
2
Ix Ix Ix
(5)
(I I ) J
c c s s z x s r r
is the resultant of the forces generated by the four Iy Iy
rotors.
k f a y l u3 (15)
2 c 2 2 c s c 2 c 2 s 2
(6) Iy Iy
(7) (I x I y )
s c c s
s
Iz
Where the thrust force produced by the ith rotor. (16)
is the resultant of the drag forces along (x, y, z) axis, it 2 2
k l u
s 2 c s c 2 c 2 c 2 4
fa z
is defined by (8). Iz Iz
c s c s s
kft x
x u1 x (17)
m m
(8) s s c c s kfty
y u1 y (18)
m m
is the gravitational force: c c kf tz
z g u1 z (19)
m m
(9) Where c(.) and s(.) are abbreviations for cos(.) and sin(.),
respectively.
The control inputs u1, u2, u3, u4 and r are given in (20).
is the moment developed by the quadrotor according to
the body fixed frame. It is expressed as in (10).
u1 b (12 22 32 42 )
u 2 b ( 4 2 )
2 2
(10)
u 3 b ( 3 1 )
2 2
(20)
u 4 d (1 2 3 4 )
2 2 2 2
r 2 4 3 1
is the resultant of aerodynamics frictions torques, it is
expressed in (11).
The model parameter values of the Quadcopter are listed
in Table I.
(11)
TABLE I.
QUADCOPTER PARAMETERS
Parameter Value and unite Parameter Value and unite
is the resultant of torques due to the gyroscopic effects.
M 0.65Kg Ix, Iy 7.5 10-3 Kg.m²
(12) g 9.81m/s² Iz 1.3 10-3 Kg.m²
is the gyroscopic moment due to movements of L 0.23m Kfax , Kfay 5.567 10-4N/rad/s
the Quadcopter: b 3.13 10-5N/rad/s Kfaz 6.354 10-4N/rad/s
Copyright IPCO-2018
ISSN 2356-5608
Conférence Internationale en Automatique & Traitement de Signal (ATS-2018)
Proceedings of Engineering and Technology – PET
Vol.35pp.40-46
z 1/m
Gz (p) = (p) =
u1 k ftz (29)
III. REFERENCE MODEL BASED PD CONTROLLER p( p)
m
In the first part of this work, the reference model is used
to determine the parameter’s values of the PD controllers, There are four PD controllers, one controller to each flight
giving thus the RMPD approach. parameter (ϕ, θ, ψ, z) :
The general idea behind this method is to have a system d
that follows a certain system as a reference model which is ui (t ) k pje j (t ) kdj e j (t )
dt (30)
imposed in some desired specifications.
Where i=1, 2, 3, 4 and j= ϕ, θ, ψ, z.
For a controlled system of order n and characteristic
The characteristic polynomial of the desired behavior for
equation:
attitude and altitude motions is defined by:
(21)
= ) (31)
The performance may be those of a dominant mode of first
order or second order. ) (32)
When it is desired to have the behavior of a first
order system with a specified settling time By identifying with the reference model, the PD
r5% , the
dominant pole is placed at -1/ and the (n-1) others parameters are then extracted:
must be placed sufficiently left of -1/ in the complex
plan. ; = (33)
If the desired behavior is of the second order with ; = (34)
damping factor and the natural pulsation, the dominant
poles are placed at − ± √(1 − 2) and the (n-2) others
must be placed sufficiently left of – in the complex plan ; = (35)
[23][24]. (36)
Tuning the controller requires knowledge of the
relationship between the input and output variables of
The desired closed loop performances are:
the system to be controlled. Since the UAV is a
Position error
complex nonlinear system, this relationship between the
input signal and the output signal is not so simple. However zero overshoot
around some assumption, the relationship between the signals Settling time Tr(5%/) =0.5 s
can be described by a linear model. Then, we can present a
IV. NEURAL NETWORK BASED PD TUNING
very simplified model of quadcopter in equations 22-25, the
equation become simpler as equations 14-19: The adjustment of the PD controllers depends on the
setting of its parameters (i.e., Kp, Kd), so that the performance
of the controlled system becomes powerful and accurate
l u2 according to the established performance criteria.
(22) The neural network has the ability of nonlinear
Ix mapping, which can realize the best combination of PID
l u3
(23) control by learning the system performance. The proposed
Iy Neural Network based PD (NNPD) approach for Quadcopter
l u4 attitude and altitude stabilization consist of a Neural Network
(24)
Iz controller which adjust the PD parameters (i.e. proportional
kf tz and derivative gains) online in optimal manner according
1
z u1 z to the dynamic characteristics and behavior of the
m m (25) quadcopter UAV. The hybrid control block diagram of
proposed NNPD is given in Fig.2.
By applying Laplace transform on equation (22-25), the
transfer function of the open-loop system is given by:
l
G (p) = (p) =
u2 I x p2 (26)
l
G (p) = (p) =
u3 I y p2 (27)
l
G (p) = (p) =
u4 I z p2 (28) Fig.2 Structure of PD Control System Based on Neural Network
Copyright IPCO-2018
ISSN 2356-5608
Conférence Internationale en Automatique & Traitement de Signal (ATS-2018)
Proceedings of Engineering and Technology – PET
Vol.35pp.40-46
(37)
Following this structure, there were implemented four
independent PD controllers, one for each angle of the attitude The backpropagation learning algorithm has been used to
(pitch, yaw, and roll) and one for the altitude (z). minimize the error function:
Through self-learning and adjusting the weights of the
neural network, we obtain optimal PD controller parameters. (38)
A basic structure of MLP is shown in Fig.3, which consists Where (t) and y(t) are respectively the desired and the
of a series of layers. In addition to the input and output nodes, actual outputs.
the network contains one or more hidden layers. The first The weight change takes into account the information of
layer has a connection from the network input. Each the previous changes of the network. So the rule of adaptation
subsequent layer has a connection from the previous layer. of the weights becomes (eqs. 39-40).
The final layer produces the network’s output [11].
In this study feed forward neural network with three layers (39)
and no inner feedback loop was used such that the neural (40)
network’s output follows the desired output. Then using neural
network to adjust the parameters of the conventional PD According to the gradient descent method, the connection
controller in the same way as when they are set by a human weights at the output layer and hidden layer are updated by
operator. The basic structure for estimating these parameters is the following equations:
detailed in Fig.4.
(41)
(42)
V. SIMULATION RESULTS
The mathematical dynamical model of the Quadcopter
vehicle is derived first in Matlab Simulink. The goal of this
analysis is to test how well the controllers can stabilize and
guide the Quadcopter to reach the desired response.
Fig.4. Structure of the neuronal PD control The proposed adaptive hybrid Neural network NNPD
and reference model RMPD controllers for stabilization of
The input vector of the network has two components: the Quadcopter were simulated. During simulation step input
desired output and the actual output. The bias net.b1 was used to analyze the response of attitude and altitude
weighting the input error will be associated with the factor P control of Quadcopter UAV. The control objectives are to
and the bias net.b2 weighting the input of the derivative of the reach and maintain Quadcopter at a desired altitude/attitude,
error will be associated with the factor D. The proportional such that the quadcopter can hover at a fixed point. In
and derivative gains are determined in real time by the neural this simulation, initially, ϕ, θ, ψ and z are set at 0. The
network. This approach is the direct application of traditional simulation times are set from 0 to 4 s. Desired ϕ, θ and ψ are
control techniques including an adaptive control method. The fixed to 1 radian, while desired z is set at 10 meters.
back-propagation neural network (BPNN) [9] with one In addition, to construct a neural network with three layers
sigmoid-type hidden layer and linear output layer was used of 1-2-1 structure, we select learning rate η=0.3 and number
during this work. of iteration at 100. The initial gains in the developed neural
The activation function of the hidden layer neurons is network are selected randomly. However, by putting the PD
hyperbolic tangent sigmoid transfer function: gains as threshold's weights and adjusting them using the
back-propagation learning algorithm, the desired bias in
the neural network can be fast obtained for achieving the
Copyright IPCO-2018
ISSN 2356-5608
Conférence Internationale en Automatique & Traitement de Signal (ATS-2018)
Proceedings of Engineering and Technology – PET
Vol.35pp.40-46
desired system output. The result shows that the desired TABLE II.
PD GAINS OPTIMISED BY REFERENCE MODEL METHOD
output has been well tracked. Kp Kd Settling Time (s)
The simulation shown in Fig.5-8, it is done for three axes Roll Angle 2.4178 0.3848 0.45
of Quadcopter which are roll, pitch and yaw, and the Pitch Angle 2.4178 0.3848 0.37
optimal parameters of PD controllers are presented in Tables Yaw angle 1.1948 0.1902 0.75
II and III. Altitude z 234 42.9 0.56
TABLE III.
PD GAINS OPTIMISED BY NEURAL NETWORK
Kp Kd Settling Time (s)
Roll Angle 5.4561 0.6849 0.3
Pitch Angle 6.5392 1.1968 0.5
Yaw angle 6.5546 0.9362 0.41
Altitude z 169.6365 22.4686 0.33
VI. CONCLUSIONS
In this paper, the application of an optimal PD
controller for the stabilization of Quadcopter UAV is
successfully demonstrated.
First, the mathematical model of the quadcopter is
introduced using Newton Euler formalism. Then, two control
Fig.8 Step response of altitude position
approaches using PD controller have been realized. A first,
Copyright IPCO-2018
ISSN 2356-5608
Conférence Internationale en Automatique & Traitement de Signal (ATS-2018)
Proceedings of Engineering and Technology – PET
Vol.35pp.40-46
the PD controller based on reference model is proposed [11] A. F. Caballero, M. L. Belmonte, R. Morales and J. A. Somolinos,
“Generalized Proportional Integral Control for an Unmanned
where the set of poles are placed in the desired closed-loop
Quadcopter”, International Journal Of Advanced Robotic Systems,
places. A second approach uses the principle of a PD Vol. 12, No 7, P. 85, 2015.
controller and uses a neural network to adapt the proportional, [12] Y. M. Chen, Y .L. He and M. F. Zhou, “Decentralized PID Neural
integral and derivative parameters. Finally, the proposed Network Control for a Quadcopter Helicopter Subjected to Wind
Disturbance”, Journal of Central South University, Vol. 22, No 1,
control scheme is applied to autonomous Quadcopter UAV.
P.168-179, 2015.
Concerning the last approach, a neuronal PD controller [13] S. Li, Y. Wang, J. Tan and Y. Zheng, “Adaptive Rbfnns/Integral
with adaptive coefficients for attitude and altitude stabilizing Sliding Mode Control for a Quadcopter Aircraft”, Neurocomputing,
flight control system has been studied and is successfully Vol. 216, P. 126-134, 2016.
[14] J. Muliadi and B. Kusumoputro, “Neural Network Control System of
simulated. The learning is done online with three layers and
UAV Altitude Dynamics and Its Comparison with the PID Control
back propagation algorithm. The use of neural networks has System”, Journal of Advanced Transportation, Vol. 2018, 2018.
been an effective means for determining PD parameters with [15] B. J. Emran and H. Najjaran, “Adaptive Neural Network Control of
avoiding the tedious manual tuning. Quadrotor System Under the Presence of Actuator Constraints”, 2017
IEEE International Conference on Systems, Man, and Cybernetics
Several validation analyses of these approaches have been
(SMC), Banff Center, Banff, Canada. P. 2619-2624, October 2017.
tested, particularly the step responses and the variable inputs [16] A. L. L. Salih, M. Moghavvemi, H. A. F. A F. Mohamed, And K. S. S.
responses with disturbances. Notice that the Quadcopter can Gaeid, “Modelling and PID Controller Design for a Quadcopter
reject the perturbation and the high performance response can Unmanned Air Vehicle,” IEEE Int. Conf. Autom. Qual. Test.
Robot., Vol. 1, P. 1–5, 2010.
be achieved by using the proposed control system and despite
[17] H. Bolandi, M. Rezaei, R. Mohsenipour, H. Nemati and S. M.
the nonlinearity present in the system the stability of the Smailzadeh, “Attitude control of a quadrotor with optimized PID
system can be guaranteed. controller”, Intelligent Control and Automation, Vol. 4, No 03, P. 335,
2013.
REFERENCES [18] F. Goodarzi, D. Lee, And T. Lee, “Geometric Nonlinear PID Control
of a Quadcopter UAV on Se (3),” Control Conference (ECC), 2013
European. IEEE, P. 3845-3850, 2013.
[1] J. C. V. Junior, J. C. De Paula, G. V. Leandro and M. C Bonfim, [19] I. Siti, M. Mjahed, H. Ayad and A. El Kari, “ New Designing
“Stability Control of a Quad-Rotor Using a PID Controller”, Brazilian Approaches for Quadcopter PID Controllers using Reference Model
Journal Of Instrumentation And Control, Vol. 1, No 1, P. 15-20, 2013. and Genetic Algorithm Techniques”, International Review of
[2] N. Aminurrashid, M. A. M. Basri, M. Zaharuddin and A. F. Z. Abidin, Automatic Control, Vol. 10 (3):240-248, 2017.
“Modelling and PSO Fine-Tuned PID Control of Quadcopter UAV,” [20] M. Fatan, B. Sefidgari, B. Lavi, and A. B. Vatankhah, “An Adaptive
International Journal on Advanced Science, Engineering and Neuro PID for Controlling the Altitude of Quadcopter Robot”,
Information Technology, Vol. 7, No 4, P. 1367-1373, 2017. Methods and Models in Automation and Robotics (MMAR), 18th
[3] E.H. Zheng, J.J. Xiong and J.L. Luo, “Second Order Sliding Mode International Conference on. IEEE, 2013. P. 662-665, 2013.
Control for a Quadcopter UAV,” Isa Transactions, Vol. 53, No 4, P. [21] Y. Song, S. Wu and Y.Yan, “ Development Of Self-Tuning Intelligent
1350-1356,2014. PID Controller Based on BPNN for Indoor Air Quality
[4] M. A. M. Basri, A.R. Husain and K.A. Danapalasingam, “Nonlinear Control,” International Journal of Emerging Technology and
Control of an Autonomous Quadcopter Unmanned Aerial Vehicle Advanced Engineering, Vol. 3, No 11, 2013.
Using Backstepping Controller Optimized by Particle Swarm [22] R. H. Alvarado, L. G. G .Valdovinos, T. S. Jiménez, A. G . Espinosa,
Optimization”. Journal Of Engineering Science & Technology Review, and F. F.Navarro, “Neural Network-Based Self-Tuning PID Control
Vol. 8, No 3, 2015. for Underwater Vehicles”. Sensors, Vol. 16, No 9, P. 1429, 2016.
[5] M. A. M. Basri, A. R. Husain and K. A. Danapalasingam, “GSA- [23] M. Mjahed, Commande des Systèmes, Lectures Notes, Ecole
Based Optimal Backstepping Controller with a Fuzzy Compensator Royale de l’Air, Marrakech, 2013
for Robust Control of an Autonomous Quadcopter UAV”, Aircraft [24] M. Mjahed, Asservissements Linéaires Continus, Lectures Notes,
Engineering and Aerospace Technology: Vol. 87, No 5, P. 493-505, Ecole Royale de l’Air, Marrakech, 2014
2015.
[6] Y. Yueneng and Y.Yan, “Attitude Regulation for Unmanned
Quadcopters using Adaptive Fuzzy Gain-Scheduling Sliding Mode
Control”. Aerospace Science and Technology, Vol. 54, P. 208-217,
2016.
[7] K. Endrowednes, T. Vesselenyi, S. Dzitac and R.C. Tarca , “PID and
Fuzzy-PID Control Model for Quadcopter Attitude with Disturbance
Parameter. International Journal of Computers Communications &
Control, Vol. 12, No 4, P. 519-532, 2017.
[8] A. Bousbaine, A. Bamgbose, G.T. Poyi and A. K. Joseph, “"Design of
Self-tuning PID Controller Parameters Using Fuzzy Logic Controller
for Quad-rotor Helicopter”, International Journal of Trend in
Research and Development (IJTRD), Vol.3, December 2016.
[9] L. M. Argentim, W. C. Rezende, P. E. Santos and R. A. Aguiar, “PID,
LQR and LQR-PID on a Quadcopter Platform,” Informatics,
Electronics & Vision (Iciev), 2013 International Conference On. Ieee,.
P. 1-6, 2013.
[10] Z. He and L. Zhao, “A Simple Attitude Control of Quadcopter
Helicopter based on Ziegler-Nichols Rules for Tuning PD
Parameters”, The Scientific World Journal, Vol. 2014, December 2014.
Copyright IPCO-2018
ISSN 2356-5608