Predictive control of permanent magnet synchronous motor based on Super‐Twisting sliding mode

To improve the anti‐interference ability and response speed of the permanent magnet synchronous motor control system and the problem of excessive chattering when the speed loop of the system is controlled by fast second‐order Super‐Twisting sliding mode control, an improved second‐order Super‐Twisting sliding mode controller is designed to replace the previous speed loop controller. The current loop uses model prediction to control current, which can effectively suppress chattering and improve the robustness of the whole system. The simulation results show that the response time of the system using this algorithm is not only 0.141 s faster than that of the traditional proportional integral control but also the overshoot is reduced by 10%. Then, under different working conditions, the strategy in this paper is compared with the traditional control method, and good characteristics are obtained. Finally, the whole system is used for experimental analysis. The experimental results show that this strategy has good rapidity and robustness.


| INTRODUCTION
Permanent magnet synchronous motor (PMSM) has many advantages such as high efficiency and high power density. With the development of industry, PMSMs are increasingly used in many fields such as new energy electric vehicles, wind power generation, and subways. 1 PMSM is a complex nonlinear system. With the increasing demand of permanent magnet synchronous motor, we need better control methods and strategies. At present, most PMSM control systems in the industry adopt vector control, and the controllers of the speed ring and current ring adopt proportional integral (PI) control. 2 PI controller has the advantage of a simple structure, but its control effect is easy to be affected by external interference, resulting in poor dynamic and static performance. Therefore, other scholars consider other control strategies to control the PMSM system, such as sliding mode control, predictive control, active disturbance rejection control, and other control strategies. 3 These control methods have achieved some results.
Sliding mode control is a very good nonlinear control method, which has the advantages of little influence from external disturbance and fast response speed. However, chattering can be produced in traditional sliding mode control. To solve the chattering problem existing in traditional sliding mode control, some scholars used the saturation function to replace the switching function, and found that system chattering can be effectively reduced, although it will sacrifice part of the convergence speed. 4 Some scholars have designed a nonsingular terminal sliding mode control strategy, which can effectively suppress some nonlinear perturbations, but there is also a phenomenon of convergence stagnation. 5 Levant and colleagues 6 proposed a highorder sliding mode, which not only has the advantages of traditional sliding modes but also can suppress the chattering of traditional sliding modes and improve the control accuracy of the system. On this basis, some scholars adopted a high-order sliding mode control by the Super-Twisting algorithm to replace the PI controller link in the model; this could not only accelerate the system's convergence but also have relatively good robustness and strong anti-interference ability.
In recent years, with the development of digital signal processing technology, more and more people start to study model predictive control (MPC) because of its good control characteristics. MPC mainly includes model predictive current control (MPCC) and model predicts torque control (MPTC). 7 Because MPCC has the characteristics of fast dynamic response and simple principle, it is a highperformance control strategy, and because the control variable is the current that can be directly measured from the control system, MPCC is much simpler than MPTC. 8 Because the current loop of a permanent magnet synchronous motor determines the transient and steady-state performance of the system, it is the key to building a current loop with good static and dynamic performance and high precision control for a high-performance motor control system. 9 The principle of MPCC is simple and the parameter setting is clear and intuitive. In recent years, MPCC has become a high-performance control scheme for PMSM due to its advantages of fast dynamic response, easy solution to nonlinear multivariable problems, and low requirements on model accuracy. 10 Based on the above control methods, this paper proposes a new control strategy for the PMSM control system, which not only makes the whole system have fast convergence but also has certain anti-interference ability and good robustness. This paper intends to apply the high-order sliding mode control to the velocity loop, but some shortcomings of the high order sliding mode control are found in the research process, so the improvement is made on the basis of the high order sliding mode control. First, the Super-Twisting sliding mode increases integral k s 4 and proportional k s 2 . We found that when s tends to zero, the proportion will tend to zero, which may lead to a proportion that does not work, so it will be proportional to k s s | | * a s 2 sign(| |−1) . Adding the integral term at the same time may cause serious overshooting or even oscillation of the system, so adding an antisaturation coefficient to the system is to change the integral term to k νs 4 . This paper uses the improved high-order sliding mode as the speed loop controller. Meanwhile, to improve the robustness of the system, the improved high-order sliding mode is combined with the MPCC control algorithm, namely, the MPCC is used as the current loop. The simulation model is built in MATLAB/Simulink for simulation, and the simulation results are analyzed and compared to verify that the proposed method not only has fast response speed but also has good stability and anti-interference ability. Finally, the experimental simulation is carried out on the experimental simulation platform, which proves the practicability of the proposed method.

