Abstract
To improve the dynamic quality and control performance of the permanent magnet synchronous motor speed control system, a novel sliding mode control method with improved reaching law for PMSM was proposed, which has a shorter reaching time and small system chattering. An extended state observer (ESO) based on the hyperbolic tangent function for the sliding mode controller is designed to realize the real-time tracking of the mechanical angular velocity and load disturbance of the motor, which can weaken the influence of the internal parameter perturbation and external load disturbance. The performance of the novel sliding mode controller for PMSM was simulated based on MATLAB/Simulink. An experimental platform based on dSPACE is built. The simulation and experimental results show that this novel PMSM controller can effectively suppress the system chattering and improve the dynamic performance and robustness of the system.
Keywords
Introduction
Permanent magnet synchronous motor (PMSM) is widely used in various industries because of its simple structure, high power density and good dynamic performance. However, PMSM is a typical nonlinear multivariable coupling system whose parameters such as flux linkage and d- and q- axis inductance are changed due to magnetic saturation during operation, which caused uncertainty of the control effect. The stability of the control system is highly influenced by the external environment. The performance of the traditional PID controller depends on the accuracy of the system model, which is highly influenced by external disturbances.1–3 Therefore, it is necessary to adopt a better control method to solve the above problems. Various control methods are proposed by researchers around the world in recent years to solve the above problems, such as adaptive control,4,5 active disturbance rejection control,6,7 model predictive control,8–10 and sliding mode control.11–13 Sliding mode control is widely used among them, due to its strong robustness, fast response speed, and insensitivity to the change of internal and external parameters perturbation of the system.
However, the chattering problem existing in the traditional sliding mode control has become a barrier to improve the control performance. Therefore, scholars have proposed solutions from many different perspectives. Slotine and Sastry 14 introduced the concepts of “quasi-sliding mode” and “boundary layer” in the design of sliding mode control and also used the saturation function instead of the switching function to effectively avoid or weaken the chattering. Kawamura et al. 15 designed a new type of disturbance observer to eliminate the chattering caused by the large switching gain of the system, which greatly reduces the switching gain and effectively suppresses the chattering by feed-forward compensation of the external disturbance. By using the concept of convergence law, Gao 16 proposed a chattering elimination method for variable structure control systems.
Among these methods to weaken the chattering, the method of approaching law can ensure the dynamic characteristics and stability of the system, but the traditional exponential and power approaching laws cannot achieve the fast convergence to the sliding mode surface while avoiding chattering. For this purpose, Wang et al. 17 introduced a variable exponential reaching law in the sliding mode controller for PMSM with improved stability of the control variable near the sliding mode boundary. Zhang et al. 18 introduced exponential terms and system state variables based on the traditional power reaching law, which effectively solved the problem of slow reaching speed when the power reaching law is far from the sliding surface. Liu et al. 19 added a terminal attractor based on the traditional exponential reaching law to improve the dynamic quality of the speed control system, but the controller design is complex and the parameter adjustment is difficult. A saturation function was proposed by Dai et al. 20 for solving the chattering problem caused by the sign function, which weakens the chattering of the system and speeds up the convergence speed, but the quality of boundary layer selection directly affects its performance. Qu et al. 21 proposed a fast power reaching law to solve the problem of slow approaching speed when the system is far from the sliding surface, which realizes the global fast convergence of the system, the chattering of the system was suppressed through the introduction of state variables in the controller.
Inspired by the above works, this paper proposes a PMSM sliding mode control strategy based on a novel convergence law and an extended state observer. Firstly, a novel reaching law is designed. Different exponents of the power term are selected according to the distance from the sliding surface, and the system state variables are introduced into the exponent term. A new reaching law with variable exponent power term and variable exponent coefficient is constructed, which effectively weakens the chattering of the system under the premise of maintaining the fast reaching speed of the control system. At the same time, an ESO based on hyperbolic tangent function is designed to realize real-time observation and accurate tracking of motor angular velocity and load disturbance, and then the observation value is feedforward for chattering compensation. The performance of the novel sliding mode controller was numerically simulated in MATLAB/Simulink and validated through a dSPACE-based PMSM control performance test platform. The simulation and experimental results show that the proposed control strategy has better dynamic characteristics and better anti-chattering characteristics compared with PID control and traditional sliding mode control.
The main contributions of this paper are as follows:
The inherent chattering of sliding mode control is a key factor affecting its control performance. The reaching law proposed in this paper can weaken the inherent chattering of sliding mode control, shorten the reaching time, and improve the control performance of the system.
An extended state observer based on hyperbolic tangent function is designed to realize the observation of external disturbance and system parameter perturbation, and then feedforward compensation is carried out to the sliding mode controller to improve the anti-interference ability and fast response ability of the system.
The main structure of this paper is : In the second section, a new reaching law is proposed and the superiority of the new reaching law over the traditional exponential and power reaching law is verified by simulation. Section 3 designs a sliding mode controller based on ESO and verifies its stability. The discretization of the controller is arranged in the fourth section. Sections 5 and 6 show the effectiveness of the control strategy by simulation and experiment. Finally, the seventh part is the conclusions of the study.
A novel reaching law
Traditional reaching laws
In sliding mode control, the reaching law is often introduced to improve the dynamic quality of sliding mode control. Among them, exponential reaching law and power reaching law are commonly used, such as equations (1) and (2) respectively.
Where ε is a constant greater than zero, s for system sliding surface, k is an exponential coefficient, k > 0, q is a constant greater than zero and δ is an exponential term. The analysis of traditional exponential reaching law and power reaching law shows that the traditional exponential reaching law is composed of constant velocity term and exponential term. When the system is far away from the sliding surface (s > 1), both of them work at the same time to quickly approach the sliding surface. When the system is close to the sliding surface (s < 1), the constant velocity reaching term plays a leading role, which leads to large chattering. Although the power reaching law will slow down and reduce the chattering near the sliding surface, the reaching speed is slow when the system is away from the sliding surface.
The proposal of a novel reaching law
A novel reach law is proposed to combine the advantages of the above two reaching laws. As shown in equation (3), the novel reach law has fast convergence speed due to the large attenuation rate away from the sliding surface and reduced chattering due to the small attenuation rate approaching the sliding surface.
Where x is the state variable of the system, λ and β are constants greater than zero, and α is an exponential term. As shown in equation (3), when the system is far away from the sliding surface (∣s∣> = 1), α = 0, the system state variable |x| is relatively large and e-β|x| tends to zero, then the system approaches the sliding surface according to the variable exponential reaching law, which has fast approaching speed adjusting by λ. When the system is close to the sliding surface (∣s∣<1), 0 < α < 1, |x| is small, e-β|x| is close to 1, the exponential term is close to zero, and the power term plays a major role in reaching, the system has a low approaching speed when it is approaching the sliding surface. The chattering during the system approached the sliding mode, is reduced with the introduction of the state variable x.
Performance analysis of novel reaching law
A validation system was constructed to verify the performance of the novel reaching law, as shown in equation (4).
In equation (4), θ(t) is the actual angle signal,
The tracking error is defined as e(t), and then the tracking error and its derivative are expressed as:
Where θd is the ideal angle signal.
Define the sliding mode surface function as:
Among them, c is the sliding mode surface coefficient, c > 0.
Then by combining the three equations (4)–(6), we can get:
According to (3) and (7), the sliding mode control law u(t) based on the novel reaching law can be obtained as follows:
The performance of the three reaching laws is analyzed under the same parameter conditions, and the parameter settings are shown in Table 1.
Parameters of the reaching law.
The ideal position signal of the system is θd(t) = sint, and the initial state x(0) of the controlled object is [x1,x2]=[−10,−10].
Figure 1 is the phase locus of three different reaching laws, Figure 2 is the controller output of three different reaching laws, Figure 3 is the convergence rate of state variables of three different reaching laws, Figure 4 is the position tracking performance of three different reaching law. It can be seen that the novel reaching law has not only high approaching speed and chattering suppression, but also quick convergence speed of state variables x1 and x2 and the ability to track a given signal, compared to the power reaching law and the exponential reaching law. Thus, the new reaching law proposed in this paper has the advantages of accelerating the reaching speed and weakening the chattering of the system.

