# Sensorless HSPMSM Control of an Improved SMC and EKF Based on Immune PSO
[14] proposed using the ant colony algorithm (ACA) to optimize covariance matrix parameters, but the initial information used in the ACA is deficient, requiring a long search time. Some efforts have also reported selecting the covariance matrix using the trial method. This method is practical and simple, but it takes a long time, has poor accuracy, and depends on user experience. [PERSON] et al. [15] introduced a real-time coded genetic algorithm to optimize the covariance matrix of an EKF. After optimization, the system could suppress noise well and shorten the covariance matrix selection time. Some efforts [16; 17] applied the unscented Kalman filter (UKF) to improve nonlinear calculation accuracy. However, the UKF is easily affected by system noise and measurement noise error, which restricts its application. When such a system is subjected to external disturbances, the speed variation will be greater than that of a system with sensors because the delay effect of the EKF algorithm makes the system less robust [18; 19; 20; 21; 22; 23; 24; 25]. The controller of the motor needs high precision and fast dynamic response, as well as strong robustness to load disturbances and internal system parameter changes. Therefore, it is difficult for a PI controller to meet the requirements of the control system. An SMC is independent of the control object parameters and perturbations. It has a fast response time, insensitivity to external perturbations and parameter changes, and strong robustness, which are suitable characteristics for controlling an HSPMSM [26]. Some efforts have introduced an SMC into a rotational speed outer loop controller. The SMC can quickly track rotational speed and has strong robustness, but it will inevitably cause system chattering. To mitigate this issue, the approach law method has been adopted in SMC design. In the process of quickly approaching the sliding mode surface (SMS), the exponential or power method was adopted to design SMCs for the approach law [27]. A differential state quantity was introduced into the selected SMS, which causes high-frequency noise when obtaining the velocity differential, resulting in a poor control effect. [PERSON] proposed a fast terminal sliding mode control (FTSMC)-based MPPT controller and a hybrid MPPT approach that combines chaotic-based particle swarm optimization (PSO) derivatives and the optimal relation-based (ORB) method [28; 29]. In [30], a voltage mode second-order sliding mode controller (SO-SMC) was proposed to capture maximum power from WECSs. In reference [31], an integral sliding mode control law was designed to track the optimal turbine rotation speed based on a recurrent neural network (RNN) that is used to identify uncertain wind turbine dynamics. Reference [32] proposed a novel high-order sliding mode (HOSM)-based control methodology for the direct power control (DPC) of a doubly fed induction generator (DFIG) wind turbine operating under unbalanced grid voltage conditions. To solve the above problems, this investigation uses an improved PSO algorithm, namely IPSO, to select and optimize the noise covariance matrix of the EKF. In addition, an SMC is used to control the speed. Three SMSs--linear SMS, global SMS, and integral SMS--are used to design the ordinary SMC, global SMC, and integral SMC for improving control [33]. Three SMSs are used to improve the approach law, and an optimal controller is selected for subsequent simulation verification via Lyapunov stability proof and characteristic analysis. The simulation results show that the improved algorithm and controller can provide the HSPMSM control system with better control and robustness. The main contributions of this paper are summarized as follows:  
1. A traditional 6-dimensional array composed of a noise matrix and measurement matrix requires considerable trial-and-error and computation time for optimization; this paper provides a new particle swarm optimization algorithm for overcoming this limit through optimization.