0% found this document useful (0 votes)
20 views11 pages

Nonlinear Kalman Filter For Gyroscopic and Accelerometer Noise Rejection of An Unmanned Aerial Vehicle Control Strategy

This study addresses timing issues inherent in traditional proportional-integral-derivative (PID) controllers for drone angle control and introduces an innovative solution, the adaptive PID flight controller, aimed at optimizing PID gains for improved performance in terms of speed, accuracy, and stability. To enhance the controller's robustness against noise and accurately estimate the system's state, a Kalman filter is incorporated. This filtering mechanism is designed to reject noise and provi
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)
20 views11 pages

Nonlinear Kalman Filter For Gyroscopic and Accelerometer Noise Rejection of An Unmanned Aerial Vehicle Control Strategy

This study addresses timing issues inherent in traditional proportional-integral-derivative (PID) controllers for drone angle control and introduces an innovative solution, the adaptive PID flight controller, aimed at optimizing PID gains for improved performance in terms of speed, accuracy, and stability. To enhance the controller's robustness against noise and accurately estimate the system's state, a Kalman filter is incorporated. This filtering mechanism is designed to reject noise and provi
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/ 11

IAES International Journal of Robotics and Automation (IJRA)

Vol. 13, No. 2, June 2024, pp. 194~204


ISSN: 2722-2586, DOI: 10.11591/ijra.v13i2.pp194-204  194

Nonlinear Kalman filter for gyroscopic and accelerometer noise


rejection of an unmanned aerial vehicle control strategy

Wassim Arfa1, Chiraz Ben Jabeur2, Mourad Fathallah3, Hassene Seddik3


1
Department of Electrical Engineering, Ecole Nationale d’Ingénieurs de Carthage, University of Carthage, Tunis, Tunisia
2
Department of electrical engineering, Institue Superieur d’Informatique, University Tunis Manar, Ariana, Tunisia
3
Department of Electrical Engineering, Ecole Nationale Supéieur d’Ingénieurs de Tunis, University of Tunis, Tunis, Tunisia

Article Info ABSTRACT


Article history: This study addresses timing issues inherent in traditional proportional-
integral-derivative (PID) controllers for drone angle control and introduces
Received Dec 18, 2023 an innovative solution, the adaptive PID flight controller, aimed at optimizing
Revised Mar 4, 2024 PID gains for improved performance in terms of speed, accuracy, and
Accepted Apr 21, 2024 stability. To enhance the controller's robustness against noise and accurately
estimate the system's state, a Kalman filter is incorporated. This filtering
mechanism is designed to reject noise and provide precise state estimation,
Keywords: thereby contributing to the overall effectiveness of the adaptive PID flight
controller in managing altitude dynamics for unmanned aerial vehicles
Angle control (UAVs). The comparative methodology evaluates three configurations: a
Controller single PID controller for all three angles, two PID controllers dedicated to
Kalman filter pitch/roll and yaw angles separately, and three PID sub-controllers for each
Noise angle (pitch, roll, and yaw). The study seeks to identify the most effective
Optimization PID configuration in terms of stability, responsiveness, and accuracy while
Proportional-integral-derivative highlighting the added benefits of noise rejection and state estimation
control through the Kalman filter. This integrated approach showcases innovation
Simulation and effectiveness, introducing a comprehensive solution not explored in
previous research.
This is an open access article under the CC BY-SA license.

Corresponding Author:
Wassim Arfa
Department of Electrical Engineering, Ecole Nationale d’Ingénieurs de Carthage, University of Carthage
Tunis, Tunisia
Email: [email protected]

1. INTRODUCTION
Quadcopters, essential for high-risk tasks, utilize proportional-integral-derivative (PID) controllers
for precise angle control [1]–[4]. This study proposes integrating a Kalman filter [5] before PID controllers to
address noise and state estimation challenges drawing inspiration from prior research [6]–[8], it examines a
6-DOF quadcopter model, dynamic response, and PID control algorithm. Three PID controllers are dedicated
to specific angles, offering a comparative analysis against single or dual controllers. Evaluation includes
stability, accuracy, and disturbance avoidance, utilizing simulations and comparative techniques like genetic
algorithms (GA) [9], crow search algorithm (CSA) [10], particle swarm optimization (PSO) [11], Ziegler-
Nichols (ZN) [12], harmony search algorithm [13], and water cycle algorithm [14]. The integration of
Kalman filter improves the control system performance and allows a more effective utilization in applications
requiring precise angle control.
The paper proceeds as follows: Section 2 delves into the mathematical model based on Newton-
Euler. Section 3 gives an overview of the Kalman filter characters and applications. Section 4 investigates the
three applied control methods that respectively integrate the Kalman filter. Section 5 draws on the simulation

Journal homepage: http://ijra.iaescore.com


IAES Int J Rob & Autom ISSN: 2722-2586  195