Phase locus of three different reaching laws: (a) power reaching law, (b) exponential reaching law, and (c) novel reaching law.

Controller output of three different reaching laws: (a) power reaching law, (b) exponential reaching law, and (c) novel reaching law.

Convergence rate of state variables of three different reaching laws: (a) power reaching law, (b) exponential reaching law, and (c) novel reaching law.

Position tracking performance of three different reaching laws: (a) power reaching law, (b) exponential reaching law, and (c) novel reaching law.
Sliding mode controller design
Mathematical model of permanent magnet synchronous motor
The mathematical model of the PMSM is established in the dq-axis coordinate system. The voltage equation of the PMSM with id = 0 is shown below.
where ud, uq, id, and iq are the dq-axis stator voltages and currents, respectively, Ld, and Lq are the dq-axis inductances, respectively, p is the number of pole pairs, Rs is the stator resistance, ψf is the permanent magnet chain, and ωm is the rotor mechanical angular velocity.
The PMSM torque equation with id = 0 is given by
The PMSM equation of motion is
Te and TL are electromagnetic torque and load torque, respectively. J is rotational inertia, and B is viscous friction coefficient.
Design of sliding mode controller based on ESO
The traditional sliding mode control generally adopts a symbolic function, so the control process is discontinuous and inevitably brings chattering. To suppress the chattering of the sliding mode controller and improve the dynamic performance of the system, the ESO with small chattering and high observation accuracy is used to observe the disturbance and angular velocity of the system, and the observation value is feed-forward compensated to the sliding mode controller. After combining novel reaching law and ESO, A novel reaching law anti-disturbance sliding mode control (NRLASMC) strategy with disturbance rejection and compensation capability is proposed.
Substituting equation (10) into equation (11), the equation of motion of the permanent magnet synchronous motor can be written as:
Taking into account the effects of system disturbances and changes in system parameters, equation (12) is written as:
In equation (13)
Considering that disturbance D is unknown, ESO is needed to observe the disturbance and feed forward to the sliding mode controller. D can be extended to the system state variable of the ESO, and its extended state equation is:
ζ(t) is the rate of change of the integrated disturbance D.
The traditional second-order ESO equation is:
where e1(t) is the error between the observed and actual values of mechanical angular velocity, z1(t) is the observed mechanical angular velocity value, z2(t) is the observed total disturbance value, β1, β2 are the observer gain coefficients.
To improve the observation performance of the observer and observe the total disturbance D more accurately, and at the same time improve the adaptive and dynamic response capability of the ESO, a new ESO based on the hyperbolic tangent function is designed, combining equations (14) and (15), the observer equation is as follows:
Where A > 0 is the hyperbolic tangent function adjustment parameter.
From equations (14) and (16), the error state equation can be obtained as follows:
e 2(t) is the estimation error of integrated disturbance.
The speed tracking error is defined as:
ω * is the given value of mechanical angular velocity speed.
The derivative of the speed tracking error is:
To further suppress the system chattering and improve the system regulation accuracy, the integration sliding mode surface is selected as followsÿҰ
Then, from equations (3), (18), and (19), the expression for the controller q-axis current can be obtained as:
Parameter determination and stability analysis
To determine the parameters A and B in equation (16), let
From the reachability condition to the sliding mode dynamics:
Combining with equation (17), equation (22) can be written as:
For A greater than zero or less than zero, it is divided into two cases:
So β1 < −|Ce1+e2|, which can also be written as β1 = −a|Ce1+e2|, where if a > 1 satisfies the condition, a = 2 is chosen according to the literature. 22
The parameter A is chosen so that when the observer state variable reaches the sliding mode surface into the sliding mode there is:
Combining equations (17) and (27), we can get
Formula (28) can be written as :
Solving differential equations can be obtained
where C1 is a constant. To ensure that the disturbance estimation error converges to zero, β2 should be greater than 0, and the convergence rate of the disturbance estimation error can be adjusted by adjusting the value of β2.
The Lyapunov function is used to verify the stability of the control system. The Lyapunov function is constructed as follows:
The Lyapunov stability condition is
According to equations (19), (20), and (21), equation (32) can be written as
In equation (33), the parameters satisfy ε > 0, k > 0,0 =< α < 1, λ > 0, β > 0. When a = b, it can be known from Lyapunov function stability theorem that the designed sliding mode controller is asymptotically stable.
Discrete control system
In the actual engineering experiments, the computer real-time control is a discrete system, so the proposed control method should be discretized.
Discretization of PID control
The output of the controller is set to u, then the output value of the ηth time is u(η), e is the input deviation of the controller, and the sampling period of the system is T = 100 μs, then the incremental PID discrete form is:
Therefore, the incremental PID controller output is
Discretization of the NRLASMC control law
Theoretically, sliding mode control is mainly for continuous systems, and discrete systems sliding mode control can only produce quasi-sliding mode control, 23 with which the corresponding resulting convergence state is called quasi-sliding mode, then the switching band expression is
Where 2Δ is the width of the switching band. The quasi-sliding modes are divided into ideal quasi-sliding modes that reach the sliding mode surface in a finite step and move on it, and non-ideal sliding modes that continuously traverse the switching surface within the switching band, which are called quasi-sliding modes controlled by the sliding mode variable structure.
The state variables are defined as follows:
From equation (13), we can obtain:
Discrete equation (38)
The sliding surface function is:
Discrete equation (3)
To ensure the convergence of the controller output, the exponential term coefficient k and the sampling period T in the above equation should satisfy the condition: 1-kT > 0.
Combining equations (39) and (41), we get:
Numerical simulation
To verify the operating performance of NRLASMC, the control system scheme shown in Figure 5 is used to build a simulation model based on MATLAB/Simulink, and the NRLASMC control is simulated and compared with the conventional PID control.

