Sliding Mode Observer-Based Parameter Identification and Disturbance Compensation for Optimizing the Mode Predictive Control of PMSM

: This paper reports on the optimal speed control problem in permanent magnet synchronous motor (PMSM) systems. To improve the speed control performance of a PMSM system, a model predictive control (MPC) method is incorporated into the control design of the speed loop. The control performance of the conventional MPC for PMSM systems is destroyed because of system disturbances such as parameter mismatches and external disturbances. To implement the MPC method in practical applications and to improve its robustness, a compensated scheme with an extended sliding mode observer (ESMO) is proposed in this paper. Firstly, for observing if and when the system model is mismatched, the ESMO is regarded as an extended sliding mode parameter observer (ESMPO) to identify the main mechanical parameters. The accurately obtained mechanical parameters are then updated into the MPC model. In addition, to overcome the influence of external load disturbances on the system, the observer is regarded as an extended sliding mode disturbance observer (ESMDO) to observe the unknown disturbances and provide a feed-forward compensation item based on the estimated disturbances to the model predictive speed controller. The simulation and experimental results show that the proposed ESMO can accurately observe the mechanical parameters of the system. Moreover, the optimized MPC improves the dynamic response behavior and exhibits a satisfactory disturbance rejection performance.

mismatched parameters with reduced chattering by properly designing the control and feedback gains. This observer compromises between the response speed and chattering suppression. In Reference [32], a soft-switching SMO with a flexible boundary layer was designed using a sinusoidal saturation function to reduce the chattering phenomenon, while maintaining the disturbance rejection property. In References [33,34], an integral terminal sliding mode control method was proposed to achieve faster convergence and to reduce the steady-state tracking errors. In References [31,35], a novel approach law with a variable gain was proposed to improve the dynamic response performance and reduce chattering.
Given the aforementioned problems, this paper proposes an optimal DMPC with an ESMO (DMPC+ESMO) to improve the speed control and disturbance rejection performances of a PMSM system. Firstly, when the model of the controlled system is inaccurate or unknown, an ESMO with an integral sliding surface is established, and the designed ESMO is regarded as an extended sliding mode parameter observer (ESMPO) to identify the mechanical parameters of the PMSM system. After accurately determining the mechanical parameters, a discrete state-space model is employed using the mechanical parameters of the PMSM system, and a DMPC is designed for the speed loop of the system. An optimal control action sequence is then obtained by minimizing the cost function. In addition, speed-tracking errors and speed fluctuations will exist when the PMSM is running due to external load disturbances. Thus, a feed-forward compensation technology including an ESMO was incorporated into the system. The designed ESMO is regarded as an ESMDO to observe the external disturbances and immediately provide feedback to the speed controller and to allow the speed controller to compensate for the observed disturbances. Finally, a DMPC along with an ESMO method was developed for the speed loop of the PMSM system.
The rest of this paper is organized as follows. In Section 2, the mathematical model of the PMSM system and the implementation approach of the DMPC are introduced. In Section 3, the design of the ESMO and the procedure of the parameter observation method are presented. In Section 4, a simulation using MATLAB and the results of an experiment conducted on a digital control system using the DMPC+ESMO method for a PMSM system are presented. The conclusions of this study are given in Section 5.

Mathematical Model of the PMSM
For a surface-mounted PMSM, the current mathematical model in the dq-synchronous reference frame can be expressed as follows [18]: where id and iq are the stator currents in the dq-axis, ud and uq are the stator voltages in the dq-axis, Ld = Lq = Ls is the stator winding inductance, Rs is the stator winding resistance, is the permanent magnet flux linkage, is the rotor mechanical angular velocity, and is the number of pole pairs.
For a rotor flux orientation control strategy (id = 0), the mechanical motion equation can be written in the dq-synchronous rotating reference frame, and the mathematical model of a PMSM system can be expressed as follows: where J is the moment of inertia, Teis the electromagnetic torque, TLis the load torque, B is the viscous damping coefficient, and Kt is the torque coefficient. Figure 1 shows the structure of the optimized DMPC with an ESMO.

