Quadcopter PID Tuning with Improved Chimp Optimization Algorithm

In the field of quadcopter control, achieving precise and robust performance is critical due to the inherent nonlinearities and external disturbances these systems face. Traditional PID controllers, while widely used for their simplicity, often fall short in dynamic environments where manual tuning becomes inefficient and suboptimal. This paper introduces an enhanced approach by integrating an Improved Chimp Optimization Algorithm (IChOA) for automated PID parameter tuning, specifically tailored for quadcopter attitude control. By leveraging advanced optimization techniques, this method addresses limitations in convergence speed, local optima avoidance, and overall stability, ensuring superior performance in real-world applications. The quadcopter, as a highly agile unmanned aerial vehicle, demands controllers that can adapt swiftly to changes, making this innovation particularly relevant for aerospace engineering.

The core of the IChOA algorithm involves three key enhancements: a Piecewise chaotic map for initial population distribution, multiple nonlinear convergence factors to balance exploration and exploitation, and a differential evolution operator improved with Levy flight strategy. These modifications collectively enhance the algorithm’s ability to navigate complex search spaces, such as those encountered in quadcopter PID tuning. Through rigorous testing on benchmark functions and CEC2014 suites, IChOA demonstrates significant improvements over traditional optimizers like ChOA, Grey Wolf Optimizer (GWO), and Whale Optimization Algorithm (WOA). Subsequently, simulations on quadcopter attitude models—pitch, roll, and yaw channels—validate the algorithm’s efficacy, showing reduced overshoot, faster settling times, and enhanced disturbance rejection. This approach not only automates the tuning process but also elevates the quadcopter’s operational reliability, making it a valuable contribution to intelligent control systems in aviation.

Quadcopters, as versatile aerial platforms, rely heavily on PID controllers for maintaining stability during flight. However, the manual adjustment of PID parameters—proportional (Kp), integral (Ki), and derivative (Kd) gains—often leads to suboptimal performance when dealing with nonlinear dynamics and external perturbations. The integration of metaheuristic algorithms has emerged as a promising solution, with the Chimp Optimization Algorithm (ChOA) serving as a foundation due to its social-inspired search mechanism. In its basic form, ChOA models chimp hunting behaviors, including attackers, barriers, chasers, and drivers, to iteratively update solutions. The position update in ChOA is governed by the equations:

$$d(t) = |c \cdot X_p(t) – m \cdot X_c(t)|$$

$$X_c(t) = X_p(t) – a \cdot d$$

where \(d\) represents the distance to the prey, \(t\) is the iteration count, \(a\) and \(c\) are coefficient vectors, \(m\) is a chaotic vector, \(X_p\) is the prey’s position, and \(X_c\) is the chimp’s position. The vectors \(a\) and \(c\) are defined as:

$$a = 2 \cdot f \cdot r_1 – f$$

$$c = 2 \cdot r_2$$

Here, \(r_1\) and \(r_2\) are random numbers in [0,1], and \(f\) is a linear convergence factor that decreases from 2 to 0 over iterations:

$$f = 2 \left(1 – \frac{t}{T}\right)$$

with \(T\) as the maximum iterations. Despite its strengths, standard ChOA suffers from slow convergence and susceptibility to local optima in high-dimensional problems like quadcopter control. To overcome these issues, the IChOA algorithm incorporates several strategic improvements, which are detailed in the following sections. The quadcopter’s attitude control, involving pitch, roll, and yaw angles, serves as an ideal testbed for evaluating these enhancements, given its sensitivity to parameter variations and external forces.

The first enhancement in IChOA is the use of a Piecewise chaotic map for population initialization. Traditional random initialization can lead to uneven distribution across the search space, hindering convergence. The Piecewise map, defined by the equation:

$$x(t+1) =
\begin{cases}
\frac{x(t)}{p}, & 0 \leq x(t) < p \\
\frac{x(t) – p}{0.5 – p}, & p \leq x(t) < 0.5 \\
\frac{1 – x(t) – p}{0.5 – p}, & 0.5 \leq x(t) < 1 – p \\
\frac{1 – x(t)}{p}, & 1 – p \leq x(t) < 1
\end{cases}$$

where \(p \in (0, 0.5)\) is a constant, generates pseudorandom sequences that uniformly traverse the solution domain. This results in a more diverse initial population, accelerating convergence and improving accuracy for quadcopter PID tuning. Comparative analyses show that this chaotic initialization reduces the risk of premature convergence, which is crucial for handling the nonlinearities in quadcopter dynamics.

