On Speed Control of a Permanent Magnet Synchronous Motor with Current Predictive Compensation

In this study, a current model predictive controller (MPC) is designed for a permanent magnet synchronous motor (PMSM) where the speed of the motor can be regulated precisely. First, the mathematical model, the specifications, and the drive topology of the PMSM are introduced, followed by an elaboration of the design of the MPC. The MPC is then used to predict the current in a discrete-time calculation. The phase current at the next sampling step can be estimated to compensate the current errors, thereby modifying the three-phase currents of the motor. Next, Simulink modeling of the MPC algorithm is given, with three-phase current waveforms compared when the motor is operated under the designed MPC and a traditional vector control for PMSM. Finally, the speed responses are measured when the motor is controlled by traditional control methods and the MPC approach under varied speed references and loads. In comparison with traditional controllers, both the simulation and the experimental results suggest that the MPC for the PMSM can improve the speed-tracking performance of the motor and that this motor has a fast speed response and small steady-state errors under the rated load.


Introduction
Permanent magnet synchronous motor (PMSM) technology is widely explored and employed in industrial equipment, aerospace aircraft, domestic appliances, and electric vehicles. The motor takes advantage of high working efficiency, high power density, highly accurate position tracking, and low power factor, as compared to induction motors [1]. One popular application of PMSM is the surface-mounted permanent magnet (PM) motor, with embedded PM motors already widely used in industry. The direct-axis inductance L d and quadrature-axis inductance L q of the surface-mounted PM motor are equal because this motor has identical air gaps around the stator [2]. The identical inductance values enhance the performance of the power converter for the motor as a load. Consequently, control of the motor becomes easier, since the motor is at a constant load. As of now, field-oriented control (FOC) is widely employed for PMSM [3]. After sampling the phase currents of the motor, the controller of the motor converts three-phase current signals to two orthogonal values via Clark and Parker transformations. The alternating-current motor can be controlled like a direct-current motor because the amplitude of phase voltage or current can be directly regulated to control the motor, thus improving its performance and simplifying the control [4]. Generally, the current loop regulation for PMSM includes hysteresis control and pulse width modulation (PWM) [5]. Vector control further simplifies calculation steps. The whole performance of the motor is improved by MPC with a fast response and smaller response errors.

PMSM Model
The voltage equation for the PMSM under Cartesian coordinates can be expressed by Equation (1), neglecting local magnetic circuit saturation, eddy losses, and hysteresis losses.
The equation for flux linkage of the motor can be expressed by λ 3s = L 3s i 3s + ϕ f · F 3s (θ) (2) where λ 3s is the flux linkage of the three windings. u 3s , R 3s and i 3s are voltages, resistances, and currents of the motor, respectively. L 3s is the three-phase inductance, and F 3s (θ) is the three-phase angle.
where L m3 are mutual inductances, and L l3 are inductance leakages. The torque of the motor can be calculated as T e = 1 2 p n ∂ ∂θ m i T 3s ·λ 3s (9) p n are pole pairs of the motor. The dynamic behavior of the motor can be expressed by where J is the rotating inertia of the motor, B is the damping coefficient, and T L is the loading torque.
ω m is the angular speed of the motor. Two classical current regulations, hysteresis comparator and

Drive Topology
The three-phase inverter topology for PMSM is shown in Figure 1. Six metal-oxide semiconductor field-effect transistors (MOSFETs) and their states are given and indicated as S 1 -S 6 . For one bridge, S 1 and S 4 cannot switch on simultaneously in case of a short circuit between Vdc and the ground. Therefore, when S 1 switches on, S 4 will switch off and vice versa. For three-phase alternative current motors, six MOSFETs construct eight switching modes, i.e., V 1 -V 6 , as shown in Figure 2. The eight vectors divide the vector plane into six sections for the motor.

