Feedforward Neural Network Emulation of A PID Continuous-Time Controller For Quadcopter Attitude Digital Control
Feedforward Neural Network Emulation of A PID Continuous-Time Controller For Quadcopter Attitude Digital Control
Béchar, Algeria
Corresponding Author:
Baba Mohammed
Laboratory of Smart Grids and Renewable Energies (SRGE), University Tahri Mohammed Béchar
Béchar 08000, Algeria
Email: [email protected]
1. INTRODUCTION
A quadcopter is an aircraft intended to perform certain tasks, without a pilot on board. Quadcopters
are currently used in many military missions, civilian, photographing, and other applications that may endan-
ger human lives [1], [2], the increasing use and applications of quadcopters have opened up opportunities for
extensive and diverse research efforts to develop them. Environmental factors impacting Flight, which limit
control time, have confused aviation engineers for ages. Many quadcopter control designs have been proposed.
A collection of research offered approaches for a quadcopter controller employing linear control by making the
quadcopter working mechanism linear at the working point and in the case of a quadcopter hovering [3]-[7],
but these methods did not achieve stability when moving away from the working point, especially when the
quadcopter is exposed to external disturbances. This prompted researchers to use nonlinear control techniques
such as the backstepping method [8]-[11], and sliding mode [12]-[15], which requires system knowledge. A
Gaussian process, for example, is one learning technique that has been used in certain studies to actively esti-
mate the robot’s dynamics parameters and update the prediction model in real time [16]-[18]. Errors in model
and system parameters or model parameters might reduce controller performance or cause system instability.
Time-varying system characteristics produce many problems these models can’t overcome. Indirect adaptive
control methods like least-squares [19] fix coefficient errors based on the difference between reference and
response, but not the coefficients.
This study models the quadcopter’s dynamics and motion to obtain flight equations. feedforward
neural network (FFNN) controls roll, pitch, yaw, and altitude based on proportional integral derivative (PID)
input and output. MATLAB Simulink was used to simulate and display the controlled model.
2. QUADCOPTER CONFIGURATION
Quadcopter consists of two pairs of identical propellers, two rotating clockwise and two counter-
clockwise. These propellers are connected to motors driven by electronic speed controllers. By varying the
speed of each rotor, a quadcopter can generate the desired total thrust and torque. Quadcopter has a micro-
processor attached to an accelerometer and a gyroscope for orientation. A receiver linked to a quadcopter’s
microprocessor sends instructions, forces, and moments. Figure 1 shows the configuration of different motions
for the quadcopter.
3. QUADCOPTER MODELING
Modeling is the first and most significant step in designing an object’s control strategy since it helps
comprehend body specifications and constraints that limit control command application. Despite its mechan-
ical symmetry, a quadcopter is a non-linear model, for this, the Newton-Euler method was used to model
quadcopter [21].
Int J Pow Elec & Dri Syst, Vol. 14, No. 2, June 2023: 799–808
Int J Pow Elec & Dri Syst ISSN: 2088-8694 ❒ 801
i=N
X i=N
X
TΣ = Ti = b ωi2 (2)
i=1 i=1
Only the fan speeds can directly effect the quadcopter’s movement, so we must relate them to torques M1 , M2 , M3 .
X X
M1 = − l(T2 − T4 ) = −bl (ω22 − ω42 ) (3)
X X
M2 = l(T1 − T3 ) = bl (ω12 − ω32 ) (4)
X X
M3 = (−T1 + T2 − T3 + T4 ) = d (−ω12 + ω22 − ω32 + ω42 ) (5)
Where Ti is the thrust of the rotor I where i = {1, 2, 3, 4} ,N = 4, the (-) sign signifies lift force is opposing
body frame vertical axis.
ζ̇ = R.η (9)
cψcθ cψsθsϕ − cϕsψ cψsθcϕ + sψsϕ
R = sψcθ sψsθsϕ + cψcϕ sψsθcϕ − sϕcψ (10)
−sθ sϕcθ cθcϕ
where c is cos and s is sin. Substituting the relations and expressing them in the inertial frame obtains the
quadcopter’s linear motion equations:
1
Ẍ = − (sin ψ. sin ϕ + cos ψ. sin θ. cos ϕ).TΣ (11)
m
1
Ÿ = − (− cos ψ. sin ϕ + sin ψ. sin θ. cos ϕ).TΣ (12)
m
1
Z̈ = − . cos θ. cos ϕ.TΣ + g (13)
m
Feedforward neural network emulation of a PID continuous-time controller for ... (Baba Mohammed)
802 ❒ ISSN: 2088-8694
I ω̇ = M − ω × Iω (14)
T
where M the torques applied to the quadcopter: M = M1 M2 M3 . I is the inertia matrix defined
by (15).
Ixx 0 0
I = 0 Iyy 0 (15)
0 0 Izz
The matrix Wη−1 makes it possible to transform the angular velocity ω from the body frame to the
inertial frame:
η̇ = Wη−1 .ω (16)
p 1 0 −sθ ϕ̇
q = 0 cϕ sθcθ . θ̇
(17)
r 0 −sϕ cϕcθ ψ̇
by substituting the relations and writing them in the inertial frame, we find the equations of angular motion of
the quadcopter:
qr.(Iyy − Izz ) 1
ṗ = + .M1 (18)
Ixx Ixx
qr.(Izz − Ixx ) 1
q̇ = + .M2 (19)
Iyy Iyy
qr.(Ixx − Iyy ) 1
ṙ = + .M3 (20)
Izz Izz
now we have a summary of the nonlinear quadcopter state-space model as:
ẋ = f (x, u) (21)
where x is the state variables vector and u is the state inputs vector.
T
x = X ẊY Ẏ Z Żϕθψpqr (22)
So:
x2
ẋ1 1
ẋ2 −m (sx11 .sx7 + cx11 .sx9 .cx7 ).U1
x4
ẋ3
− 1 (−cx .sx + sx .sx .cx ).U
ẋ4 m 11 7 11 9 7 1
ẋ5 x6
1
−m
ẋ6 .cx9 .cx7 .U1 + g
= x + sx . tan x .x + cx . tan x .x (23)
ẋ7 10 7 8 11 7 8 12
cx7 .x11 − sx7 .x12
ẋ8
sx . sec x .x + cx . sec x .x
ẋ9 7 8 11 7 8 12
x1 0.x1 2.(Iyy −Izz ) 1
+ Ixx .U2
ẋ10 I xx
x10 .x12 .(Izz −Ixx )
1
ẋ11 + .U3
Iyy Iyy
ẋ12 x10 .x11 .(Ixx −Iyy ) 1
+ Izz .U4
Izz
thus, we have obtained the basic equations that will be used in the simulation and design of the controller.
Int J Pow Elec & Dri Syst, Vol. 14, No. 2, June 2023: 799–808
Int J Pow Elec & Dri Syst ISSN: 2088-8694 ❒ 803
4. CONTROLLERS DESIGN
A process is usually controlled by a standard controller (PID and RST) [21], [22]. An identifier neural
network may approximatively learn the controller’s inputs and outputs offline as we see in Figure 2. The neural
network controller replaces the conventional controller after learning. This architecture’s purpose is not to
improve the performance of the conventional controller, but to overcome hardware implementation limits.
Z
M1 = KP,ϕ (ϕdes − ϕ) + KI,ϕ (ϕdes − ϕ) + KD,ϕ (pdes − p) (25)
Z
M2 = KP,θ (θdes − θ) + KI,θ (θdes − θ) + KD,θ (q des − q) (26)
Z
M3 = KP,ψ (ψ des − ψ) + KI,ψ (ψ des − ψ) + KD,ψ (rdes − r) (27)
The tuning method was applied separately to each axis over P, I, and D gains. The manual method (tweaking
until a required response is achieved) is selected. Although there are several adjustment methods available. As
a result, we obtained the following gains in Table 1.
a = f (Wp + b) (28)
Feedforward neural network emulation of a PID continuous-time controller for ... (Baba Mohammed)
804 ❒ ISSN: 2088-8694
Int J Pow Elec & Dri Syst, Vol. 14, No. 2, June 2023: 799–808
Int J Pow Elec & Dri Syst ISSN: 2088-8694 ❒ 805
Figure 4. FFNN architecture of two inputs, one output, and ten hidden layers
Figure 6. The roll angle response w Figure 7. The pitch angle response
Feedforward neural network emulation of a PID continuous-time controller for ... (Baba Mohammed)
806 ❒ ISSN: 2088-8694
Figure 10. The control signal M1 Figure 11. The control signal M2
Figure 12. The control signal M3 Figure 13. The control signal TΣ
Int J Pow Elec & Dri Syst, Vol. 14, No. 2, June 2023: 799–808
Int J Pow Elec & Dri Syst ISSN: 2088-8694 ❒ 807
6. CONCLUSION
In conclusion, it can be said that the use of the neural network has contributed to the realization of
the control of the quadcopter model, in addition, the following can be concluded: i) the design of the advanced
FFNN is simple and easy. If sufficient training data is available it is possible to build easily a FFNN with the
correct selection of the artificial neural network architecture; ii) the quadcopter was able to maintain a stable
attitude; iii) the quadcopter was able to respond quickly and accurately; and iv) the quadcopter was able to
achieve a high level of performance, with minimal overshoot or undershoot in its thrust, roll, pitch, and yaw
control, indicating that the controller was able to optimize its control strategy for maximum performance. The
work can be complemented using other advanced control techniques such as control fuzzy logic and adaptive
neuro-fuzzy inference systems (ANFIS) control.
ACKNOWLEDGEMENT
The authors thank the Algerian research direction DGRSDT, and the Smart Grids and Renewable
Energies Laboratory for supporting this research.
REFERENCES
[1] M. Hassanalian and A. Abdelkefi, “Classifications, applications, and design challenges of drones: Aa review,” Progress in Aerospace
Sciences, vol. 91, pp. 99-131, 2017, doi: 10.1016/j.paerosci.2017.04.003.
[2] A. Mairaj, A. I. Baba, and A. Y. Javaid, “Application specific drone simulators: recent advances and challenges,” Simulation
Modelling Practice and Theory, vol. 94, pp. 100-117, 2019, doi: 10.1016/j.simpat.2019.01.004.
[3] A. Noordin, M. A. M. Basri, and Z. Mohamed, “Simulation and experimental study on PID control of a quadrotor MAV with
perturbation,” Bulletin of Electrical Engineering and Informatics, vol. 9, no. 5, pp. 1811-1818, 2020, doi: 10.11591/eei.v9i5.2158.
[4] H. Suresh, A. Sulficar, and K. Desai, “Design of adaptive control algorithm for quadrotor with multirotor configuration,” Interna-
tional Journal of Innovative Technology and Exploring Engineering (IJITEE), vol. 8, no. 7S, pp. 368-371, 2019, doi: 10.35940/iji-
tee.K4061.0787S19.
[5] M. N. Shauqee, P. Rajendran, and N. M. Suhadis, “An effective proportional-double derivative-linear quadratic regu-
lator controller for quadcopter attitude and altitude control,” Automatika, vol. 62, no. 3-4, pp. 415-433, 2021, doi:
10.1080/00051144.2021.1981527.
[6] F. Rinaldi, S. Chiesa, and F. Quagliotti, “Linear quadratic control for quadrotors UAVs dynamics and formation flight,” Journal of
Intelligent and Robotic Systems, vol. 70, pp. 203–220, 2013, doi: 10.1007/s10846-012-9708-3.
[7] D. A. Mercado, R. Castro, and R. Lozano, “Quadrotors flight formation control using a leader-follower approach,” in 2013 European
Control Conference (ECC), 2013, pp. 3858-3863, doi: 10.23919/ECC.2013.6669637.
[8] A. T. Nguyen, N. Xuan-Mung, and S. Hong, “Quadcopter adaptive trajectory tracking control: a new approach via backstepping
technique,” Applied Sciences, vol. 9, no. 18, p. 3873, 2019, doi: 10.3390/app9183873.
[9] M. Lungu, “Auto-landing of UAVs with variable centre of mass using the backstepping and dynamic inversion control,” Aerospace
Science and Technology, vol. 103, p. 105912, 2020, doi: 10.1016/j.ast.2020.105912.
[10] W. Xie, D. Cabecinhas, R. Cunha, and C. Silvestre, “Adaptive backstepping control of a quadcopter with uncertain vehicle
mass, moment of inertia, and disturbances,” IEEE Transactions on Industrial Electronics, vol. 69, no. 1, pp. 549–559, 2022, doi:
10.1109/TIE.2021.3055181.
[11] A. K. Bhatia, J. Jiang, Z. Zhen, N. Ahmed, and A. Rohra, “Projection modification based robust adaptive backstepping control for
multipurpose quadcopter UAV,” IEEE Access, vol. 7, pp. 154121–154130, 2019, doi: 10.1109/ACCESS.2019.2946416.
[12] H. L. N. N. Thanh and S. K. Hong, “Quadcopter robust adaptive second order sliding mode control based on PID sliding surface,”
IEEE Access, vol. 6, pp. 66850–66860, 2018, doi: 10.1109/ACCESS.2018.2877795.
[13] N. P. Nguyen and S. K. Hong, “Fault-tolerant control of quadcopter uavs using robust adaptive sliding mode approach,” Energies,
vol. 12, no. 1, pp. 95, 2019, doi: 10.3390/en12010095.
[14] V. K. Tripathi, L. Behera, and N. Verma, “Design of sliding mode and backstepping controllers for a quadcopter,” in 2015 39th
National Systems Conference (NSC), 2015, pp. 1-6, doi: 10.1109/NATSYS.2015.7489097.
[15] J. Chaoraingern, V. Tipsuwanporn, and A. Numsomran, “Modified adaptive sliding mode control for trajectory tracking of mini-
drone quadcopter unmanned aerial vehicle,” International Journal Intelligent Engineering and Systems, vol. 13, no. 5, pp. 145-158,
2020, doi: 10.22266/ijies2020.1031.14.
[16] M. Mehndiratta and E. Kayacan, “Gaussian process-based learning control of aerial robots for precise visualization of geological
outcrops,” in 2020 European Control Conference (ECC), 2020, pp. 10-16, doi: 10.23919/ecc51009.2020.9143655.
[17] J. Caldwell and J. A. Marshall, “Towards efficient learning-based model predictive control via feedback linearization and Gaussian
process regression,” in 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2021, pp. 4306-4311,
doi: 10.1109/IROS51168.2021.9636755
[18] K. Y. Chee, T. Z. Jiahao, and M. A. Hsieh, “KNODE-MPC: a knowledge-based data-driven predictive control framework for aerial
robots,” IEEE Robotics and Automation Letters, vol. 7, no. 2, pp. 2819-2826, Apr. 2022, doi: 10.1109/LRA.2022.3144787.
[19] M. Dhaybi and N. Daher, “Real-time estimation of the inertia tensor elements of a quadcopter hover platform,” in 2019 IEEE/ASME
International Conference on Advanced Intelligent Mechatronics (AIM), 2019, pp. 1347-1352, doi: 10.1109/AIM.2019.8868641.
[20] G. P. Rible, N. A. Arriola, and M. Ramos, “Modeling and implementation of quadcopter autonomous flight based on alternative
methods to determine propeller parameters,” Advances in Science, Technology and Engineering Systems, vol. 5, no. 5, pp. 727-741,
Oct. 2020, doi: 10.25046/AJ050589.
Feedforward neural network emulation of a PID continuous-time controller for ... (Baba Mohammed)
808 ❒ ISSN: 2088-8694
[21] A. Alkamachi and E. Ercelebi, “A proportional derivative sliding mode control for an overactuated quadcopter,” Proceedings of
the Institution of Mechanical Engineers, Part G: Journal of Aerospace Engineering, 2019, vol. 233, no. 4, pp. 1354-1363, doi:
10.1177/0954410017751739.
[22] I. Siti, M. Mjahed, H. Ayad, and A. El Kari, “New trajectory tracking approach for a quadcopter using genetic algorithm and
reference model methods,” Applied Sciences, vol. 9, no. 9, p. 1780, Apr. 2019, doi: 10.3390/app9091780.
[23] B. Aissa, T. Hamza, G. Yacine, and N. Mohamed, “Impact of sensorless neural direct torque control in a fuel cell traction sys-
tem,” International Journal of Electrical and Computer Engineering (IJECE), vol. 11, no. 4, pp. 2725–2732, Aug. 2021, doi:
10.11591/ijece.v11i4.pp2725-2732.
[24] S. J. Hammoodi, K. S. Flayyih, and A. R. Hamad, “Design and implementation speed control system of DC motor based on PID
control and MATLAB simulink,” International Journal of Power Electronics and Drive Systems, vol. 11, no. 1, pp. 127–134, 2020,
doi: 10.11591/ijpeds.v11.i1.pp127-134.
[25] M. A. Ibrahim, A. K. Mahmood, and N. S. Sultan, “Optimal PID controller of a brushless DC motor using genetic algorithm,”
International Journal of Power Electronics and Drive Systems, vol. 10, no. 2, pp. 822–830, 2019, doi: 10.11591/ijpeds.v10.i2.pp822-
830.
[26] H. Park and S. Kim, “Hardware accelerator systems for artificial intelligence and machine learning,” Advances in Computers, vol.
122, pp. 51–95, Jan. 2021, doi: 10.1016/BS.ADCOM.2020.11.005.
BIOGRAPHIES OF AUTHORS
Baba Mohammed received his B.Sc. from Ahmed Draya University, Adrar, Algeria,
in 2017, and M.Sc. degrees in Embedded Systems from Ferhat Abbas 1 University, Setif, Alge-
ria, in 2019, respectively. Currently, he is a Ph.D. student at Smart Grids, and Renewable energies
Laboratory, Tahri Mohamed, Béchar, Algeria. His research interests include quadcopter systems,
system modeling and control, and AI control. He can be contacted at email: baba.mouhamed@univ-
bechar.dz.
Bennaceur Said was born in Oran, Algeria, in 1969. He obtained a B.Sc. physics from
the higher school of teachers in Saida in 1993, the Magister degree from the University of Béchar
in 2006 with a specialty in energy physics and the Ph.D. from the University of Béchar in 2017 and
2021 respectively. His research areas are control, renewable energies and thermal systems. He can
be contacted at email: [email protected].
Bounaama Fatah received the Electronics Engineering degree from the University of Sci-
ences and Technology of Oran (Algeria) in June 1988 and an M.Eng. and Ph.D. from the University
of Béchar (Algeria) in 2001 and 2010 respectively. His scientific interests are simulation, identi-
fication, control, and the implementation of embedded system applications in the agriculture and
horticulture environment of a greenhouse. He can be contacted at email: [email protected].
Int J Pow Elec & Dri Syst, Vol. 14, No. 2, June 2023: 799–808