# An Adaptive Control Based on Improved Gray Wolf Algorithm for Mobile Robots
## 4 Design of the Adaptive Optimization Algorithm  
The GWO, which has the advantages of a simple structure, good balance, and so on, is a new heuristic algorithm [37], and its good stability and rapid convergence is proved by the implementation of the algorithm on several various applications [38; 39; 40]. The GWO is derived from the cooperative behavior exhibited by gray wolves during their predation. The hunting activity involves the wolves forming distinct sub-groups known as grades [23]. The items are labeled \(\alpha_{w}\), \(\beta_{w}\), \(\delta_{w}\), and \(\omega_{w}\) in descending order; every grade of the gray wolves, \(\alpha_{w}\), \(\beta_{w}\), \(\delta_{w}\), and \(\omega_{w}\), plays a crucial part in the optimization process. The wolf of king \(\alpha_{w}\) is the optimal solution and is the result of the optimization process. Similarly, the second, third, and fourth perfect solutions are denoted by \(\beta_{w}\), \(\delta_{w}\), and \(\omega_{w}\). In this paper,the GWO is used along with a fuzzy control system, which provides online comprehensive exploration capacity for the parameter adjustment of the controller. In this case, assuming the trajectory that the mobile robot must track is \(q_{d,a}=[x_{a}y_{a}\theta_{a}]^{\mathsf{T}}\), the error posture of the mobile robot kinematics is defined as follows  
\[ \begin{bmatrix}e_{x}\\ e_{y}\\ e_{\theta}\end{bmatrix} = \begin{bmatrix}-\cos\theta&\sin\theta&0\\ -\sin\theta&-\cos\theta&0\\ 0&0&1\end{bmatrix} [q_{d,a}-q] \tag{46}\]  
The position, velocity, and angular velocity of the mobile robot are represented by \(((x,y,\theta),v,\omega)\); then, the equation of motion can be obtained as follows [24]  
\[ \begin{bmatrix}\dot{x}_{a}\\ \dot{y}_{a}\\ \dot{\theta}_{a}\end{bmatrix} = \begin{bmatrix}\cos\theta&0\\ \sin\theta&0\\ 0&1\end{bmatrix}\begin{bmatrix}v\\ \omega\end{bmatrix}  \tag{47}\]  
To ensure that the kinematic error posture of (46) is consistently asymptotically stable, let Equation (47) be expressed as follows  
\[ \begin{bmatrix}\dot{x}_{a}\\ \dot{y}_{a}\\ \dot{\theta}_{a}\end{bmatrix} = \begin{bmatrix}\cos\theta&0\\ \sin\theta&0\\ 0&1\end{bmatrix}\begin{bmatrix}\rho_{x}e_{x}+V_{a}\text{cos}(e_{\theta})\\ \dot{\theta}_{a}+\rho_{y}e_{y}V_{a}+\rho_{\theta}V_{a}\text{sin}(e_{\theta}) \end{bmatrix}  \tag{48}\]  
where \(V_{a}=\sqrt{\dot{x}_{a}^{2}+\dot{y}_{a}^{2}},\rho_{x},\rho_{y}\), and \(\rho_{\theta}\) are all positive constants. 1. Improvement of the GWO  
Now, let the generalized error be represented as a function objective \(E=[E_{1}(t),E_{2}(t)]^{\mathsf{T}}\), where \(E_{1}(t)=r(t)\) is related to \(A\) and \(f(t)\). The error in the operation space is given as \(E_{2}(t)= \begin{bmatrix}e_{x}(t),e_{y}(t),e_{\theta}(t)\end{bmatrix} ^{T}\), which is related to \(\rho_{x}\), \(\rho_{y}\), and \(\rho_{\theta}\). The optimal solution will be searched using the proposed improved GWO. The GWO is improved as follows  
1. Constructing a nonlinear convergence factor \(a_{0}\). For the conventional GWO, the convergence factor \(a\) gradually decreases from 2 to 0 in a linear manner throughout the iterations [41], and is usually set to take the value in the range of [\(-\)2,2] [23]. However, the convergence procedure of the algorithm is not inherently linear, making it challenging to adapt to the actual search scenario and leading to a reduction in the search efficiency of the algorithm. A new nonlinear convergence factor to improve the convergence accuracy is proposed as follows  
\[a_{0}=3\left(1-\frac{e^{\frac{t}{t}}-1}{e-1}\right) \tag{49}\]  
where \(t\) denotes the current iteration number and \(T\) represents the maximum iteration number of the population. The convergence factor curves before and after the improvement are shown in Figure 4. In the initial phase of the algorithm, \(a_{0}\) decreases at a slower rate, allowing for a prolonged global search process.