Drive Topology
The three-phase inverter topology for PMSM is shown in Figure 1. Six metal-oxide semiconductor field-effect transistors (MOSFETs) and their states are given and indicated as S1-S6. For one bridge, S1 and S4 cannot switch on simultaneously in case of a short circuit between Vdc and the ground. Therefore, when S1 switches on, S4 will switch off and vice versa. For three-phase alternative current motors, six MOSFETs construct eight switching modes, i.e., V1-V6, as shown in Figure 2. The eight vectors divide the vector plane into six sections for the motor.

Model Predictive Control
An MPC consists mainly of three parts: (1) a cost function, (2) a predictive model of the inverter, and (3) a model of the load. For the control of the PMSM, the load is the PMSM. The entire control scheme is shown in Figure 3. A predictive current is obtained by a predictive model that includes parts 2 and 3. The predictive current and the current reference are the inputs of part 1. If a static power converter can be controlled by a set of switching states within a finite number, these states can be predicted by an MPC according to criteria that can estimate the predictive values. This criterion is called the cost function. This function is used to predict the future variables for the system or the

Drive Topology
The three-phase inverter topology for PMSM is shown in Figure 1. Six metal-oxide semiconductor field-effect transistors (MOSFETs) and their states are given and indicated as S1-S6. For one bridge, S1 and S4 cannot switch on simultaneously in case of a short circuit between Vdc and the ground. Therefore, when S1 switches on, S4 will switch off and vice versa. For three-phase alternative current motors, six MOSFETs construct eight switching modes, i.e., V1-V6, as shown in Figure 2. The eight vectors divide the vector plane into six sections for the motor.

Model Predictive Control
An MPC consists mainly of three parts: (1) a cost function, (2) a predictive model of the inverter, and (3) a model of the load. For the control of the PMSM, the load is the PMSM. The entire control scheme is shown in Figure 3. A predictive current is obtained by a predictive model that includes parts 2 and 3. The predictive current and the current reference are the inputs of part 1. If a static power converter can be controlled by a set of switching states within a finite number, these states can be predicted by an MPC according to criteria that can estimate the predictive values. This criterion is called the cost function. This function is used to predict the future variables for the system or the  scheme is shown in Figure 3. A predictive current is obtained by a predictive model that includes parts 2 and 3. The predictive current and the current reference are the inputs of part 1. If a static power converter can be controlled by a set of switching states within a finite number, these states can be predicted by an MPC according to criteria that can estimate the predictive values. This criterion is called the cost function. This function is used to predict the future variables for the system or the switching states of the inverter. The state that minimizes the cost function is usually the criterion. In this study, a current MPC is employed to control a PMSM. As a load, the model of the PMSM has been given. However, the discrete-time model of the motor is needed, and this model will be an important part of the predictive model. In addition, this predictive model should take the model of the inverter into consideration as well. The states of the switches can be expressed by Equation (11) where = / and the voltage vector generated by the inverter is formulated as Equation Consequently, the load voltage vector can be calculated by the switching states.
= (13) According to the voltage vector of Equation (12), the current vectors for the PMSM can be expressed as Equation (14), and the back electromagnetic force s Equation (15).
The load current dynamic is calculated in Equation (16): This function can be expressed by two equations after Clark and Parker transformation: In this study, a current MPC is employed to control a PMSM. As a load, the model of the PMSM has been given. However, the discrete-time model of the motor is needed, and this model will be an important part of the predictive model. In addition, this predictive model should take the model of the inverter into consideration as well. The states of the switches can be expressed by Equation (11): where a = e j2π/3 and the voltage vector generated by the inverter is formulated as Equation (12).
Consequently, the load voltage vector can be calculated by the switching states.
According to the voltage vector of Equation (12), the current vectors for the PMSM can be expressed as Equation (14), and the back electromagnetic force s Equation (15).
The load current dynamic is calculated in Equation (16): This function can be expressed by two equations after Clark and Parker transformation: Energies 2019, 12, 65 The discretized dynamic functions of the predictive model from Equations (17) and (18) can be expressed as The discrete currents derived from Equations (19) and (20) according to the dynamic functions are The cost function is used to select the voltage vector for the PMSM. The voltage vectors will be applied to the inverter so that the phase currents of the PMSM will reach the expected current references in the next sampling time after minimizing the cost function. The consequence is that the predictive current will be applied to the motor, and it will be operated according to the references. For current prediction of the PMSM, the cost function is given as Equation (23). The flow chart of the current predictive control is shown in Figure 4. Assuming that the initial value of the cost function is infinite, when the temporary variable j changes from 0 to 7, the states of the MOSFETs will be determined. First, the voltage vector can be obtained according to Equation (13). Then, the predicted current in the d-q axis can be calculated from Equations (22) and (23), respectively. Finally, according to the cost function, as given in Equation (23), the states of the MOSFETs will be obtained if the temporary variable j = 7. Otherwise, the program will jump to Equation (13). The corresponding control algorithm code is shown in the Appendix A.
Energies 2018, 11, x FOR PEER REVIEW 6 of 16 The discrete currents derived from Equations (19) and (20) according to the dynamic functions are The cost function is used to select the voltage vector for the PMSM. The voltage vectors will be applied to the inverter so that the phase currents of the PMSM will reach the expected current references in the next sampling time after minimizing the cost function. The consequence is that the predictive current will be applied to the motor, and it will be operated according to the references. For current prediction of the PMSM, the cost function is given as Equation (23). The flow chart of the current predictive control is shown in Figure 4. Assuming that the initial value of the cost function is infinite, when the temporary variable j changes from 0 to 7, the states of the MOSFETs will be determined. First, the voltage vector can be obtained according to Equation (13). Then, the predicted current in the d-q axis can be calculated from Equations (22) and (23), respectively. Finally, according to the cost function, as given in Equation (23), the states of the MOSFETs will be obtained if the temporary variable j = 7. Otherwise, the program will jump to Equation (13). The corresponding control algorithm code is shown in the Appendix.