Block diagram of PMSM speed control system.
The simulation parameters of the permanent magnet synchronous motor are shown in Table 2.
Parameters of permanent magnet synchronous motor.
Nonsingular terminal sliding mode control based on exponential reaching law, nonsingular terminal sliding surface is:
So NTSMC parameters are:
PID controller parameters: speed loop kp = 0.8, ki = 32, kd = 0.0015. Each parameter of the NRLASMC controller is: c = 0.01, ε = 10, k = 121, λ = 0.1, α = 0.5, β = 2, β1 = −*2|Ce1+e2|, β2 = 2000, β3 = 0.8.
All three controllers have the same dq-axis current loop parameters. d-axis current loop PI controller parameters are kp = 27, ki = 40; q-axis current loop PI controller parameters are kp = 0.46, ki = 80.
Figure 6 shows the response curves of the speed of the permanent magnet synchronous motor under the PID control, NTSMC control, and NRLASMC control strategies with a given speed of 800 rpm for the non-load start, 0.3 s for sudden load increase, and 0.7 s for the speed increase.

PMSM speed response under PID and NRLASMC control.
Table 3 shows the results of comparing the performance of the three controllers. The system under NRLASMC control is better than PID and NTSMC control in terms of the speed of starting response, the size of speed drop for sudden load increase and the response speed at sudden speed increase.
Comparison of the performance of three controllers.
Figures 7 and 8 show the response curves of the torque and three-phase current of the permanent magnet synchronous motor under the PID control and NRLASMC control strategies with a given speed of 800 rpm for the non-load start, 0.3 s for sudden load increase, and 0.7 s for the speed increase.