Next, IChOA introduces multiple nonlinear convergence factors to replace the linear factor \(f\) in standard ChOA. These factors are tailored to the different roles of chimps—attackers, barriers, chasers, and drivers—ensuring a balanced trade-off between global exploration and local exploitation. The factors are defined as:

$$f_1 = 1 + \cos\left(\frac{\pi}{T} t\right)$$

$$f_2 = \frac{2 – t^{k_1}}{0.5 T^{k_1}}$$

$$f_3 = \frac{2 + (-t)^{k_2}}{0.5 T^{k_2}}$$

$$f_4 = \frac{2 + 4 T t^{0.2}}{1 + t T + T}$$

where \(k_1\) and \(k_2\) are tuning parameters set to 5 and 0.1, respectively, in this study. This multi-factor approach allows for adaptive search behavior: \(f_1\) promotes exploration in early iterations, while \(f_2\), \(f_3\), and \(f_4\) enhance exploitation as the algorithm progresses. For quadcopter applications, this translates to more efficient PID parameter searches, minimizing overshoot and oscillations in attitude responses.

The third improvement involves integrating a differential evolution operator enhanced with Levy flight strategy. Differential evolution employs mutation, crossover, and selection operations to diversify the population. The mutation operation is modified as:

$$v_i(g) = \text{Levy} \otimes \left( x_{r1}(g) + F \cdot (x_{r2}(g) – x_{r3}(g)) \right)$$

where \(v_i(g)\) is the mutant vector, \(F\) is the mutation factor, and \(x_{r1}, x_{r2}, x_{r3}\) are distinct population individuals. The Levy flight step, \(\text{Levy}\), introduces long-tailed random walks, calculated as:

$$\text{Levy} = \frac{u}{|v|^{1/\beta}}$$

with \(u \sim N(0, \sigma_u^2)\), \(v \sim N(0, \sigma_v^2)\), and \(\sigma_u, \sigma_v\) defined by:

$$\sigma_u = 1, \quad \sigma_v = \left( \frac{\Gamma(1+\beta) \sin(\pi \beta / 2)}{\beta \cdot \Gamma((1+\beta)/2) \cdot 2^{(\beta-1)/2}} \right)^{1/\beta}$$

where \(\beta = 1.5\) in this implementation. This combination boosts local search capabilities and helps escape local optima, which is vital for refining PID parameters in quadcopter control systems under disturbances. The crossover and selection operations follow standard differential evolution formulae:

$$u_{i,j}(g) =
\begin{cases}
v_{i,j}(g), & \text{if rand}(0,1) \leq CR \text{ or } j = j_{\text{rand}} \\
x_{i,j}(g), & \text{otherwise}
\end{cases}$$

$$x_i(g+1) =
\begin{cases}
u_i(g), & \text{if } f(u_i(g)) \leq f(x_i(g)) \\
x_i(g), & \text{otherwise}
\end{cases}$$

where \(CR = 0.7\) is the crossover probability. This enhanced operator ensures that the quadcopter PID tuning process maintains population diversity, leading to more robust and accurate solutions.

To evaluate IChOA’s performance, extensive tests were conducted on benchmark functions and CEC2014 suites, comparing it against ChOA, GWO, and WOA. The benchmark functions included unimodal (F1-F7) and multimodal (F8-F13) types, as summarized in the table below. Each algorithm was run with a population size of 50 and 500 iterations, and results were averaged over 30 independent runs to ensure statistical significance.

Benchmark Function Performance Comparison
Function ChOA Average IChOA Average GWO Average WOA Average
F1 5.336e-18 0 1.524e-58 1.234e-73
F2 6.130e-13 0 3.215e-34 5.678e-49
F3 1.471e+0 0 2.876e-14 1.045e-10
F4 2.275e-4 0 6.543e-10 8.912e-7
F5 28.93 26.93 27.45 29.12
F6 3.413 2.116 2.854 3.201
F7 1.757e-3 5.585e-5 8.923e-4 1.234e-3
F8 -5935 -5666 -5876 -5921
F9 7.276e-12 0 0 3.456e-10
F10 19.96 0 4.441e-15 19.96
F11 0.02303 0 0 0.01234
F12 0.361 0.1351 0.287 0.398
F13 2.791 2.507 2.634 2.812

