# Optimization of Ship Permanent Magnet Synchronous Motor ADRC Based on Improved QPSO
## 4 Parameter Tuning of ADRC Using the QPSO Algorithm
### Parameter Tuning
This mechanism enables the particles to distribute over a broader range, enhancing the global search capability. The inclusion of this probability distribution mirrors the randomness of particles in quantum mechanics, allowing the algorithm to escape local optima and explore the solution space more broadly. However, the highly random nature of this mechanism can also have drawbacks, such as weakening the particle's ability to perform fine searches in local areas, potentially reducing local convergence efficiency. To address this, a dynamic adjustment strategy can be introduced to balance the global and local search abilities. For example, during the early stages of optimization, increased randomness can strengthen the global search and explore the solution space diversity. As optimization progresses, the randomness can be reduced to enhance the particle's local search precision, improving the algorithm's convergence accuracy. Furthermore, by incorporating models like Gaussian or Cauchy distributions with dual-wave function representations, the particle's search behavior can be optimized, allowing the algorithm to maintain strong global search capabilities while enhancing local search efficiency. The Cauchy distribution has a long-tailed characteristic, which enables the generation of larger step sizes, allowing particles to explore regions of the solution space that are far from their current position. This characteristic helps particles more effectively avoid becoming trapped in local optima [25]. Its formula is as follows:  
\[Cauchy(x_{0},\gamma)=\frac{1}{\pi\gamma\left[1+\left(\frac{x-x_{0}}{\gamma} \right)^{2}\right]}, \tag{25}\]  
where \(x_{0}\) is the location parameter, which determines the position of the peak of the distribution, while \(\gamma\) is the scale parameter, representing the half-width of the distribution and controlling its spread. The probability density function of the Gaussian distribution is highest at the center, making it suitable for describing the fine search behavior of particles in local regions, which enhances the convergence accuracy of the particles in the later stages of optimization [26]. The formula is as follows:  
\[\mathcal{N}(\mu,\sigma^{2})=\frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-\frac{(x-\mu)^ {2}}{2\sigma^{2}}}, \tag{26}\]  
where \(\mu\) is the mean of the distribution, representing the center (or axis of symmetry) of the Gaussian distribution, and \(\sigma\) is the standard deviation, indicating the distribution's width and controlling its spread (the larger the standard deviation, the wider the distribution). In this paper, we focus only on the random values generated from the Gaussian and Cauchy distributions and do not consider the random variable \(x\). Replace the traditional random term with the Gaussian and Cauchy distributions, and the formula becomes as follows:  
\[x_{i}^{k+1}=\left\{ \begin{array}{ll}x_{i}^{k+1}=p_{i}^{k}\pm\beta\cdot\left| mbest^{k}-x_{i}^{k}\right|\cdot Cauchy(x_{0},\gamma)&\quad p=\mathrm{T},\\ x_{i}^{k+1}=p_{i}^{k}\pm\beta\cdot\left|mbest^{k}-x_{i}^{k}\right|\cdot \mathcal{N}\left(\mu,\sigma^{2}\right)&\quad p=1-\mathrm{T},\end{array} \right. \tag{27}\]  
where \(p\) represents the probability of occurrence, and T is a value less than 1 and greater than 0. By dynamically adjusting the parameter T, the algorithm can modulate the contribution of the two distributions at different stages. During the early stages of optimization, a larger T is used to place more emphasis on the Cauchy distribution for global exploration. In later stages, The parameter T will progressively decrease as time progresses, allowing the Gaussian distribution to take over and improve the local search capacity. By introducing both the Cauchy and Gaussian distributions and dynamically switching between them according to the probability \(p\), the algorithm achieves a balanced integration of global and local search capabilities. The Cauchy distribution provides robust global exploration, while the Gaussian distribution refines the search in local regions.