| MATHEMATICAL MODEL OF PMSM
Ignoring the eddy current, saturation of the magnetic core, and magnetic hysteresis loss of the magnetic circuit, a mathematical model of PMSM in the d-q-axis is established 11 Voltage equation: where u d and u q are the voltage of axis d and axis q; R s is the stator resistance; L d and L q are the inductors of the d-axis and the q-axis, and L q = L d ; i d and i q are current in axis d and axis q; ω e is the angular velocity of the motor; ψ f is the flux chain between the permanent magnet and the stator winding. Magnetic chain equations: Torque equation: Substituting the magnetic chain equations of where n p is the pole pair number of the motor and T e is the electromagnetic torque. The expression of torque balance of three-phase permanent magnet synchronous motor is as follows: where T L is the load torque, J is the system moment of inertia, D is the coefficient of friction, ω r is the mechanical angular velocity of the motor, and ω n ω = e r p .

| THE DESIGN OF THE SPEED LOOP CONTROLLER
The Super-Twisting sliding mode was the simplest sliding mode control in the second-order sliding mode. The Super-Twisting algorithm only needs to know the sliding mode variable s. When the order of s was 1, the second-order sliding mode algorithm could be applied directly. This not only did not need to introduce new variables but also suppressed chattering 12 Equation of Super-Twisting sliding mode: where a and b are control parameters and greater than 0, ϕ̇is the first derivative of the external disturbance and ϕ |̇| > 0, and s is a sliding mode variable. Although Super-Twisting sliding mode control has a good control effect, there are also problems of slow convergence speed and not enough robustness, so it is considered to be the basis of the original integral term and the proportion term is added for adjustment.
Equation of fast Super-Twisting sliding mode: where k k k , , 3 , and k 4 are control parameters and are greater than 0, ϕ̇is the first derivative of the external disturbance and ϕ |̇| > 0, and s is a sliding mode variable. Define the sliding surface as follows: The control law of the fast Super-Twisting sliding mode is obtained as follows:

| Stability analysis
To prove the stability of the FSTA speed controller, the Lyapunov constructor, which reduces to a positive definite quadratic form, is used to obtain the stability conditions for the system parameter range. Define the Lyapunov function as follows: Write Equation (10) in the following form: The derivative of the Lyapunov function yields the following: It can be seen from Equation (13) is a positive definite quadratic form.
, it can be seen that the first derivative is Equation (16) is the parameter in the bounded value, existence  f t | ( ) | Φ, which is suitable for the bounded Φ constant. Therefore, when the condition of (15) is satisfied, the derivative of the Lyapunov constructor V Q = Γ Γ T along the system trajectory has V̇< 0, then the system satisfies the Lyapunov stability condition.