Design of DMPC for the PMSM
In this paper, a DMPC is designed for the speed loop. To realize computer implementation, an embedded integrator is embedded in the MPC design. The integrator helps reduce the uncertainty of the system in applications and remove the load disturbance torque [14]. In the absence of external disturbances, Equation (2) can be rewritten as follows: A forward Euler algorithm is applied to Equation (4), such that the discrete-time expression of the predicted rotor mechanical angular velocity at the next sampling instant can be written as follows: where Ts is the sampling period. Thereafter, a discrete state-space model of the PMSM system is used to predict the future outputs online over a defined predicted horizon. In this instance, the predicted output of the system can be expressed as follows: and Cm are the coefficients of the state equation, and is the output of the prediction model. In this PMSM speed control system, the state variable is the rotor mechanical angular velocity , and = . Moreover, to realize incremental control in the embedded system, the above state-space equation, i.e., Equation (6), is rewritten as follows: The new state variables are defined by the differences between the states for any two successive sample instants, and the new state space model equations are obtained.
It is assumed that at the current sampling instant k (k> 0), the state variable vector x(k) is the current information of the controlled plant, made available through measurement. With the current information of the state variable x(k), the future state variables can be predicted for Np sampling instants, where Np is the prediction horizon. According to the state-space model (8), the future state variables can be predicted sequentially using the future control action sequence Δu.
where x(k+m|k) is the predicted state variable at the sampling instant k+m, which is calculated with the current state variable x(k), and Nc (Nc≤ Np) is the control horizon. According to the state-space model (8) and (9), with the state variable information x(k) and the future control action Δu, the predicted output for the next Np instantscan be predicted.
where y(k+m|k) is the predicted output of the system at the sampling instant k. The predicted output vectors for the next Np steps of the samples can then be obtained.
According to the augmented state-space model (8), F is a Np ×2 matrix, G is a Np × Nc matrix.

Closed Loop Implementation of DMPC
The purpose of the speed loop optimal control is to determine the optimal incremental control action sequence with a cost function and to ensure that the predicted output of the system is as close as possible to the reference value. With the closed-loop feedback structure, the predictive control action sequence can be corrected in real time. Thus, the DMPC can guarantee the system output to track the command.
The reference vector, which is composed of the reference values, can be expressed as follows: where Yr is the reference vector for the next Np samples, yr is the set value for the sampling instant k, Ry is a Np dimensional unit column vector in this controller. The cost function Jopt that reflects the control objective is then defined as follows: where Q is a Np× Np positive diagonal weight matrix, and R is a Nc× Nc positive diagonal weight matrix. The first item of the cost function is used to ensure minimum error between the output and the reference value, and the second item of the cost function ensures a lower value of ΔU to suppress the oscillation of the system. Combining the above with Equation (11), Equation (13) can be written as follows: Here, the necessary condition for finding the optimal control action sequence ΔU that minimizing Jopt is ∆ = 0. In the absence of constraints, the global optimal control sequence can be obtained by solving this equation as follows: The optimal control action sequence for the next Nc sampling instants can be obtained by minimizing the cost function (13); however, only the first one is applied to the plant as follows: where Kyis the first element of: and Kxy is the first element of: The closed-loop system equation can be obtained by substituting Equation (16) into Equation (8).
Because of the special structures of the augmented state-space model parameter matrices A and C, the last column of the matrix F is identical to the unit column vector Ry = [1,1…1] T . Therefore, Kyis identical to the last element of Kxy, and Kxy can be written as Kxy= [Kx Ky]. To further reflect the closed-loop structure and facilitate computer implementation, control action (16) can be rewritten as follows: The matricesKx andKycan be computed off-line, and the control action u(k) can be computed on-line using Equation (18). Figure 2 shows the block diagram of the discrete-time MPC system.