PMSM output torque under PID and NRLASMC: (a) output torque under PID control and (b) output torque under NRLASMC control.

PMSM three-phase input current under PID and NRLASMC control: (a) three-phase input current under PID control and (b) three-phase input current under NRLASMC control.
From Figure 7, it can be obtained that when the load is suddenly increased to 0.3 N m, the system is sensitive to load perturbation under PID control, and the electromagnetic torque fluctuation is significantly higher than that of the system under NRLASMC control, and the former torque fluctuation is significantly higher than that of the latter when the speed is suddenly increased, and in addition, because the NRLASMC control adopts a novel reaching law to suppress chattering, the suppression effect of the controller on torque pulsation is obvious.
From Figure 8, the peak value and vibration of the three-phase currents at the non-load start, sudden load increase, and sudden speed increase under NRLASMC control are significantly smaller than PID control.
Figure 9 is the comparison between actual load torque and ESO observed load torque, Figure 10 shows the difference between the observed angular velocity of the extended state observer and the actual angular velocity.

Results of load torque observation.

Angular velocity tracking error.
From Figures 9 and 10, it can be obtained that the ESO has a fast response speed and small observation error to observe the given torque, the angular velocity tracking error is small and the convergence speed is fast, so the performance can meet the system requirements.
Experimental demonstration
To further verify the effectiveness of the proposed theory and NRLASMC control strategy, a semi-physical experimental platform of PMSM based on dSPACE 1202 and ControlDesk real-time control is built, shown in Figure 11. The driver board integrates a three-phase stator current detection circuit, DC side bus voltage detection circuit, and three-phase inverter circuit, and the PMSM comes with an encoder module, which can transmit the collected rotor position signal to the ds1202 controller.