| Design of improved second-order super-twisted sliding mode controller
According to the above stability proof, it is found that as long as k > 0 2 and k > 0 4 , it can only ensure the stability of the whole system. After improving from the supertorsional sliding mode to the fast supertorsional sliding mode, it is found that when the coefficient of the increased scale term of the system tends to 0, the increased scale term tends to 0, that is, the whole scale term only tends to the relatively slow scale term, so that the approach speed of the whole system slows down. So changing the proportional to k s s | | * a s 2 sign(| |−1) is considered. After changing the scale term, when the system state is close to the sliding mode surface, that is s < 1, . In summary, the replacement of the scale term is faster than the original scale term when it is close to the sliding surface or away from the sliding surface. At the same time, it is found that the added integral term k s 4 will affect the robustness of the system, so the anti-saturation coefficient ν is added to the system, that is, the integral term k s 4 is changed to k νs 4 . One argument ν a i i = 1 + tanh [ ( * − ) ] q q , and a is a normal number; i* q is the output current of the speed ring after being limited; i q is subjected to the output current of the speed loop before clipping; tanh is the hyperbolic tangent function. When the difference between i q and i* q is large enough, that is, when it is oversaturated, ν tends to 0 according to the property of the hyperbolic tangent function, so that the speed loop is desaturated. When i q and i* q are equal, that is, under saturation, according to the hyperbolic tangent function property, ν = 1, no matter how the velocity is changed, the coefficient of the integral term will remain unchanged. In addition, by changing the value of a, the overshoot can be reduced to different degrees. Finally, the control law of Improved Fast Super-Twisting sliding mode is obtained as follows:

| DESIGN OF THE CURRENT LOOP CONTROLLER
The traditional PMSM control relies on the Space Vector Pulse Width Modulation (SVPWM) to control the threephase inverter. The basic principle of SVPWM is to decompose the three-phase voltage vector into six twodimensional space vectors. Then, these vectors are arranged in a certain pattern to control the output voltage of the threephase inverter. 13 Its control method is shown in Figure 1. The finite set model predictive control of PMSM is a control method based on the prediction model of the motor. It discretizes the mathematical model of the motor in the d q coordinate system and then puts seven different voltage vectors into the prediction model to obtain seven different current prediction values. After the rolling optimization of the system, the obtained optimal voltage vector is applied to the inverter to achieve control. A simple transformation of Equation (1) can obtain the current equation as follows: To realize the MPCC strategy in practical control applications, the current equation (11) of PMSM should be discretized, and the discrete current equation can be obtained by using the second-order Euler method 14 where i k p +1 is the predicted correction value of the current at k T + 1 s ; i k s is the sampling value of the stator current at kT s ; i k s +1 is the predicted value of the stator current at k T + 1 s ; u k s is the stator voltage at kT s ; i k s is the current at time kT s .
To achieve the goal of PMSM current predictive control, the value function should contain two control variables, one is the predicted current and the other is the reference current. 15,16 The value function should be the sum of squared errors between the predicted current and the reference current, the goal is to minimize the error: where i* q is the expected current of q-axis at time k T + 1 s ; i* d is the expected current in axis d at time k T + 1 s . The model predictive current control is used due to MPCC having the characteristics of fast dynamic response and simple principle. MPCC is a highperformance control strategy. The control variable is the current that can be measured directly from the control system. The control method of MPCC is written in the form of code, which can speed up the running speed of the system.

| SIMULATION EXPERIMENT
Control schematic of permanent magnet synchronous motor based on improved fast Super-Twisting sliding mode speed controller and model predictive current control. This is shown in Figure 2.
To verify the effectiveness and superiority of the above system design, a simulation model is built in MATLAB/Simulink according to Figure 2. The speed loop of the system is an improved fast Super-Twisting sliding mode, and the current loop is a model predictive current control. The simulation uses the PMSM model built into Simulink, and the permanent magnet synchronous motor parameters are shown in Table 1.
To prove the effect of the improved fast Super-Twisting sliding mode speed (IFSTA) + MPCC (method in this paper), the traditional PI + PI control (Method 1), the IFSTA + PI control (Method 2), and PI + MPCC (Method 3) are compared. In Method 1, K = 0.

| No load test
First, let the motor rotate at 1000 r/min (i.e., given the initial speed ω * r is 1000 r/min), and the system simulation time is set to 0.2 s. Then, the above different control methods are used to make the belt motor rotate without load, and the no-load speed map of the motor is obtained. This is shown in Figure 3. According to the no-load speed in Figure 3, some data can be obtained, and collating the data can get Table 4 the data can be obtained in Table 2.
It can be obtained from the data in Figure 3 and Table 2 that using the IFSTA can greatly reduce the overshoot of the motor, from the overshoot of 145.78 r/min of the PI to the overshoot of 44.17 r/min of the IFSTA, the overshoot reduced by 10%. The adjustment time of the motor is also greatly shortened, from 0.158 s of the adjustment time of PI to 0.017 s of the IFSTA, and the time to reach the stability of the system is shortened by 0.141 s. It shows that the IFSTA + MPCC has good rapidity and damping characteristics at no load.

