# Sensorless HSPMSM Control of an Improved SMC and EKF Based on Immune PSO
## 5 Conclusions  
In this paper, a new type of control law SMC and an immune PSO algorithm are used to optimize the control system of an HSPMSM. The improved SMC adopts a new nonlinear function with better smoothness at the origin, which can weaken the chattering phenomenon. The system response time is 0.7 s, the overshoot is approximately 1.5, there is no oscillation, and the rotation speed error is 6 rpm. The system response time under the control of the PI controller is 0.3 s, and the overshoot is approximately 10, but the oscillation is obvious; it cannot keep tracking the actual speed completely, and the range of the speed error is [\(-300\) 300], the rotor position of the HSPMSM is extremely poorly tracked during the speed increase of 7500-8000 rpm, and the electromagnetic torque is also not 0. In conclusion, the control performance of the PI controller is not as favorable as that of the SMC in a high-speed steady state, while the dynamic response of the HSPMSM is faster at zero speed as well as in the middle and low speeds. An improved EKF based on an immune algorithm is used to observe the motor speed. The control effect of the EKF algorithm based on immune-type PSO optimization is better than that of the EKF algorithm based on basic PSO optimization, and it is shown in the figure that the curves are smoother and do not jitter. The two simulation experiments consider operation at 0.4 s after the load is suddenly increased. The simulation results show that the improved control system can improve the interference immunity of the system and can effectively suppress the influence of sudden load changes on the speed. Simultaneously, the estimation accuracy of the speed and rotor position angle is high; thus, the system has strong robustness. This study applies to the field of sensorless control of PMSMs at medium and high speeds. The new controller design and the new EKF sensorless position estimator algorithm can make the motor control system more accurate and precise in estimating the position state of the motor under the premise of stabilization. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Parameters** & **PI\_IPSO** & **PI\_EKF\_IPSO** & **SMC\_IPSO** & **SMC\_EKF\_IPSO** \\ \hline rising time(tr)/s & 0.2862 & 0.2453 & 0.7691 & 0.7666 \\ \hline peak time(tp)/s & 0.4476 & 0.2467 & 0.9936 & 0.9979 \\ \hline Adjusting time(ts)/s & 0.4886 & 0.25 & 0.9949 & 0.9989 \\ \hline overtone(\(\sigma\))/\% & 2.84 & 0.975 & 1.5 & 1.575 \\ \hline steady-state error/rpm & 242 & 107 & 120 & 126 \\ \hline
0.4 s after load recovery value/rpm & 8242 & 8107 & 8120 & 8126 \\ \hline
0.4 s after load recovery value fluctuation range/rpm & 7817–8242 & 7932–8107 & 8120 & 8109–8126 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of dynamic and static performance at 8000 rpm under PI and SMC controllers. **Author Contributions:** Conceptualization, K.M. and Q.L. ; methodology, Q.L. ; software, Z.Z. ; validation, K.M., Q.L. and H.W. ; formal analysis, H.F.; investigation, T.K. ; resources, K.M. ; data curation, Q.L. ; writing--original draft preparation, Q.L. ; writing--review and editing, K.M., Z.Z. and H.W. ; visualization, H.F.; supervision, T.K. ; project administration, K.M. ; funding acquisition, K.M. All authors have read and agreed to the published version of the manuscript. **Funding:** This research was funded by the Inner Mongolia Science and Technology Major Project, grant numbers 2020 ZD0016 and 2021 ZD0032. This research was funded by the Key Technology Research Project in Inner Mongolia under Grant 2020 GG0281. This work was funded by the Basic Research Funds for Universities directly under the Inner Mongolia Autonomous Region under Grant ZTY2023033. **Institutional Review Board Statement:** Not applicable. **Informed Consent Statement:** Not applicable. **Data Availability Statement:** The data supporting the findings of this study are available from the corresponding author upon reasonable request. The data are not publicly available due to privacy.