Simulink Modeling of the MPC Algorithm
Simulations for an MPC of a PMSM are designed as shown in Figure 5. The whole operation time is 0.1 s. The reference speed changes from 500 rpm to 1000 rpm at 0.03 s, and the load varies from 5 Nm to 8 Nm at 0.07 s.

Simulink Modeling of the MPC Algorithm
Simulations for an MPC of a PMSM are designed as shown in Figure 5. The whole operation time is 0.1 s. The reference speed changes from 500 rpm to 1000 rpm at 0.03 s, and the load varies from 5 Nm to 8 Nm at 0.07 s. Three-phase currents are shown in Figure 6. Also, simulations are carried out when the motor is controlled by an SVPWM controller. Three-phase currents are obtained in Figure 7. and are also obtained. Compared with the three-phase currents under the two controllers, the inverter outputs nonsinusoidal currents for the MPC but totally sinusoidal waves for the SVPWM. The amplitudes of the currents from the SVPWM method change dramatically when the speed reference changes and the load varies.  Three-phase currents are shown in Figure 6. Also, simulations are carried out when the motor is controlled by an SVPWM controller. Three-phase currents are obtained in Figure 7. I d and I q are also obtained. Compared with the three-phase currents under the two controllers, the inverter outputs nonsinusoidal currents for the MPC but totally sinusoidal waves for the SVPWM. The amplitudes of the currents from the SVPWM method change dramatically when the speed reference changes and the load varies. Three-phase currents are shown in Figure 6. Also, simulations are carried out when the motor is controlled by an SVPWM controller. Three-phase currents are obtained in Figure 7. and are also obtained. Compared with the three-phase currents under the two controllers, the inverter outputs nonsinusoidal currents for the MPC but totally sinusoidal waves for the SVPWM. The amplitudes of the currents from the SVPWM method change dramatically when the speed reference changes and the load varies.

Experimental Setup
The experimental setup is established by employing a dSPACE DS1104 card, which can be regarded as a microprocessor. The microprocessor is the controller of the whole system after the