| Variable speed experiment with load
To verify the variable speed performance of the system with load, the initial load of 5Nm is added to the system, and the system simulation time is set to 0.4 s. The initial speed is 500 r/min, and the speed is mutated at 0.2 s, which is mutated to 1000 r/min. According to the above control methods, the speed of PMSM with load variable speed can be obtained. This is shown in Figure 4.
According to Figure 4 and Table 3, it can be concluded that the overshoot of the IFSTA + MPCC is higher in the medium-speed section, but it has a small F I G U R E 1 The corresponding diagram of the switch state. overshoot in the high-speed section, and the adjustment time of the system is relatively short. It can be seen that this system can achieve the required speed faster even if a speed mutation is given in the process of the load operation, and the rapidity of this system is better than other methods.

| Constant speed variable load experiment
To verify the variable load capacity of the system, first, the motor is rotated at 1000 r/min (i.e., the initial speed ω * r is 1000 r/min), and the simulation time is 0.3 s. At the beginning, no load is applied, and then a load of 10Nm is suddenly increased at 0.2 s of the system to obtain the speed map of the motor with constant speed and variable load for various control methods. This is shown in Figure 5. Collated data are presented in Table 4. According to Figure 5 and Table 4, it can be seen that the overshoot of the IFSTA + MPCC control method is 1.13% at 0.2 s, which is 46.6% smaller than that of the traditional PI control. Looking at the adjustment time of the system, it can be seen that the system can reach a steady state faster in the case of a sudden load. It can be further explained that the proposed system has good robustness.

| EXPERIMENTAL VERIFICATION
The AISim hardware-in-the-loop simulation system is mainly used in the experimental part of this paper. The whole simulation system is composed of a host computer, real-time simulator, servo motor, and torque sensor. The physical simulation platform of the PMSM is shown in Figure 6. First, the whole system works by running MATLAB/Simulink in the host computer, then emulating the simulation model, automatically generating code by using AISim Manager software, and running the generated code in real time in the VxWorks target machine. Finally, the target machine controls the state of the two motors by controlling the motor special control card, the rotation of the servo motor is controlled by the special servo driver, the rotation of the load motor is controlled by the general servo driver, and the torque of the torque sensor is collected by the motor special control card.
The parameters of the servo motor are shown in Table 5. The experimental results on the AISim hardware-in-the-loop platform show that the proposed method has good rapidity, robustness, and good antiinterference ability.

| No load test
Since the rated speed of the motor is small, the experiments are conducted in the motor at a lower speed. The no-load experiment was carried out at 200 r/min, and then no-load speed and current under several different methods were determined for comparison and analysis. Figure 7 shows the speed waveform of Method 1. Figure 8 shows the speed waveform of Method 2. Figure 9 shows the speed waveform of Method 3. Figure 10 shows the speed waveform of the proposed method.
Under four different control methods, the actual no-load rotation of the motor is shown in Figure 7, Figure 8, Figure 9, and Figure 10, respectively. It can be seen from Figure 7 that the speed starts to stabilize T A B L E 3 Parameters of each control method at no load.

Control method
Peak speed 1 (r/min) Adjust time (s) Peak speed 2 (r/min) Adjust time (s) at around 100 s, and the chattering is between 195 and 205 r/min after stabilization. In Figure 8, it tends to be stable at 20 s, and the chattering is between 195 and 203 r/min. In Figure 9, it starts to stabilize at 80 s, and its chattering after stabilization is also between 197 and 202 r/min. In Figure 10, it tends to be stable at 19 s, and the chattering is stable between 198 and 202 r/min. After the above comparison and analysis, it can be seen that the proposed method not only has a small overshoot when the motor rotates without load but also has a smaller speed chattering when it is stable.