DesignofExtended Sliding Mode Observer
Given that the PMSM system will be affected by parameter mismatches and external disturbances during operation, the mathematical model of a PMSM system for practical applications can be expressed as follows: where J = J0 + ΔJ, and B = B0 + ΔB. The parameters B0 and J0are the initial values of the viscous damping coefficient and moment of inertia respectively. They can be determined based on experience and prior knowledge. ΔJ and ΔB are parameter mismatch errors. Combining Equation (2) with Equation (19), the initial motion equation can be obtained: where d represents the system disturbances including parameter mismatch errors and external load disturbances.
In a PMSM drive system, the electrical time constant is significantly smaller than the mechanical time constant, and the sampling period is very short. The system disturbances change slowly compared to other system status signals in every sampling period of the speed loop. Thus, its first derivative is zero.
According to Equation (20), the mechanical angular velocity and the system disturbances are defined as state variables. The extended state space equation can be expressed as follows: In the extended state space Equation (22), the mechanical angular velocity and the disturbance d are regarded as observation targets. Thus, the ESMO can be constructed as follows: where ̂ is the estimated value of the mechanical angular velocity, is the estimated value of the system disturbances, The design of the sliding mode surface determines the observation quality of the SMO. The integral sliding mode surface can reduce the chattering of the system and the steady-state error and avoid the analysis of the second derivative. The integral terminal sliding surface is set as follows: where > 0 is a positive integral coefficient.
In applications, because of the difference calculation in the next part, it is necessary to further suppress the chattering problem. Therefore, a smooth switching function ( ) is used instead of the traditional switching function sgn( ).
where > 0 is a constant. Combining the above with Equations (22), (23), and (25), the equation for the observation error can be written as: Proof: The Lyapunov function candidate is considered.
Differentiating V with respect to time t yields the following. which can be simplified as follows: Therefore, the sliding mode control gain k1 can be obtained as follows: This can ensure that the designed observer is stable and that any tracking error trajectory will converge to zero in a finite time.
On the other hand, based on the above ESMO, when the observer trajectory arrives at the sliding surface and remains there, the following condition should be satisfied.
The following is obtained by substituting Equation (35)   where C0is a constant, and J0> 0. To ensure that the observation error converges to zero, the observer feedback gain must be such that k2< 0. According to the above analysis, the system parameters will affect the gain of the observer. By properly adjusting the gain coefficient k1 and k2, the observer can achieve a good observation performance. Figure 3 shows a block diagram of the ESMO. □