Block diagram of hardware system.
A physical diagram corresponding to Figure 11 is built as shown in Figure 12. A performance validation experiments of the PID controller, sliding mode controller and NRLASMC controller of the PMSM are carried out through the above platform.

Physical figure.
The PMSM parameters are the same as the simulation, the inverter switching frequency is 20 kHz, the controller sampling period is 100 µs, and the DC side bus voltage is 24 V. The controller parameters are set as in Table 4.
Controller parameters.
The
The current loop PI parameters are the same for all three controllers. d-axis current loop parameters are: kp = 25, ki = 5, q-axis current loop parameters are: kp = 0.4, ki = 80. Since the controller used is dSPACE, it is only necessary to replace the physical parts of the pure simulation model such as PMSM, inverter, sensors, etc. with the RTI interface that comes with dSPACE in Simulink, in addition to replacing the continuous modules in the simulation with discrete modules, and then compile them into code for real-time control in ControlDesk.
In the experiment, the PMSM starts without load. Given the initial speed of 1000 rpm, the speed is increased to1200 rpm in 10 s. The speed response and q-axis current waveform of the PMSM under three control methods are compared and analyzed. The experimental results are shown in Figure 13.

Dynamic performance of the system under PID, SMC, and NRLASMC control: (a) speed response of PMSM under PID, SMC, and NRLASMC control when starting and increasing speed, (b) Q-axis current response of PMSM under PID control when starting and increasing speed, (c) Q-axis current response of PMSM under SMC control when starting and increasing speed, and (d) Q-axis current response of PMSM under NRLASMC control when starting and increasing speed.
Table 5 shows the performance comparison of the system under the three control methods. It is clear that compared with PID control and SMC control, the system can reach the steady state without overshoot in only 0.68 s under NRLASMC control, and the peak q-axis current at start-up is lower than the former two. Therefore, the NRLASMC proposed in this paper can effectively improve the system response speed, reduce the system vibration and strengthen the steady-state performance of the system.
Comparison of the performance of three controllers.
Conclusion
Given the shortcomings of the traditional reaching law in sliding mode control, such as slow convergence speed and large vibration, a novel reaching law is proposed, which can accelerate the convergence speed and weaken the system vibration at the same time, the proposed ESO observes the integrated disturbance of the system accurately, the rapid response capability of the system is improved, and the inherent chattering of the sliding mode controller is suppressed obviously.
A comparing analysis for the performances of the traditional power, exponential reaching law, and the proposed novel reaching law is carried out, which shows that the proposed novel reaching law is superior to the former two in terms of the convergence speed of the control law and the state variable and the ability to track the given signal.
In addition, the NRLASMC control is compared with the traditional PID control by MATLAB/Simulink simulation. The proposed NRLASMC has strong robustness, fast response, and small chattering. The ESO based on the hyperbolic tangent function can accurately estimate the system disturbance in real-time, and the control accuracy of the system is greatly improved.
To further verify the performance of the controller, the dSPACE-based PMSM experiments are carried out under three different control modes. The results show that the proposed NRLASMC can reduce the steady-state error of the system, and has the advantages of fast response and small chattering.
Footnotes
Appendix
Acknowledgements
The authors thank Yongming Liu, Lei Wang, and Manman Xu for their constructive comments on the paper. We thank Jingsong Gui, Tielong Tang, and Xiangdong Wang for their support and assistance with the experiments in this work.
Handling Editor: Chenhui Liang
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: Supported by the overseas study visit and training program for outstanding young backbone talents of Anhui Province (gxgwfx2021035), Supported by the innovation team of Anhui Polytechnic University, Special display and Imaging Technology Anhui Technology Innovation Center open project support (2020AJ06001).