and optimization of the PID gains in the drone. The main findings and discussion are presented in Section 6.
The study mainly finds out that precise tuning of the PID controller parameters is highly important to achieve
optimal performance in terms of stability, responsiveness, and control accuracy. Indeed, the inclusion of three
adaptive PID controllers, complemented by a Kalman filter, results in superior speed, accuracy, and stability
compared to previous approaches, offering valuable insights for optimizing drones across various applications
that demand precise angle control.

2. THE MATHEMATICAL MODEL BASED ON NEWTON-EULER THEORY


This section provides a general overview of the quadcopter used in this paper, the mathematical
model of the UAV, and the control structure that will accordingly be presented in Figure 1 [15]. The motors
are numbered clockwise, with motor 1 at the front of the device relative to the reference frame 𝐹𝑏 [16].
Unlike motors 2 and 4, motors 1 and 3 rotate clockwise [17].

Figure 1. Direction of the rotation of rotors [17]

The equations of forces applied to the quadcopter and the moments acting on the quadrotor using the
Newton-Euler formulation and the dynamic system model are shown in (1) [18],

𝜁̇ = 𝑣
𝑚𝜁 ̈ = 𝐹𝑓 + 𝐹𝑡 + 𝐹𝑔
(1)
̇
𝑅 = 𝑅𝑆(𝛺)
{ 𝐽𝛺 = −𝛺𝛬𝐽𝛺 ̇ + 𝑀𝑓 − 𝑀𝑎 − 𝑀𝑔ℎ

where
𝜁 : The vector representing the position of the quadrotor
m : The total mass of the quadrotor
Ω : The angular velocity expressed in the fixed reference frame
R : The rotation matrix
Λ : The vector product

2.1. Equations of the translational motion for drone control


After presenting the force equations in the previous sections, we can now complete the Quad-rotor
model by applying Newton's second law of linear motion, as formulated in (2).

𝑚𝜁 ̈ = 𝐹𝑡 + 𝐹𝑓 + 𝐹𝑔 (2)

As we replace each force with its corresponding formula, we obtain (3).

𝑥̈ cos𝜙cos𝜓sin𝜃 + sin𝜙sin𝜓 𝐾𝑓𝑡𝑥 𝑥̇ 0


m [𝑦̈ ] = [cos𝜙sin𝜓sin𝜃 − sin𝜙cos𝜓] ∑41 𝐹𝑖 − [𝐾𝑓𝑡𝑦 𝑦̇ ] + [ 0 ] (3)
𝑧̈ cos𝜙cos𝜃 𝐾𝑓𝑡𝑧 𝑧̇ −mg

Nonlinear Kalman filter for gyroscopic and accelerometer noise rejection … (Wassim Arfa)
196  ISSN: 2722-2586

We obtain the differential equations as (4) that define the translational coefficients.

1 𝐾𝑓𝑡𝑥
𝑥̈ = (cos𝜙cos𝜓sin𝜃 + sin𝜙sin𝜓)(∑41 𝐹𝑖 ) − 𝑥̇
𝑚 𝑚
1 𝐾𝑓𝑡𝑦
𝑦̈ = (cos𝜙sin𝜓cos𝜃 + sin𝜙cos𝜓)(∑41 𝐹𝑖 ) − 𝑦̇ (4)
𝑚 𝑚
1 4 𝐾𝑓𝑡𝑧
{ 𝑧̈ = 𝑚 (cos𝜙cos𝜃)(∑1 𝐹𝑖 ) − 𝑚
𝑧̇ − g

2.2. Equations of the rotational motion for drone control


Applying the same principle of Newton to the case of rotation, we get the (5)

𝐽𝛺̇ = −𝛺𝛬𝐽𝛺 + 𝑀𝑓 − 𝑀𝑎 − 𝑀𝑔ℎ (5)

When we replace each moment with its corresponding expression (6).

𝐼𝑥 0 0 𝜙̈ 𝜙̇ 𝐼𝑥 0 0 𝜙̇ 𝐽𝑟 𝛺̅𝑟 𝜃̇ 𝐾𝑓𝑎𝑥 𝜙̇ 2 𝑙𝑏(𝑤42 − 𝑤22 )


[ 0 𝐼𝑦 0 ] [ 𝜃̈ ] = − [ 𝜃̇ ] 𝛬 ([ 0 𝐼𝑦 0 ] [ 𝜃̇ ]) − [−𝐽𝑟 𝛺̅𝑟 𝜃̇] − [ 𝐾𝑓𝑎𝑦 𝜃̇ 2 ] + [ 𝑙𝑏(𝑤32 − 𝑤12 ) ] (6)
𝐼
00 𝑧 𝜓 ̈ 𝜓 ̇ 𝐼
00 𝑧 𝜓 ̇ 0 𝐾 𝜓̇ 2 𝑙𝑑(𝑤1 − 𝑤22 + 𝑤32 − 𝑤42 )
2
𝑓𝑎𝑧

We then obtain the differential equations defining the rotational motion as in (7).

𝐼𝑥 𝜙̈ = −𝜃̇𝜓̇(𝐼𝑧 − 𝐼𝑦 ) − 𝐽𝑟 𝛺̅𝑟 𝜃̇ − 𝐾𝑓𝑎𝑥 𝜙̇ 2 + 𝑙𝑏(𝑤42 − 𝑤22 )


{ 𝐼𝑦 𝜃̈ = 𝜙̇𝜓̇(𝐼𝑧 − 𝐼𝑥 ) − 𝐽𝑟 𝛺̅𝑟 𝜃̇ − 𝐾𝑓𝑎𝑥 𝜃̇ 2 + 𝑙𝑏(𝑤32 − 𝑤12 ) (7)
𝐼𝑧 𝜓̈ = 𝜙̇𝜃̇(𝐼𝑦 − 𝐼𝑥 ) − 𝐾𝑓𝑎𝑧 𝜓 + ̇2 𝑙𝑑(𝑤12 − 𝑤22 + 𝑤32 − 𝑤42 )

with

𝐼 −𝐼 𝐽𝑟 𝐾 𝑙𝑏
𝜙̈ = −𝜃̇𝜓̇ 𝑧 𝑦 − 𝛺̅𝑟 𝜃̇ − 𝑓𝑎𝑥 𝜙̇ 2 + (𝑤42 − 𝑤22 )
𝐼𝑥 𝐼𝑥 𝐼𝑥 𝐼𝑥
𝐼 −𝐼 𝐽𝑟 𝐾 𝑙𝑏
𝜃̈ = 𝜙̇𝜓̇ 𝑧 𝑥 − 𝛺̅𝑟 𝜃̇ − 𝑓𝑎𝑦 𝜃̇ 2 + (𝑤32 − 𝑤12 )
𝐼𝑦 𝐼𝑦 𝐼𝑦 𝐼𝑦
𝐼𝑦 −𝐼𝑥 𝐾𝑓𝑎𝑧 𝑙𝑑
𝜓̈ = 𝜙̇𝜃̇ − 𝜓̇ 2 + (𝑤12 − 𝑤22 + 𝑤32 − 𝑤42 )
𝐼𝑧 𝐼𝑧 𝐼𝑧 (8)
1 𝐾𝑓𝑡𝑥
𝑥̈ = (cos𝜙cos𝜓sin𝜃 + sin𝜙sin𝜓)(∑41 𝐹𝑖 ) − 𝑥̇
m m
1 𝐾𝑓𝑡𝑦
𝑦̈ = (cos𝜙sin𝜓cos𝜃 + sin𝜙cos𝜓)(∑41 𝐹𝑖 ) − 𝑦̇
m m
1 4 𝐾𝑓𝑡𝑧
{ 𝑧̈ = m (cos𝜙cos𝜃)(∑1 𝐹𝑖 ) − m
𝑧̇ − g

3. KALMAN FILTER
The Kalman filter, named after Rudolf E. Kálmán, is a powerful tool in estimation and signal
processing and is widely used in navigation, robotics, and finance [5]. It optimizes predictions by estimating
a system's hidden state amidst noise and uncertainties, enhancing accuracy through current measurements
and error correction. Particularly effective in linear equations and real-time estimation, it filters out noisy
information and improves state estimates. In challenging scenarios like adjusting PID controller parameters,
the Kalman filter removes noise and extracts true signals for feedback. Its versatility extends to offering
unbiased estimation for multi-input, non-stationary, and time-varying systems. Its recursive algorithm is
well-suited for computer implementation, utilizing state equations and initial values for accurate estimation
of real signal values.

𝑥(𝑡) = 𝐴𝑥(𝑡) + 𝐵𝑢(𝑡) + 𝑀𝑤(𝑡), 𝑇ℎ𝑒𝑠𝑡𝑎𝑡𝑒𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛


{ (9)
𝑦(𝑡) = 𝐶𝑥(𝑡) + 𝐷𝑢(𝑡) + 𝑣(𝑡), 𝑇ℎ𝑒𝑚𝑒𝑠𝑢𝑟𝑚𝑒𝑛𝑡𝑒𝑞𝑢𝑎𝑡𝑖𝑜𝑛

In the formulation of the Kalman filter, the state equation represents the system's state vector,
denoted as 𝑥(𝑡), where A is the system transition matrix, 𝑢(𝑡) is the input vector, 𝐵 is the control distribution
matrix, and w(t) is the random Gaussian noise vector (representing system noise) characterized by a zero

IAES Int J Rob & Autom, Vol. 13, No. 2, June 2024: 194-204
IAES Int J Rob & Autom ISSN: 2722-2586  197

mean and a known covariance structure, with 𝑀 being the transition matrix for the system noise. In the
measurement equation, 𝑦(𝑡) signifies the measurement vector, 𝐶 is the measurement matrix, and
𝑣(𝑡) represents the measurement noise vector, which also follows a Gaussian distribution with a zero mean
and known covariance structure. It is essential to note that there is no correlation between the system noise
𝑤(𝑡) and the measurement noise 𝑣(𝑡). The core objective of the Kalman filter is to estimate the true signal
from a disturbed signal exhibiting a Gaussian distribution, aiming to minimize the discrepancy between the
two signals.

4. OPTIMAL PID GAINS IDENTIFICATION


This section discusses the application of PID controller gains to UAVs, starting with single PID
controller optimization, followed by two and three PID controllers. Existing controllers prioritize trajectory
tracking performance and stability, but this can lead to higher energy consumption and reduced battery
lifespan. Future controllers must consider these hidden costs along with factors like safety, reliability, and
maintenance. The objective here extends beyond conventional PID control to minimize control error,
reducing battery consumption and increasing autonomy. Strategies to minimize trajectory error are presented,
involving manual PID gain refinement for each drone angle through an iterative process. Initial gain
adjustments are made by a factor of 1 and further refined by 0.1 based on performance analysis from flight
tests. This iterative and manual refinement process optimizes the control performance of the drone's altitude
dynamics by precisely adjusting gains for each angle. This method involves iteratively refining PID gains for
each angle of the drone, gradually enhancing stability and accuracy, and improving response to altitude
command variations [19].
In this section, we discuss the PID controller, focusing on simplified models. The main objective is
to design an adaptive PID controller for the flight of a Quad-rotor drone. The controller utilizes a control
input, denoted as 𝑢, to regulate the position and angle of the drone according to a reference input [20]. The
PID control law consists of three basic feedback control actions: proportional, integral, and derivative. The
related gains are denoted as 𝐾𝑝 , 𝐾𝑝 , and 𝐾𝑑 . The mathematical representation of the PID controller is in (10).

d
𝑢(𝑡) = K p 𝑒(𝑡) + K i ∫ 𝑒(𝑡)𝑑𝑡 + K d 𝑒(𝑡) (10)
𝑑𝑡

with 𝐾𝑝 the proportional gain, 𝐾𝑖 the integral gain, and 𝐾𝑑 the derivative gain, 𝑒(𝑡) can be formulated as a
function of the error:

𝑒(𝑡) = 𝑠𝑝 − 𝑝𝑣 (𝑡) (11)

where 𝑠𝑝 is the setpoint or desired position and 𝑝𝑣 (𝑡) is the process variable at the instantaneous moment
according to 𝑠𝑝 [21]–[23].

4.1. A single PID controller optimization


Figure 2 depicts the PID controller block as a key component in the drone control loop, receiving a
setpoint value and generating an output command based on error. To enhance robustness and accuracy, a
Kalman filter is introduced before the PID controller, filtering noise from sensor measurements and improving
state estimation. This refined state estimation allows for a more precise error assessment by the PID controller,
enabling more effective utilization of its terms. With this augmented control loop, the PID controller can
anticipate and correct future errors, facilitating precise setpoint attainment. The addition of the Kalman filter
improves the control system's resilience to disturbances, ensuring reliable and accurate drone operation [24].

Figure 2. Control system for a single PID


Nonlinear Kalman filter for gyroscopic and accelerometer noise rejection … (Wassim Arfa)
198  ISSN: 2722-2586

The integration of a Kalman filter within the single PID controller approach for regulating all three
angles of the drone serves as a crucial preprocessing step. By filtering disturbances to gyroscopes and
accelerometers, it enhances estimation of the drone's state variables, addressing challenges associated with
sensor measurements. This effectively mitigates noise and uncertainties, improving the control system's
robustness and precision. With reduced noise influence on sensor measurements, the Kalman filter enables
more accurate error computation by the PID controller. This refined error calculation leads to more reliable
and stable output commands for coordinated orientation control. Thus, integrating the Kalman filter aligns
with the goal of simplifying the control system while enhancing accuracy and responsiveness.

4.2. A two PID controllers’ architecture


Figure 3 depicts the drone's control system with two PID blocks, PID 1 for roll and pitch, and PID 2
for yaw. PID controllers compare setpoint values to current measurements and generate output commands for
motor adjustment, ensuring stable flight and precise maneuverability across all axes. The independent PID
controller for yaw provides autonomous control over directional changes. To optimize controller performance,
PID gains are adjusted based on drone dynamics and external conditions. Besides, a Kalman filter preprocesses
data to enhance resilience against noise and uncertainties, improving overall system performance.

Figure 3. Control system with two PID controllers

4.3. A three PID controllers’ architecture


Figure 4 illustrates a control system with three dedicated PID controllers, each regulating a specific
angle of the drone. PID 1 controls roll, PID 2 controls pitch, and PID 3 controls yaw. Each controller
compares desired angles to current measurements, calculates errors, and generates output commands to adjust
motors accordingly. To enhance system robustness, a Kalman filter is integrated before the PID controllers,
refining sensor measurements from gyroscopes and accelerometers and reducing noise and uncertainties.
This refined state estimation improves error calculation accuracy by PID controllers, resulting in more
precise output commands and adherence to setpoints. Thus, the Kalman filter integration enhances the control
system's responsiveness and overall performance.

Figure 3. Control system with three PID controllers

5. SIMULATION MODEL
This section presents simulation and experimental results evaluating the performance of the
proposed PID controller design. The subsequent part includes a simulation of our control approach applied to
the quadcopter dynamic model. The chosen model aims to stabilize the drone by reaching an equilibrium
state with constant or zero translation coordinates and orientation angles. To achieve this purpose, PID

IAES Int J Rob & Autom, Vol. 13, No. 2, June 2024: 194-204
IAES Int J Rob & Autom ISSN: 2722-2586  199

control is employed as the primary control technique, determining control parameters for each coordinate.
Considering the digital control of the quadcopter, we opted for designing a discrete controller using
MATLAB, based on the system's non-linearity. The previous and current sections offer insights into the
discretization of the system performed during PID controller design based on simplified assumptions.

5.1. Model presentation and parameters


Figure 4 illustrates the complete architecture of the quadcopter simulation model in MATLAB. The
model considers the quadcopter as a rigid body with a constant mass and symmetric geometry aligned with
the principal axis of inertia, in a plus (+) configuration. The motors are depicted in two different colors to
indicate the required synchronization that ensures the stability of the drone on the yaw axis.

Figure 4. Quadcopter model

Table 1 lists the different parameters applied in the simulations. The physical parameters of the
quadcopter are used for the simulation tests as initial conditions in the quadcopter's dynamic model. Besides,
an adaptive control is developed to regulate the quadcopter's rotational dynamics.

Table 1. Parameters used in the quadcopter's dynamic model


Symbol Description Value Unit
G Acceleration due to gravity 9.81 𝑚. 𝑠 −2
mt Weight of the motor and propellers 0.084 𝑘𝑔
mq Mass of the quadrotor 0.742 𝑘𝑔
At The thickness of the arms 0.014 𝑚
Rp The radius of the propeller 0.127 𝑚
Lq Length of the quadcopter arms 0.295 𝑚
Jx= Jy Moment of inertia around the x and y axis 0.0163 𝑘𝑔. 𝑚2
Jz Moment of inertia around the z-axis 0.0326 𝑘𝑔. 𝑚2
F1,F2,F3,F4 Motors of quadcopter - -

Several flight simulations were conducted to evaluate the performance of our control approach. In
the first test, a single PID controller was generated for pitch, roll, and yaw angles, with carefully selected
gains. The evolution of (X ⃗ , ⃗Y, Z
⃗ ) according to desired trajectories was examined to assess performance. In the
second test, the drone was simulated with two PID controllers: one for pitch and roll, and another for yaw.
Complex trajectories, including those with non-zero derivatives, were tracked to validate performance.
Finally, a third PID controller dedicated to the theta angle was added to test robustness. Various performance
metrics such as tracking errors, settling time, and stability were analyzed to evaluate the effectiveness and
reliability of our control approach. Table 2 lists the initial conditions used for the simulations, including
initial linear and angular positions. Table 3 shows the lists of parameters used in the simulation tests.

Table 2. The initial conditions for simulations Table 3. The parameters used in the simulation tests
Angles Scenario 1 Scenario 2 Scenario 3 Parameter Value
X 0 𝜋 0 Simulation time 10 seconds
2 Trajectory type Third-order polynomial
Y 0 0 0
𝜋 Initial conditions Positions, velocities, accelerations
Z 0 0
2 Added noise With white Gaussian noise

Nonlinear Kalman filter for gyroscopic and accelerometer noise rejection … (Wassim Arfa)
200  ISSN: 2722-2586

5.2. Scenario 1 analysis


In this flight simulation, tests were conducted to demonstrate the theoretical performance of the
control approach. In the first test, PID controller parameters were selected and simulations were performed to
observe the behavior of the control approach with a Kalman filter in the presence of noise from gyroscopes
and accelerometers. This aimed to determine the role of the control function in maintaining a bounded total
thrust force. Optimal PID controller gains are presented in Table 4.

Table 4. Optimal parameters for scenario 1


Angles 1 PID controller 2 PID controllers 3 PID controllers
All 3 angles Pitch and Roll Yaw Pitch Roll Yaw
𝑲𝒑 10.5 111.5 9 10 10 14
𝑲𝒅 6 19.1 6 1 14.5 8
𝑲𝒊 0.4 0.2 0.1 0.1 0.1 0.3

Figures 6 to 8 illustrate the tracking of the desired trajectory by the quadrotor during the flight
simulation. Despite slight initial errors on all three axes due to noise, the quadrotor accurately follows the
trajectory. Conclusions regarding pitch, roll, and yaw angles remain consistent: perturbation is minimal with
three controllers, increases with two controllers, and becomes more significant with one PID controller.
These observations underscore the importance of multiple PID controllers in improving stability, reducing
disturbances, and minimizing angle errors in different directions. These figures highlight the benefits of
employing a distributed control system capable of effectively managing multiple angles while mitigating
noise effects through Kalman filtering, thereby reducing errors for each angle.

Figure 5. 1 PID controller with Kalman filter integration for Euler angle stabilization for scenario 1

Figure 6. 2 PID controllers with Kalman filter integration for Euler angle stabilization for scenario 1

Figure 7. 3 PID controllers with Kalman filter integration for Euler angle stabilization for scenario1

IAES Int J Rob & Autom, Vol. 13, No. 2, June 2024: 194-204
IAES Int J Rob & Autom ISSN: 2722-2586  201

5.3. Scenario 2 analysis


Table 5 displays the optimal PID controller gains for the second scenario. Values are listed for roll,
pitch, and yaw angles in each trial with PID 1, PID 2, and PID 3, reflecting specific results for each case. As
we can observe in Figures 9 to 11, when we applied an initial condition on the (X ⃗ , ⃗Y, ⃗⃗Z) axes (𝜋 , 0, 0), we
2
found similar results to those mentioned earlier. Equally for the pitch, roll, and yaw angles, the drone
stabilizes faster when using three PID controllers, while it takes more time with two controllers, and even
longer with just one. This observation confirms the advantage of utilizing multiple PID controllers to achieve
faster stabilization and improved pitch angle performance. Essentially, employing more controllers leads to
better, steadier, and quicker stabilization. Moreover, in the presence of noise from the gyroscopes and
accelerometers, integrating a Kalman filter can effectively mitigate errors associated with individual angles.

Table 5. Optimal parameters for scenario 2


angles 1 PID controller 2 PID controllers 3 PID controllers
All 3 angles Pitch and Roll Yaw Pitch Roll Yaw
𝑲𝒑 9 89 9 10 110 14
𝑲𝒅 8 14.5 6 1 15 7.1
𝑲𝒊 0.4 0.2 0.1 0.1 0.1 0.3

Figure 9. 1 PID controllers with Kalman filter integration for Euler angle stabilization for scenario2

Figure 10. 2 PID controllers with Kalman filter integration for Euler angle stabilization for scenario2

Figure 11. 3 PID controllers with Kalman filter integration for Euler angle stabilization for scenario2

5.3. Scenario 3 analysis


Table 6 outlines the optimal PID controller gains for the second scenario, detailing values for roll,
pitch, and yaw angles across trials using PID 1, PID 2, and PID 3. These entries provide a specific
breakdown of results for each case examined.

Nonlinear Kalman filter for gyroscopic and accelerometer noise rejection … (Wassim Arfa)
202  ISSN: 2722-2586

Table 6. Optimal parameters for scenario 3


Angles 1 PID controller 2 PID controllers 3 PID controllers
All 3 angles Pitch and Roll Yaw Pitch Roll Yaw
𝑲𝒑 13 89 10 10 110 14
𝑲𝒅 10 14.5 7 1 15 9.1
𝑲𝒊 0.4 0.2 0.1 0.1 0.1 0.1

Figures 12 to 14 depict the flying robot's tracking of the desired trajectory in three-dimensional
space during flight. The observations reveal the varying performances of PID controllers for desired angles.
A single controller somewhat reduces noise disturbances for pitch, roll, or yaw angles. The reduction in
errors becomes more significant with two controllers, and disturbances are nearly eliminated with three
controllers. Thus, employing multiple PID controllers effectively enhances stability and greatly diminishes
disturbance impacts on these angles. Additionally, integrating a Kalman filter can further reduce errors
associated with gyroscopes and accelerometers for each angle in the presence of noise.

Figure 8. 1 PID controllers with Kalman filter integration for Euler angle stabilization for scenario3

Figure 9. 2 PID controllers with Kalman filter integration for Euler angle stabilization for scenario3

Figure 10. 3 PID controllers with Kalman filter integration for Euler angle stabilization for scenario3

6. FINDINGS AND DISCUSSION


This comparative study aimed to optimize PID gains by comparing our approach, utilizing an
improved PID controller based on the Kalman filter for disturbance minimization, with other methods such as
GA, CSA, PSO, and ZN tuning methods. Criteria included time stabilization and optimal PID gains.
Simulations were compared to results proposed by Sheta and Alaa [24]. measuring and comparing
stabilization times. Our approach achieved stabilization times between 2 and 3 seconds, shorter than others.
Table 7 represents the performance of these approaches.

IAES Int J Rob & Autom, Vol. 13, No. 2, June 2024: 194-204
IAES Int J Rob & Autom ISSN: 2722-2586  203

Table 1. The performance of the approaches in seconds (s)


Angles 1 PID Controller 2 PID controllers 3 PID controllers ZN PSO CSA GA
Roll 3 0.5 1.5 50 20 20 20
Pitch 2 1.5 1.5 40 25 40 -
Yaw 10 3 2 80 40 80 17

Through detailed analysis, we compared techniques used in each approach, noting differences that
influence the stabilization time. Our manual PID gain tuning resulted in shorter stabilization times, ensuring
improved responsiveness and agility. Additionally, our approach demonstrated robust stability under various
conditions, unlike others that showed sensitivity to disturbances, leading to longer stabilization times [25], [26].

7. CONCLUSION
This study proposes enhancing drone control by employing a three PID controller for each angle,
along with a Kalman filter as a preprocessing step. This integration improves stability, accuracy, and speed
by filtering disturbances and refining control tuning. Comparative analysis demonstrates the effectiveness of
the three PID controller approaches, providing better control adaptation to each angle's characteristics and
improving trajectory tracking accuracy. Additionally, the Kalman filter significantly reduces noise
disturbances, enabling more precise error calculation for the PID controller, particularly within the three PID
controller framework. While proving to be effective, further research is warranted to optimize controller
performance, potentially through refining the Kalman filter and exploring the active disturbance rejection
controller for enhanced stability.

ACKNOWLEDGMENTS
The authors would like to thank all participants who took part in this research and made this study
possible. Special thanks go to the University of Carthage for supporting this research.

REFERENCES
[1] H. Batti, C. Ben Jabeur, and H. Seddik, “Autonomous smart robot for path predicting and finding in maze based on fuzzy and
neuro‐Fuzzy approaches,” Asian Journal of Control, vol. 23, no. 1, pp. 3–12, May 2020, doi: 10.1002/asjc.2345.
[2] C. Ben Jabeur and H. Seddik, “Neural networks on-line optimized PID controller with wind gust rejection for a quad-rotor,”
International Review of Applied Sciences and Engineering, vol. 13, no. 2, pp. 133–147, Jun. 2022, doi: 10.1556/1848.2021.00325.
[3] R. Syam and Mustari, “Simulation and experimental works of quadcopter model for simple maneuver,” International Journal on
Smart Material and Mechatronics, vol. 1, no. 1, pp. 29–33, Nov. 2014, doi: 10.20342/ijsmm.2.1.33.
[4] A. Safaei and M. N. Mahyuddin, “Lyapunov-based nonlinear controller for quadrotor position and attitude tracking with GA
optimization,” Nov. 2016. doi: 10.1109/ieacon.2016.8067402.
[5] K. Rapp and P.-O. Nyman, “Optimization of extended kalman filter for improved thresholding performance,” IFAC Proceedings
Volumes, vol. 36, no. 18, pp. 119–124, Sep. 2003, doi: 10.1016/s1474-6670(17)34655-4.
[6] K. Khuwaja, N.-Z. Lighari, I. C. Tarca, and R. C. Tarca, “PID controller tuning optimization with genetic algorithms for a
quadcopter,” Recent Innovations in Mechatronics, vol. 5, no. 1., Apr. 2018, doi: 10.17667/riim.2018.1/11.
[7] J. Li and Y. Li, “Dynamic analysis and PID control for a quadrotor,” Aug. 2011. doi: 10.1109/icma.2011.5985724.
[8] R. Fessi and S. Bouallègue, “LQG controller design for a quadrotor UAV based on particle swarm optimisation,” International
Journal of Automation and Control, vol. 13, no. 5, p. 569, 2019, doi: 10.1504/IJAAC.2019.101910.
[9] V. Gomez, N. Gomez, J. Rodas, E. Paiva, M. Saad, and R. Gregor, “Pareto optimal PID tuning for px4-based unmanned aerial
vehicles by using a multi-objective particle swarm optimization algorithm,” Aerospace, vol. 7, no. 6, p. 71, Jun. 2020, doi:
10.3390/aerospace7060071.
[10] A. Sheta, M. S. Braik, and S. Aljahdali, “Genetic Algorithms: A tool for image segmentation,” May 2012. doi:
10.1109/icmcs.2012.6320144.
[11] A. Askarzadeh, “A novel metaheuristic method for solving constrained engineering optimization problems: Crow search
algorithm,” Computers & Structures, vol. 169, pp. 1–12, Jun. 2016, doi: 10.1016/j.compstruc.2016.03.001.
[12] V. V. Patel, “Ziegler-nichols tuning method: Understanding the PID controller,” Resonance, vol. 25, no. 10, pp. 1385–1397, Oct.
2020, doi: 10.1007/s12045-020-1058-z.
[13] M. Dubey, V. Kumar, M. Kaur, and T.-P. Dao, “A systematic review on harmony search algorithm: Theory, literature, and
applications,” Mathematical Problems in Engineering, vol. 2021, pp. 1–22, Apr. 2021, doi: 10.1155/2021/5594267.
[14] A. Sadollah, H. Eskandar, H. M. Lee, D. G. Yoo, and J. H. Kim, “Water cycle algorithm: A detailed standard code,” SoftwareX,
vol. 5, pp. 37–43, 2016, doi: 10.1016/j.softx.2016.03.001.
[15] M. Elhesasy et al., “Non-linear model predictive control using CasADi package for trajectory tracking of quadrotor,” Energies,
vol. 16, no. 5, p. 2143, Feb. 2023, doi: 10.3390/en16052143.
[16] S. Bouabdallah, A. Noth, and R. Siegwart, “PID vs LQ control techniques applied to an indoor micro quadrotor,” 2004. doi:
10.1109/iros.2004.1389776.
[17] Tilki Umut, Higher order sliding mode control of four rotor unmanned aerial vehicle. 2019.
[18] P. Jaiswal, “Demystifying drone dynamics!. components although most of us are… | by percy jaiswal | towards data science,”
Towards Data Science, 2018.
[19] M. Najm, A. Younis, and F. Majeed, “Mathematical modelling and PID controller implementation to control linear and nonlinear
quarter car active suspension,” Al-Rafidain Engineering Journal (AREJ), vol. 28, no. 2, pp. 113–121, Sep. 2023, doi:
Nonlinear Kalman filter for gyroscopic and accelerometer noise rejection … (Wassim Arfa)
204  ISSN: 2722-2586

10.33899/rengj.2023.137327.1216.
[20] A. Sarhan and S. Qin, “Adaptive PID control of UAV altitude dynamics based on parameter optimization with fuzzy inference,”
International Journal of Modeling and Optimization, vol. 6, no. 4, pp. 246–251, Aug. 2016, doi: 10.7763/ijmo.2016.v6.534.
[21] S. Zouaoui, E. Mohamed, and B. Kouider, “Easy tracking of UAV using PID controller,” Periodica Polytechnica Transportation
Engineering, vol. 47, no. 3, pp. 171–177, Mar. 2018, doi: 10.3311/pptr.10838.
[22] S. Khatoon, M. Shahid, Ibraheem, and H. Chaudhary, “Dynamic modeling and stabilization of quadrotor using PID controller,”
Sep. 2014. doi: 10.1109/icacci.2014.6968383.
[23] Y. F. Chan, M. Moallem, and W. Wang, “Efficient implementation of PID control algorithm using FPGA technology,” 2004. doi:
10.1109/cdc.2004.1429572.
[24] A. Sheta, M. Braik, D. R. Maddi, A. Mahdy, S. Aljahdali, and H. Turabieh, “Optimization of PID controller to stabilize
quadcopter movements using meta-heuristic search algorithms,” Applied Sciences, vol. 11, no. 14, p. 6492, Jul. 2021, doi:
10.3390/app11146492.
[25] I. Ullah, M. Fayaz, and D. Kim, “Improving accuracy of the kalman filter algorithm in dynamic conditions using ANN-based
learning module,” Symmetry, vol. 11, no. 1, p. 94, Jan. 2019, doi: 10.3390/sym11010094.
[26] Y. Du, P. Huang, Y. Cheng, Y. Fan, and Y. Yuan, “Fault tolerant control of a quadrotor unmanned aerial vehicle based on active
disturbance rejection control and two-stage kalman filter,” IEEE Access, vol. 11, pp. 67556–67566, 2023, doi:
10.1109/access.2023.3291409.

BIOGRAPHIES OF AUTHORS

Wassim Arfa is a PhD student at University of Carthage—Ecole Nationale


d’Ingénieurs de Carthage (ENICar). He is a member of the research laboratory: RIFTSI at the
ENSIT University of Tunis. His research interests include robotics, machine learning, and
deep learning. He can be contacted at [email protected].

Chiraz Ben Jabeur holds a master’s degree (2002) and a PhD degree in
Electrical Engineering (2007). Now she is an assistant professor at the Higher Institute of
Informatics (ISI) in the Department of Electrical Engineering and Computer Science. She is a
member of the research laboratory: RIFTSI at the ENSIT University of Tunis. Her current
research deals with systems control and artificial intelligence such as neural networks, fuzzy
logic, and genetic algorithms related to mobile robots' domain. She can be contacted at
[email protected].

Mourad Fathallah was born in Teboursouk, Tunisia in 1983. He received an


M.S. degree in electronics and a Ph.D. in electrical engineering from the National Institute of
Applied Science, Lyon, France, in 1989 and 2001, respectively. He has been currently
working as a teacher at Tunis University since April 2005. His current research topics are
FPGA-based embedded systems and multiple tiny object tracking. He can be contacted at
[email protected].

Hassene Seddik is a full professor at the National Superior School of Engineers


of Tunis (ENSIT). He obtained a full professor degree in the field of intelligent data filtering
and securing. His current research interests include data security audio image and video
processing applied in intelligent filtering, encryption, and watermarking. He is a senior
member of IEEE. He is a member of the research laboratory RIFTSI at the ENSIT University
of Tunis. He can be contacted at [email protected].

IAES Int J Rob & Autom, Vol. 13, No. 2, June 2024: 194-204

You might also like