Parameter ObservationSteps
According to Equation (24), the mechanical parameters can be extracted and calculated from the observation disturbances. The mechanical parameters are estimated in three steps [27]. Figure 4 shows the procedure diagram of mechanical parameter estimation. Firstly, the parameter B should be estimated. In the first stage, the PMSM needs to be operated at two different steady-state speeds, and the parameter B can be estimated from the measured velocity information and the observed disturbances. Secondly, the parameter J can be estimated after the parameter B is obtained and updated. In this stage, the PMSM needs to be operated under two different constant accelerations or decelerations, and the parameter J can be estimated from the acceleration or deceleration information and the observed disturbances. Finally, after obtaining and updating the parameters B and J, the ESMO can be regarded as an ESMDO, and the external load torque TL can be directly estimated from the observation d. An optimal DMPC cannot be established without determining the exact parameters. Therefore, a non-optimal PI speed controller based on a trial-and-error method was used to estimate the mechanical parameters. Although the non-optimal PI controller cannot achieve optimal control performance, only the steady-state information is needed in the parameter estimation process; the non-optimal PI controller has little impact on the parameter estimation process [29]. Figure 5 shows the principle diagram of parameter estimation. When estimating B, as shown in Figure 5a, the PMSM needs to be operated at two different steady-state speeds, which satisfy the condition ω(t) ≠ ω(t+T) with their accelerations being zero. In Figure 5, Tis a predetermined time delay that keeps the system stable for a period of time under the two different speed commands. When the PMSM is operated at the first steady-state speed ω(t) for a period of T, according to Equation (24), the observed disturbance can be obtained as follows: The observed disturbance for the second steady-state speed ω(t+T) can be obtained by changing the speed command and keeping it for a period of T as follows: The load torque TL0 of the PMSM system is constant when the PMSM control system is in the steady state. It can be obtained by subtracting Equation (38) from (39).
Thus, the parameter mismatch error ΔB̂ can be obtained as follows: The observed value of the parameter ΔB can be estimated as follows: After the parameter Bis estimated accurately, the initial value B0in Equation (23) can be updated using B, and it should satisfy ΔB = B−B= 0.
As shown in Figure 5b, when estimating J, the PMSM needs to be operated at a constant acceleration state r1 for a period of T. According to Equation (24) and given that ΔB= 0, the observed disturbance can be obtained as follows: The observed disturbance for the other constant acceleration state r2 can be obtained by changing the acceleration command and keeping it for a period of T.
Subtracting Equation (44) from Equation (43) gives the following: Thus, the parameter mismatch error ΔĴ can be obtained as follows: Therefore, the parameter Ĵ can be estimated as follows: When the parameters Band J are estimated accurately, the initial B0 and J0 in Equation (24)  The above analysis shows that the proposed ESMO can observe the system disturbances in real-time. In practical applications, the proposed ESMO can be used to optimize the speed controller by estimating the system parameters Band J. Moreover, it can be used to improve the anti-disturbance ability of the system by estimating the external load torque TL and compensating it online.

Simulation and Experimental Results
To demonstrate the effectiveness of the proposed control method, a model of the PMSM system was established using MATLAB/Simulink. Experiments were then conducted on a PMSM drive system. This section reports the results. Table 1 lists the actual system parameters of the PMSM.

Simulation Resultsand Analysis
The simulation was conducted under parameter mismatches and a step external load disturbance to test the performance of the proposed ESMO. At the stage of estimating Band J, different initial values B0 and J0are set to the model. Figures 6 and 7 show the observed results of the parameter B. Figures 8 and 9 show the observed results of the parameter J. When estimating TL,the system applies an external disturbance of 1 N•m at 1 s and then unloads it at 2 s. Figure 10 shows the observed results of the external load disturbance TL.  As shown in Figures 6 and 7, for different initial values of B0, the estimated value B̂ can be made to converge to the real value by operating the motor at different stable speeds. As shown in Figures 8 and 9, for different initial values of J0, the estimated value J can be made to converge to the real value by operating the motor at track different accelerations. After accurately obtaining the mechanical parameters, the proposed observer can be used to observe the external load disturbances. As shown in Figure 10, the proposed ESMO can estimate the external load disturbance precisely and quickly.
The above simulation results show that in the case of parameter mismatches, the proposed observer can estimate and update the observed parameters in real time. Moreover, after updating the parameters, the ESMO can estimate the external disturbance promptly and accurately and provide the observed disturbances as feed-forward compensation for the speed controller.