| Variable speed experiment with load
In the constant speed and variable load experiment, the no-load rotation was carried out at 200 r/min, and then the load of 5Nm was suddenly increased after the operation was stable. Finally, the speed and current under several different methods were measured for comparison and analysis. Figure 11 shows the speed waveform of Method 1. Figure 12 shows the speed waveform of Method 2. Figure 13 shows the speed waveform of Method 3. Figure 14 shows the speed waveform of the proposed method. Under four different control methods, the actual rotation of the motor in the case of a sudden load is shown in Figure 11, Figure 12, Figure 13, and Figure 14, respectively. It can be seen from Figure 11 that when the load is suddenly applied, the speed suddenly drops to 130 r/min, and it takes a long time to reach the new equilibrium state, and there is also a large chattering when balancing. It can be seen from Figure 12 that when the load is suddenly applied, the speed suddenly drops to 160 r/min, but the new balance is quickly reached, and there is a certain small chattering in the balance. It can be seen from Figure 13 that when the load is suddenly applied, the speed suddenly drops to 150 r/min, and it takes less time to reach the new equilibrium state, and the chattering is very small after the equilibrium state is reached. It can be seen from Figure 14 that when the load is suddenly applied, the speed suddenly drops to 186 r/min, the new equilibrium state is quickly reached, and the chattering after balance is very small. Through the above comparison and analysis, it can be seen that the proposed method shows strong antiinterference ability when the motor is suddenly loaded.

| Constant speed variable load experiment
In the experiment of variable speed with load, the load of 5Nm and 200 r/min was set to rotate at the beginning,  and then after the operation was stable, the speed was suddenly increased to 400 r/min. Finally, the speed under several methods was determined for comparison and analysis.
Under the four different control methods, the motor suddenly increases the given speed in the case of starting with load, and the actual rotation situation is shown in Figure 15, Figure 16, Figure 17, and Figure 18, respectively. It can be seen from Figure 15 that when starting with load, the overshoot phase of the motor is reduced compared with that without load, and the time to reach equilibrium is also shortened. The speed suddenly increases to 400 r/min, it takes a long time to reach the new equilibrium state, and it also has a large chattering at equilibrium. It can be seen from Figure 16 that when the speed is suddenly increased, the new speed balance is quickly reached, that is, the response time is short, and there is also a certain small chattering at equilibrium. It can be seen from Figure 17 that when the speed is suddenly increased, the response time is longer, but it takes less time to reach the new speed equilibrium, and the chattering is very small after reaching the equilibrium state. It can be seen from Figure 18 that when the speed is suddenly increased, not only the new equilibrium state is quickly reached but also the chattering after equilibrium is very small. Through the above comparison and analysis, it can be seen that the proposed method shows a faster response speed when the motor speed is suddenly increased. Through the above  experiments, it can be found that the proposed method has faster convergence speed and stronger antiinterference ability than the traditional methods, whether in no-load, fixed-speed variable load, or variable speed with load.

| CONCLUSIONS
In order to solve the problem that PMSM needs faster response speed, better stable state and strong anti-interference ability in daily use. The traditional speed loop controller is replaced by a high-order sliding mode control (Super-Twisting sliding mode control).
Based on this, the high-order sliding mode control is improved as the speed loop control method, and the MPCC control method is used for the current loop. Compared with the traditional PI control, this control method improves both the current loop and the controller in the speed loop. It is found that the proposed method not only has a faster response speed but also has better stability and anti-interference ability. Not only the simulation results prove the feasibility of the method proposed in this paper but also the hardware-in-loop simulation is used to further confirm the feasibility and effectiveness of the method. In the experimental part, the operation of the motor is observed under three different working conditions. It is found that the method proposed in this paper can still have good operation under different working conditions. It not only has a faster convergence speed but also has a strong anti-interference ability to meet all the conditions of a permanent magnet synchronous motor in daily use.