Experimental Setup
The experimental setup is established by employing a dSPACE DS1104 card, which can be regarded as a microprocessor. The microprocessor is the controller of the whole system after the proposed algorithm is programmed and downloaded. The experimental hardware is shown in Figure 8, including power suppliers, a computer, a dSPACE control card, three highly accurate current sensors, a driver of the three-phase PMSM, and the motor. The entire control part of the PMSM is built using MATLAB/Simulink software, and the designed program can be debugged into the dSPACE card. An encoder interface of the card is employed to obtain the angles and the speeds of the rotor, and six analog-to-digital converters are used to sample the phase currents and voltages of the motor for the controller. Three-phase currents of the motor under steady state with no load and in loaded state at the speed of 500 rpm are shown in Figure 9a,b. When the motor works with no load, the amplitude of the three-phase current is 0.3 A, and the currents are nearly sinusoidal. When a rated load of 8 Nm is produced for the motor at this speed, it can be seen from Figure 9b that the three-phase currents of the motor with the MPC controller are increased accordingly, with slight current deformation. This deformation begins mainly at the interchange section between the top half of the current and the bottom half; the dead time of MOSFETs could be the cause. In Figure 10, the reference speed increases to 1000 rpm, the initial currents are shown when the motor starts, and the load of 5 Nm is carried on at 0.05 s. The motor performs well at the beginning and in the loaded states. Three-phase currents of the motor under steady state with no load and in loaded state at the speed of 500 rpm are shown in Figure 9a,b. When the motor works with no load, the amplitude of the three-phase current is 0.3 A, and the currents are nearly sinusoidal. When a rated load of 8 Nm is produced for the motor at this speed, it can be seen from Figure 9b that the three-phase currents of the motor with the MPC controller are increased accordingly, with slight current deformation. This deformation begins mainly at the interchange section between the top half of the current and the bottom half; the dead time of MOSFETs could be the cause. In Figure 10, the reference speed increases to 1000 rpm, the initial currents are shown when the motor starts, and the load of 5 Nm is carried on at 0.05 s. The motor performs well at the beginning and in the loaded states.
increases to 1000 rpm, the initial currents are shown when the motor starts, and the load of 5 Nm is carried on at 0.05 s. The motor performs well at the beginning and in the loaded states.   The speed control of the motor with the current MPC is shown in Figure 11, compared with classic control methods. The speed reference is 500 rpm under the load of 5 Nm, increasing to 1000 rpm at 0.03 s. The load increases from 5 Nm to 8 Nm at 0.07 s. There is no overshoot if the motor is governed by the MPC. The speed cannot fully reach the reference when the motor enters a steady state via the controllers of FOC, SVPWM, and DTC. Three details are shown in Figure 12, including the motor start (zoom 1), the loading variation (zoom 2), and the steady-state errors (zoom 3). The three-phase measured currents of the motor are shown in Figure 13. These details show that the dynamic responses under MPC outweigh those of other controllers, with fewer overshoots and small steady-state errors. The MPC system is not vulnerable to varied loads or to the parameter change of the control system. In addition to the MPC, other controllers cannot avoid overshoot and The speed control of the motor with the current MPC is shown in Figure 11, compared with classic control methods. The speed reference is 500 rpm under the load of 5 Nm, increasing to 1000 rpm at 0.03 s. The load increases from 5 Nm to 8 Nm at 0.07 s. There is no overshoot if the motor is governed by the MPC. The speed cannot fully reach the reference when the motor enters a steady state via the controllers of FOC, SVPWM, and DTC. Three details are shown in Figure 12, including the motor start (zoom 1), the loading variation (zoom 2), and the steady-state errors (zoom 3). The three-phase measured currents of the motor are shown in Figure 13. These details show that the dynamic responses under MPC outweigh those of other controllers, with fewer overshoots and small steady-state errors. The MPC system is not vulnerable to varied loads or to the parameter change of the control system. In addition to the MPC, other controllers cannot avoid overshoot and vibration when the motor starts. Although the DTC has less rising time, the steady-state error from this controller is obvious. In Figure 12b, the controllers of both the FOC and the MPC are stable, with the loading torque varying from 1 Nm to 2 Nm. The steady-state errors are shown in Figure 12c. The FOC can curb the steady error at the lowest scope. However, this method has an obvious overshoot. The steady errors can be limited at 5 rpm by using MPC and other control methods, suggesting higher steady errors that exceed 5 rpm. This shows that the performance of the designed MPC outweighs that of other controllers under identical conditions.  The speed control of the motor with the current MPC is shown in Figure 11, compared with classic control methods. The speed reference is 500 rpm under the load of 5 Nm, increasing to 1000 rpm at 0.03 s. The load increases from 5 Nm to 8 Nm at 0.07 s. There is no overshoot if the motor is governed by the MPC. The speed cannot fully reach the reference when the motor enters a steady state via the controllers of FOC, SVPWM, and DTC. Three details are shown in Figure 12, including the motor start (zoom 1), the loading variation (zoom 2), and the steady-state errors (zoom 3). The three-phase measured currents of the motor are shown in Figure 13. These details show that the dynamic responses under MPC outweigh those of other controllers, with fewer overshoots and small steady-state errors. The MPC system is not vulnerable to varied loads or to the parameter change of the control system. In addition to the MPC, other controllers cannot avoid overshoot and vibration when the motor starts. Although the DTC has less rising time, the steady-state error from this controller is obvious. In Figure 12b, the controllers of both the FOC and the MPC are stable, with the loading torque varying from 1 Nm to 2 Nm. The steady-state errors are shown in Figure 12c. The FOC can curb the steady error at the lowest scope. However, this method has an obvious overshoot. The steady errors can be limited at 5 rpm by using MPC and other control methods, suggesting higher steady errors that exceed 5 rpm. This shows that the performance of the designed MPC outweighs that of other controllers under identical conditions.        Figure 14 shows the speed response of the motor under different speed references. The speed reference starts at 100 rpm in the beginning and increases to 500 rpm at 0.02 s and 1000 rpm at 0.05 s. The entire speed response is shown in Figure 14a. The details of the speed variations at each step are shown in Figure 14b-d. There are a few overshoots within 1% at the stepping times. Speed steady-state errors could be on the rise with the increase of the speed reference. However, the speed steady-state errors can be limited to 0.5 rpm according to the experimental results. are shown in Figure 14b-d. There are a few overshoots within 1% at the stepping times. Speed steady-state errors could be on the rise with the increase of the speed reference. However, the speed steady-state errors can be limited to 0.5 rpm according to the experimental results.

