# Optimization of Ship Permanent Magnet Synchronous Motor ADRC Based on Improved QPSO
## 3 Active Disturbance Rejection Controller
### Enhanced Extended State Observer  
In engineering design, external disturbances are typically treated as unknown variables. The Extended State Observer (\(ESO\)) effectively detects and estimates these disturbances by analyzing the system's input and output data, and compensates for them through control. This process does not rely on transfer function information, can handle the inherent nonlinearities of dynamic systems, and performs linearization. The \(ESO\) can be represented as:  
\[\begin{cases}fe=f_{al}(e,\alpha_{ESO},\delta_{ESO}),\\ \quad\quad e=z_{1}-y,\\ \quad\quad\dot{z}_{1}=z_{2}-\beta_{1}e,\\ \quad\dot{z}_{2}=z_{3}+\beta_{2}fe+b_{0}u,\\ \quad\quad\dot{z}_{3}=-\beta_{3}fe_{1},\end{cases} \tag{7}\]  
The mathematical expression of the traditional nonlinear function \(f_{al}\) is as follows:  
\[f_{al}(e,\alpha,\delta)=\begin{cases}\frac{e}{\delta^{1-a}}&|e|\leq\delta,\\ |e|^{a}\text{sign}(e)&|e|>\delta,\end{cases} \tag{8}\]  
where \(e\) represents the speed tracking error signal of the system; \(y\) denotes the actual motor speed signal; \(z_{1}\) is the observed motor speed; \(z_{2}\) is the observed derivative of the state; \(z_{3}\) is the total disturbance observed by the \(ESO\), including load disturbances, internal motor parameter variations, nonlinear factors, and other unmodeled dynamics; \(\beta_{1},\beta_{2},\beta_{3}\) are the feedback gain coefficients of the \(ESO\); \(b_{0}\) is the system control gain, \(b_{0}\) modulates the control signals to optimize the speed and stability of the system's response, ensuring that the system can swiftly and smoothly react to both external disturbances and internal uncertainties; \(u\) is the input control signal; \(\alpha_{ESO}\) is the nonlinear scaling factor; and \(\delta_{ESO}\) is the filtering parameter.  
As shown in Figure 3, when the tracking error increases, the nonlinear output of the \(f_{al}\) function exhibits a gain amplification effect, with the output value increasing significantly as \(|e|^{a}\) grows. This can lead to excessively aggressive control signals, potentially causing system oscillations or overshoots. Moreover, the rapid changes in the output reduce the system's robustness against environmental noise and disturbances, while the nonlinear saturation behavior may limit the system's ability to effectively correct large errors.  
In this study, the \(f_{al}\) function is modified, and a novel nonlinear function is introduced, expressed as follows:  
\[f_{aln}(e,\alpha,\delta)=\begin{cases}\frac{e}{\delta^{1-a}}&|e|\leq\delta,\\ |e|^{a}\text{sign}(e)&\delta<|e|<1,\\ 1&|e|\geq 1,\end{cases} \tag{9}\]  
Figure 3: Graph of the \(f_{al}\) function.  
This function segments the error into different ranges, more effectively balancing the intensity of the response, which contributes to preventing excessive system response and reducing the risk of potential instability. The corresponding graph is shown in Figure 4.  
The following provides an analysis and comparison of the functions \(f_{al}\) and \(f_{aln}\). By transforming Equations (8) and (9), it can be derived that:  
\[f_{al}(e,\alpha,\delta)=\frac{f_{al}(e,\alpha,\delta)}{e}e=\lambda(e)e, \tag{10}\]  
\[f_{aln}(e,\alpha,\delta)=\frac{f_{aln}(e,\alpha,\delta)}{e}e=\lambda^{\prime} (e)e, \tag{11}\]  
\[\lambda(e)=\left\{\begin{array}{ll}\frac{1}{\delta^{1-\alpha}}&|e|\leq\delta,\\ |e|^{4-1}&|e|>\delta,\end{array}\right. \tag{12}\]  
\[\lambda^{\prime}(e)=\left\{\begin{array}{ll}\frac{1}{\delta^{1-\alpha}}&|e| \leq\delta,\\ |e|^{4-1}&\delta<|e|<1\\ \frac{1}{e}&|e|\geq 1,\end{array}\right. \tag{13}\]  
When \(|e|<1\), the gain effects of \(\lambda(e)\) and \(\lambda^{\prime}(e)\) on \(e\) are the same, and at this point \(\lambda(e)=\lambda^{\prime}(e)>1\); when \(|e|>1\), \(\frac{1}{e}<\left|e|^{4-1}\), \(\lambda(e)<\lambda^{\prime}(e)<1\). When \(|e|\geq 1\), under the same error condition \(e\), the smaller the gain value, the stronger the system's anti-interference ability.