# Cuckoo Coupled Improved Grey Wolf Algorithm for PID Parameter Tuning
## 4 Numerical Data Experiment and Simulation Analysis
### Analysis of the Parameter Setting Experiment  
When adopting a swarm intelligence optimisation algorithm to adjust the controller parameters, the frequently selected objective functions are generally divided into two types:  
Figure 10: (**a–d**) Convergence curves of the multimodal benchmark functions. (**a**) F5 Function, (**b**) F6 Function, (**c**) F7 Function, and (**d**) F8 Function. Figure 9: (**a–d**) Convergence curves of unimodal benchmark functions. (**a**) F1 Function, (**b**) F2 Function, (**c**) F3 Function, and (**d**) F4 Function. integral square error (ISE) and (Integrated Time and Absolute Error) ITAE. The selection of different objective functions directly affects controller performance [30]. In engineering applications, most controlled systems are nonlinear, and the above three objective functions do not consider whether the output \(u(t)\) exceeds the physical limit, which leads to controller design failure. Therefore, the integral absolute error (IAE) was used to minimise the objective function, and the maximum output value of the controller was used as a penalty function to optimise the controller design and parameter tuning. Therefore, the objective function is written as:  
\[f(t)=\int_{0}^{\infty}\Big{(}\omega_{1}|e(t)|+\omega_{2}u^{2}(t)\Big{)}dt+ \omega_{3}t_{u}, \tag{18}\]  
where \(e(t)\) is the system error; \(u(t)\) is the controller output; \(t_{u}\) is the rise time; and \(\omega_{1}\),\(\omega_{2}\), and \(\omega_{3}\) are the weights. The iterative steps of the controller algorithm are as follows:  
Step 1: Initialise the parameters of CWO, such as population size N, maximum iterations (_Max_iter_), initial value \(\overset{\rightharpoonup}{a}_{initial}\), final value \(\overset{\rightharpoonup}{a}_{final}\) of \(\overset{\rightharpoonup}{a}\), parameters A and C, and the nonlinear modulation index \(\mu\);  
Step 2: Use tent mapping to generate individual populations \(\{X_{i},i=1,2,3\ldots,N\}\) and calculate the fitness value \(\{f_{i},i=1,2,3\ldots,N\}\) of each individual;  
Step 3: The fitness function value for each candidate is calculated. According to the order of fitness values from large to small, the individuals corresponding to the first three fitness values are taken as \(\alpha\), \(\beta\), and \(\delta\), and their corresponding location information is respectively \(X_{\alpha}\), \(X_{\beta}\), and \(X_{\delta}\);  
Step 4: To find the best location of prey, use Equation (9) to calculate the nonlinear change parameter \(\overset{\rightharpoonup}{a}\), and then update the A and C values according to Equation (3);  
Step 5: Use Equation (13) to update the position of population individuals, recalculate fitness values, and update the \(\alpha\), \(\beta\), and \(\delta\) values;  
Step 6: Determine whether \(t\) reaches the _Max_iter_ value; if it is reached, the best solution (that is, the fitness value of \(X_{\alpha}\)) will be output; otherwise, return to Step 3 to continue execution. The motor model proposed in Section 4.1 is used as the controlled object of the traditional GWO algorithm and the CSO_IGWO algorithm experiment, and the function value convergence curve of the objective function is shown in Figure 11. It can be seen from the iteration curve that the CWO algorithm improved the optimisation upper limit, making the parameter optimisation more accurate, unlike the traditional GWO algorithm, which has fallen into the local optimal solution early. This is because of the idea of using the Levy flight strategy in the CSO_IGWO algorithm to improve the GWO algorithm and taking advantage of the Levy flight strategy to make the GWO algorithm jump out of the local optimisation. To verify the superiority of the algorithm proposed in this paper and further compare its convergence with other swarm intelligence optimisation algorithms, two more classical and widely used swarm intelligence optimisation algorithms were selected: an improved particle swarm optimisation algorithm and an improved genetic algorithm.