Conclusions
In this study, a current MPC of a PMSM was investigated. The mathematical model of the motor and the Simulink modeling of the MPC method are given. Both the simulation and experimental results suggest that the designed MPC is feasible. For practical application, the main programmed algorithm is also given. The speed responses show that the MPC performs better than traditional controllers, as supported by the simulation and experimental results. MPC is shown to possess fast-tracking capability and small steady errors in speed regulation, and the speed reference has a lower overshoot under varied loads. The speed responses could be limited to 0.5 rpm, with experimental results validated under different speed references. The experimental results proved the feasibility and effectiveness of the designed MPC. This control method could be a promising candidate to control the PMSM in the future.

Conclusions
In this study, a current MPC of a PMSM was investigated. The mathematical model of the motor and the Simulink modeling of the MPC method are given. Both the simulation and experimental results suggest that the designed MPC is feasible. For practical application, the main programmed algorithm is also given. The speed responses show that the MPC performs better than traditional controllers, as supported by the simulation and experimental results. MPC is shown to possess fast-tracking capability and small steady errors in speed regulation, and the speed reference has a lower overshoot under varied loads. The speed responses could be limited to 0.5 rpm, with experimental results validated under different speed references. The experimental results proved the feasibility and effectiveness of the designed MPC. This control method could be a promising candidate to control the PMSM in the future.
Author Contributions: M.T. developed the analysis, hardware design, and measurement. He also conducted the simulation. S.Z. was responsible for the background theory. He also provided guidance and supervision.

Funding:
The authors gratefully acknowledge the support by the government of Hang Zhou city (grant code 2017JD60) and Zhejiang Provincial Education Department funding with code YB201705.

Conflicts of Interest:
The authors declare no conflict of interest.