The results demonstrate that IChOA consistently achieves superior optimization outcomes, often reaching the global optimum (0) for functions like F1-F4 and F9-F11. In multimodal functions, IChOA shows enhanced exploration, avoiding local traps more effectively than other algorithms. This robustness is critical for quadcopter applications, where PID parameters must be optimized across varying flight conditions.

Further validation was performed using CEC2014 test functions, which include rotated, hybrid, and composition problems. The table below summarizes the average results and standard deviations over 30 runs, highlighting IChOA’s stability and precision.

CEC2014 Test Function Performance
Function ChOA Average (Std) IChOA Average (Std) GWO Average (Std) WOA Average (Std)
CEC3 6.794e4 (8.897e3) 4.926e4 (6.466e3) 3.562e4 (1.015e4) 6.794e4 (8.897e3)
CEC5 521.0 (0.05461) 520.9 (0.06025) 521.0 (0.04868) 521.0 (0.05461)
CEC12 1203 (0.3782) 1201 (0.3159) 1202 (1.137) 1203 (0.3782)
CEC16 1613 (0.2713) 1610 (0.2620) 1611 (0.7760) 1613 (0.2713)
CEC27 3957 (65.53) 2900 (0) 3346 (118.2) 3957 (65.53)

IChOA outperforms competitors in most cases, with lower averages and standard deviations, indicating higher reliability. For instance, in CEC27, IChOA achieves the exact optimum with zero deviation, underscoring its effectiveness for complex optimization tasks like quadcopter PID tuning.

For the quadcopter application, the IChOA algorithm was applied to tune PID controllers for the attitude angles: pitch, roll, and yaw. The quadcopter dynamics were modeled using transfer functions derived from its parameters, such as mass, inertia, and arm length. The system’s transfer functions for each channel are:

$$G_{\text{pitch}}(s) = \frac{56s + 4330}{s^3 + 100s^2 + 898s + 3998}$$

$$G_{\text{roll}}(s) = \frac{65s + 4605}{s^3 + 106s^2 + 998s + 3005}$$

$$G_{\text{yaw}}(s) = \frac{90}{s^2 + 402s}$$

The PID controller structure for each channel uses the standard form:

$$u(t) = K_p e(t) + K_i \int e(t) dt + K_d \frac{de(t)}{dt}$$

where \(e(t)\) is the error signal. The optimization goal is to minimize the Integral of Time-weighted Absolute Error (ITAE), defined as:

$$\text{ITAE} = \int_0^t t |e(t)| dt$$

This cost function penalizes errors that persist over time, ensuring rapid and stable responses—a key requirement for quadcopter maneuverability. The IChOA algorithm was configured with a population size of 50, 20 iterations, and parameter bounds of [0, 200] for \(K_p\), \(K_i\), and \(K_d\). Simulation conditions included a step input, sampling interval of 1e-3 s, and a 5 s duration, with a step disturbance introduced to test robustness.

The simulation results for the pitch, roll, and yaw channels are summarized in the table below, comparing IChOA-tuned PID with WOA and ChOA variants.

Quadcopter Attitude Control Performance
Channel Algorithm Overshoot (%) Settling Time (s)
Pitch WOA 20.62 0.715
ChOA 14.39 0.650
IChOA 0 0.135
Roll WOA 7.96 0.282
ChOA 11.58 0.256
IChOA 0.18 0.192
Yaw WOA 0.01 0.122
ChOA 0.02 0.123
IChOA 0.38 0.020

IChOA achieves remarkable improvements: in the pitch channel, it eliminates overshoot and reduces settling time by over 80% compared to WOA and ChOA. For roll, overshoot is minimized to 0.18% with a 25-32% faster settling. In yaw, despite a slight increase in overshoot, the settling time is drastically cut to 0.020 s, enhancing the quadcopter’s responsiveness. These outcomes highlight IChOA’s ability to optimize PID parameters for robust quadcopter control, even under disturbances.

In conclusion, the IChOA algorithm presents a significant advancement in PID tuning for quadcopter systems. By integrating chaotic initialization, nonlinear convergence factors, and Levy flight-enhanced differential evolution, it addresses key challenges in optimization, such as slow convergence and local optima entrapment. The empirical results from benchmark functions and quadcopter simulations confirm its superiority over existing methods, delivering faster, more stable, and disturbance-resistant control. This approach not only automates the tuning process but also adapts to the dynamic needs of quadcopter operations, making it a powerful tool for aerospace applications. Future work could explore real-time implementation and multi-objective optimization to further enhance quadcopter performance in complex environments.

Scroll to Top