Experimental Results and Analysis
To further verify the performance of the proposed DMPC with the ESMO method, experiments based on a PMSM drive system are conducted. Figure 11 shows the experimental platform. The proposed control method is realized based on the DSP-TMS320F28335and FPGA-EP3C40F324-based  According to the method described above, the experiment is conducted in three steps. Firstly, the parameter B should be observed and updated. As shown in Figure 12a, the initial value B0 is set to ten times the true value, i.e., B0= 10B, and the PMSM is operated at alternate speeds of 300 and 600 rpm. Figure 12b shows the observed results for the parameter mismatch error ΔB. Figure 12c shows the estimated result of the parameter B. As shown in Figure 13a, the initial value B0 is set to five times the true value, i.e., B0 = 5B, and the PMSM is operated at alternate speeds of −300 and −600 rpm. Figure 13b shows the observed results for the parameter mismatch error ΔB. Figure 13c shows the estimated results of the parameter B . The parameter J is then observed and updated. As shown in Figure 14a, the initial value J0 is set to 20 times the true value J, i.e., J0 = 20J, and the motor is operated to track the acceleration of ±420 rpm/s in the forward direction. Figure 14b shows the observed results for the parameter mismatch error ΔJ. Figure 14c shows the estimated results of the parameter J. As shown in Figure 15a, the initial value J0 is set to ten times the true value J, i.e., J0 = 10J, and the motor is operated to track the acceleration instruction of ±420 rpm/s in the negative direction. Figure 15b shows the observed results for the parameter mismatch error ΔJ. Figure 15c shows the estimated results of the parameter J.
Finally, the observed results of the mechanical parameters can be used to optimize the speed controller and update the observer. When the motor is operated at a given speed of 600 rpm, Figure  16 shows the results under the PI and DMPC method. Then, the system applies an external load disturbance of 1 N at 3 s and then unloads it at 6 s. Figure 17 shows the results obtained using the PI speed controller. Figure 18 shows the results obtained using the DMPC+ESMO method. As shown in Figures 12-15, when the model parameters are mismatched, the estimated value B can be made to converge to the real value by operating the motor at different stable speeds. The estimated value J can be made to converge to the real value by operating the motor to track the different acceleration instructions.  After accurately estimating the mechanical model parameters, the state-space model can be obtained, and the proposed observer can be updated using the estimated parameters. An optimized DMPC with an ESMO can be established for the speed loop.
As shown in Figure 16a, to obtain a faster speed response, the PI method will produce an obvious overshoot in the rising phase. In Figure 16b,c, the DMPC method can achieve a faster speed response with a few overshoots. However, under parameter mismatches, the control performance of the DMPC method will be destroyed. As shown in Figure 16b, the DMPC controller is employed under the condition that the parameter is mismatched with B0 = 4BandJ0 = 2J. The DMPC method will have a large speed fluctuation near the given speed reference value. The more serious parameter mismatches will lead to greater speed fluctuations and even system instability. As shown  Figure 16c, by using the ESMO to estimate and update parameters, the DMPC+ ESMO method can achieve a better control effect.
As shown in Figure 17, the PI method after updating the parameters can achieve a faster response; however, it results in a significant speed fluctuation when the system is disturbed. To overcome the undesirable speed fluctuation due to the external disturbance, a higher proportional coefficient is required. This will cause a large overshoot in the rise phase. As shown in Figure 18, the DMPC+ESMO method can be employed in the speed loop after updating the parameters. The DMPC controller can achieve an optimal speed control with the optimal control action sequence, and the disturbance compensation technology with the ESMO is applied to improve the anti-disturbance ability and the robustness of the system. A comparison between Figures 17 and 18 shows that when the system loads the external disturbance, the maximum speed fluctuation under the PI method is 54 rpm, whereas the proposed DMPC with the ESMO reduces the maximum speed fluctuation to 24 rpm. The maximum speed fluctuation is reduced by 5%. In Figure 19, the proposed ESMDO accurately and promptly estimates the external load disturbance.

Conclusions
In this study, a discrete model predictive controller with an extended sliding mode observer was developed for the speed control system of a PMSM to achieve an optimal speed controlin embedded systems and improve the disturbance rejection performance of the system. The designed controller enabled the system to attain a better dynamic response and reduce speed fluctuations. Moreover, the proposed ESMO could accurately identify the model parameters and the load disturbance of the system. The accurately obtained parameters could be used to update the DMPC, and the observed disturbance is immediately provided as feedback to the DMPC. The simulations and experimental results showed that the DMPC+ESMO method is effective for PMSM speed control systems, enabling better control performance and anti-disturbance ability.