**GuangQing Bao 1,2,3, WuGang Qi 1,2,3,\* and Ting He <sup>4</sup>**


Received: 7 November 2019; Accepted: 24 December 2019; Published: 3 January 2020

**Abstract:** A direct torque control (DTC) with a modified finite set model predictive strategy is proposed in this paper. The eight voltage space vectors of two-level inverters are taken as the finite control set and applied to the model predictive direct torque control of a permanent magnet synchronous motor (PMSM). The duty cycle of each voltage vector in the finite set can be estimated by a cost function, which is designed based on factors including the torque error, maximum torque per ampere (MTPA), and stator current constraints. Lyapunov control theory is introduced in the determination of the weight coefficients of the cost function to guarantee stability, and thus the optimal voltage vector reference value of the inverter is obtained. Compared with the conventional finite control set model predictive control (FCS-MPC) method, the torque ripple is reduced and the robustness of the system is clearly improved. Finally, the simulation and experimental results verify the effectiveness of the proposed control scheme.

**Keywords:** direct torque control; finite control set mode predictive control; duty cycle; maximum torque per ampere; permanent magnet synchronous motor

#### **1. Introduction**

Permanent magnet synchronous motor (PMSM) direct torque control (DTC) has been widely used in industry due to its simple control structure, fast dynamic response, and high efficiency [1]. However, the traditional DTC control results in large torque ripple due to the insufficient switching frequency of the inverters and two nonlinear hysteresis comparators [2,3].

To solve the problem of torque ripple, many scholars have put forward many improved methods. An improved method is calculating the effective voltage vector action time in real time to ensure the minimum torque ripple by the current torque error [4–6]. This method reduces the torque ripple to a certain extent, but the calculation process is complicated. At present, voltage space vector modulation (SVM) is also introduced into DTC [7,8]. This method can effectively reduce the torque ripple, but it cannot eliminate the steady-state error of the torque. At the same time, the calculation process is highly dependent on the parameters of the motor and has poor robustness.

As a real-time online optimization control method, model predictive control (MPC) has received extensive attention in the field of electric drives and power converters due to its high dynamics and resistance to parameter disturbance [9,10]. The method of finite control set MPC (FCS-MPC) directly utilizes the discreteness of inverter output voltage and the finiteness of switching state; at the same time, it does not need modulation and has a small amount of computation, which makes it a hot

research topic in the field of power electronics [11,12]. In [13], on the premise that the flux linkage and torque of the motor are limited within the target range, a longer prediction step is selected to optimize the switching frequency of the inverter. A strategy of separate control of transient and steady state are adopted to reduce the switching frequency of inverter [14]. Mayne [15] proposed an FCS-MPC algorithm with model error compensation which enhances the robustness of the system. In [16], FCS-MPC method is applied in a grid-connected converter, and the stability of the control system is proved by Lyapunov stability theory. In addition, the virtual voltage vector is also integrated into FCS-MPC architecture, and the optimal voltage vector is preselected by using the results of Lyapunov stability theory. This method reduces the number of possible voltage vectors from 38 to 10, thus reducing the computational burden of the controller.

The cost function of FCS-MPC is the key to realizing the optimal selection of the voltage vector, which can be established according to the control targets, the system model based predictive variables, and the reference variables [17]. Depending on the control situation, it is also necessary to include system constraints. The cost function can contain multiple control objectives, variables, and constraints. Correct design of reasonable weight coefficients is very important for selecting the voltage vectors and governing the switching sequence of the inverter based on predictive current control of the PMSM with the FCS model [18,19].

The main contribution of this paper is to combine Lyapunov function theory with FCS-MPC to reduce torque ripple. Among them, the operating conditions of MTPA and torque tracking are guaranteed by using cost function. The Lyapunov function theory is introduced in the calculation of the finite set voltage vector duty cycle to obtain the optimal voltage vector. The simulation and experimental results show that the method achieves fast torque response and torque ripple minimization.

#### **2. Discrete Mathematical Model of PMSM and Drive**

The main circuit of the electric drive system under consideration is illustrated in Figure 1, which also corresponds to the experimental system layout. The PMSM has the characteristics of being multivariable and nonlinear and has strong coupling [20]. In order to simplify the mathematical model of PMSM, the following assumptions are made: (1) Y-shaped connection of stator windings, symmetrical distribution of three-phase windings, and space difference of each winding is 120◦. (2) Eddy current loss, hysteresis loss, and the change of motor parameters are neglected. (3) It is assumed that permanent magnets on the rotor generate a main magnetic field in the stator–rotor airgap (the magnetic field is distributed sinusoidally along the circumference of the airgap) 22. So the continuous time model for PMSM in the d–q coordinate system can be described as:

$$L\_d \frac{di\_d}{dt} = (\mu\_d - R i\_d + \omega L\_q i\_q)\_\prime \tag{1}$$

$$L\_q \frac{di\_q}{dt} = (u\_q - Ri\_q - \omega L\_d i\_d - \omega \psi\_f),\tag{2}$$

$$T\_{\mathfrak{c}} = 1.5p \left(\psi\_f + (L\_d - L\_\eta)i\_d\right)i\_{\mathfrak{q}}.\tag{3}$$

where *ud*, *uq*, *id* and *iq* are the stator voltages and currents, *R* is the stator winding resistance, *Ld* and *Lq* are the d- and q-axes inductances, ψ*<sup>f</sup>* is the flux linkage of the rotor, *p* is the number of pairs of poles, ω is the mechanical angular speed, and *Te* is the electromagnetic torque. *iq* is proportional to the electromagnetic torque and *id* is proportional to the reactive power. A predictive current control scheme is thus formed in which the reference current is generated by an external speed control loop.

**Figure 1.** The main circuit of the permanent magnet synchronous motor (PMSM) drive.

Discretize the mathematical model of PMSM to obtain the necessary conditions for model prediction. Since the sampling time *Ts* is sufficiently small, the Euler approximation is used for the stator current derivative di/dt of the sampling time *Ts*.

$$\frac{di}{dt} = \frac{i(k+1) - i(k)}{T\_s},\tag{4}$$

where *Ts* is the sampling period. Then, the discrete current model of the PMSM is obtained:

$$L\_d l\_d^{k+1} = (L\_d - T\_s \mathcal{R}) l\_d^k + T\_s \alpha L\_q l\_q^k + T\_s u\_{d'}^k \tag{5}$$

$$L\_q \mathbf{i}\_q^{k+1} = (L\_q - T\_s \mathcal{R})\mathbf{i}\_q^k - T\_s \omega \omega L\_d \mathbf{i}\_d^k - T\_s \omega \psi\_f + T\_s u\_{q\_f}^k \tag{6}$$

$$T\_{\varepsilon}^{k+1} = 1.5 \text{pr}\_q^{k+1} [\psi\_f + (L\_d - L\_q)\mathbf{r}\_d^{k+1}].\tag{7}$$

The commutation process of two-level voltage source inverters is accomplished by use of DC bus. The switching state can be represented by the switching signals *Sa* and *Sb* and switching on and off on different bridge arms. The upper and lower switches of each bridge arm of the inverter cannot be turned on at the same time to prevent short circuit *Sc*, as shown in Table 1:


**Table 1.** Inverter switching states.

From the above table, the vector form function of the switching state of the three-phase bridge arm (*S*) is as follows:

$$S = \frac{2}{3}(S\_a + aS\_b + a^2S\_c),\tag{8}$$

where *a* = *ej*2<sup>π</sup>/3. The relationship between output voltage vector with the switch state can be defined as:

$$
\hbar \mathcal{U}\_{\rm out} = \mathcal{S} \mathcal{U}\_{\rm dc} = \frac{2}{3} \mathcal{U}\_{\rm dc} (\mathcal{S}\_{\rm d} + a \mathcal{S}\_{\rm b} + a^2 \mathcal{S}\_{\rm c}), \tag{9}
$$

where *Udc* is the DC source voltage and *Uout* is the output voltage of the inverter.

Considering the different switching states of the inverters, eight different voltage vectors are obtained, as shown in Table 2. It is noted that *V*0 = *V*7, resulting in a finite set of seven different voltage vectors in the plane.


**Table 2.** Switching state and voltage vector.

#### **3. Predictive Control Based on Duty Cycle**

Within one sampling interval, the cost function values that correspond to the seven voltage vectors are calculated by the FCS. The switching state that minimizes the cost function is chosen as the switching state of the inverter. The process of model prediction optimization is shown in Figure 2, where *x*, *xp*, and *x*<sup>∗</sup> are the torque of the real response, the predicted value, and the reference value, respectively. If the corresponding *x*(*k*) is the best value at time *k*, the cost function value *x*(*k* + 1) corresponding to the seven voltage vectors is calculated at time (*k* + 1), and the seven calculated cost functions values are compared with reference values, where the closest is to be the optimal solution at the moment (*k* + 1). *V*<sup>4</sup> is the control signal of the voltage vector corresponding to the optimal value of the time (*k* + 1). In the same way, *V*<sup>3</sup> should be selected as the optimal control signal at time (*k* + 2) [12].

**Figure 2.** Optimization process diagram of model predictive control (MPC).

#### *3.1. Design of Cost Function*

The maximum torque/current control (MTPA) consumes the minimum stator current at the same electromagnetic torque output, which is usually used in interior PMSM systems. The space vector analysis of PMSM in the d–q coordinate system is shown in Figure 3. Assuming that the stator current vector *is* leads *q* axis β, the current component in the d–q coordinate system is as follows:

$$\begin{cases} \dot{i}\_d = -|i\_s|\sin\beta\\ \dot{i}\_q = |\dot{i}\_s|\cos\beta\\ \dot{i}\_s = \sqrt{\dot{i}\_d^2 + \dot{i}\_q^2} \end{cases} \tag{10}$$

$$T\_{\varepsilon} = 1.5 p \left[ \psi\_f i\_s \cos \beta - (Ld - Lq) i\_s^2 \cos \beta \sin \beta \right]. \tag{11}$$

If the amplitude of the stator current of the PMSM is a constant value, it can be concluded that the electromagnetic torque of the motor is only related to β. In order to find the maximum value of the torque, that is, to satisfy the MTPA condition, and calculate Equation (11) with β as a variable, the following relationship is obtained:

$$\frac{dT\_\varepsilon}{d\beta} = -\psi\_f i \mathbf{s} \sin \beta - (L\_d - L\_q) i\_s [\cos \beta^2 - \sin \beta^2] = 0. \tag{12}$$

Because *is* and β satisfy the Pythagorean theorem, the relationship of *id* and *iq* under the MTPA condition can thus be derived as follows:

$$i\_d + \frac{L\_d - L\_q}{\psi\_f} (i\_d^2 - i\_q^2) = 0.\tag{13}$$

**Figure 3.** Space vector analysis of the PMSM.

The most important part of MPC is the cost function design. The cost function is expressed in orthogonal coordinates and considering the torque tracking, MTPA condition, and current constraint:

$$J(k) = K\_{\rm T} l\_{\rm T}(k) + K\_{\rm M} l\_{\rm M}(k) + K\_{\rm C} (l\_{\rm C1}(k) + l\_{\rm C2}(k)),\tag{14}$$

where *KT*, *KM*, and *KC* are the weighting factors of the cost function and are positive real numbers. The main aim of the MPC is to minimize the torque error. Thus, the cost for the error *JT*(*k*) is:

$$J\_T(k) = \left(T\_\varepsilon^\* - T\_\varepsilon^{k+1}\right)^2. \tag{15}$$

Since high currents lead to large losses, *JM*(*k*) is to have a low absolute current:

$$J\_M(k) = \left(\mathbf{i}\_d^k + \frac{\mathbf{L}\_d - \mathbf{L}\_q}{\boldsymbol{\upmu}\_F^{\boldsymbol{\upmu}}} \left(\left(\mathbf{i}\_d^k\right)^2 - \left(\mathbf{i}\_q^k\right)^2\right)\right)^2. \tag{16}$$

Tertiary control goals can be added in order to ensure the operational safety of the system. *JC*1(*k*) denotes the current limit, and the current amplitude of the system must be smaller than the maximum allowable value *I*max.

$$J\_{C1}(k) = \begin{cases} 0 & (I\_{\text{max}} \ge \sqrt{\left(\mathbf{i}\_d^k\right)^2 + \left(\mathbf{i}\_q^k\right)^2})\\ \left(I\_{\text{max}} - \sqrt{\left(\mathbf{i}\_d^k\right)^2 + \left(\mathbf{i}\_q^k\right)^2}\right)^2 & (I\_{\text{max}} < \sqrt{\left(\mathbf{i}\_d^k\right)^2 + \left(\mathbf{i}\_q^k\right)^2}) \end{cases} \tag{17}$$

To make the point of the cost function converge to the parabola on the left side of the *iq* axis, as shown in Figure 3. Adding current constraints *JC*2(*k*) to the cost function:

$$J\_{C2}(k) = \begin{cases} \ 0, \left( \mathbf{i}\_d^k \le 0 \right) \\ \left( \mathbf{i}\_d^k \right)^2, \left( \mathbf{i}\_d^k > 0 \right) \end{cases} \tag{18}$$

To ensure current constraints and avoid control variables converging to the wrong MTPA curve, *KC KT*,*KM* should be satisfied. For the choice of *KT* and *KM*, *KT* + *KM* = 1 can be made. A larger value of *KT* leads to faster convergence of the torque, while a larger value of *KM* indicates that the MTPA state converges quickly. *KT* > *KM* can be selected [21] to achieve a fast torque response.

#### *3.2. Duty Cycle Calculation*

The duty cycle of each voltage vector in a finite set is calculated by Lyapunov function to eliminate torque and current ripple. Without considering the current limitation, that is, ignoring *JC*1(*k*) and *JC*2(*k*), the Lyapunov function is expressed as follows:

$$V(k+1) = k\_T I\_T(k+1) + k\_M I\_M(k+1). \tag{19}$$

In order to optimize the operation of the PMSM, the condition *V*(*k* + 1) = 0 must be fulfilled to ensure *<sup>T</sup>k*+<sup>1</sup> *<sup>e</sup>* = *<sup>T</sup>*<sup>∗</sup> *<sup>e</sup>* and its current operating point is on the MTPA curve. In addition, the condition *dV*(*k* + 1)/*dt* = 0 indicates that the PMSM is operating at the optimum state.

**Lemma 1.** *Defining the function of the current:*

$$f(i\_d, i\_q) = i\_d + (L\_d - L\_q)(i\_d^2 - \overline{i}\_q) / \psi\_f \tag{20}$$

If the torque of the PMSM is kept at a nonzero constant value, the function *f*(*id*, *iq*) is a strict monotonic function along the constant torque curve. The correlative poof is introduced in the Appendix A.

With the help of the function *f*(*id*, *iq*), the stator current trajectory is shown in Figure 4. Point A is the initial point; the trajectory first reaches the point B along the constant torque curve and then reaches the point C along the MTPA curve with the condition *V*(*k*) = 0. When the current trajectory is along <sup>→</sup> *AB* to <sup>→</sup> *BC*, the Lyapunov function is strictly decreasing.

**Figure 4.** Stator current vector trajectory.

**Lemma 2.** *Under the initial condition of the PMSM, if the back EMF of the PMSM is within the voltage limit range of the inverter, there exists a feasible voltage vector u*∗ *dq that fulfills:*

$$dV(k+1)/dt \le 0.\tag{21}$$

*Energies* **2020**, *13*, 234

**Lemma 3.** *For a given current dynamics:*

$$\frac{d\mathring{d}\_{dq}^{k+1}}{dt} = A\mathring{d}\_{dq}^{k+1} + B\mathring{u}\_{dq}^{k+1} + E\_{\prime} \tag{22}$$
 
$$\begin{bmatrix} \frac{1}{L\_d} \mathbf{0} \\ 0 \end{bmatrix}\_{\perp} E = \begin{bmatrix} 0 \\ -\omega \psi\_f \end{bmatrix}\_{\perp}$$

*where A* = ⎡ ⎢⎢⎢⎢⎢⎣ − *R Ld* ω*Lq Ld* <sup>−</sup> <sup>ω</sup>*Ld Lq* <sup>−</sup> *<sup>R</sup> Lq* ⎤ ⎥⎥⎥⎥⎥⎦ , *B* = ⎡ ⎢⎢⎢⎢⎣ *Ld* 0 0 <sup>1</sup> *Lq* ⎥⎥⎥⎥⎦, *<sup>E</sup>* <sup>=</sup> ⎢⎢⎢⎢⎢⎣ −−ωψ*<sup>f</sup> Lq* ⎥⎥⎥⎥⎥⎦

If the back EMF of the PMSM is within the voltage limit range of the inverter, then at least one voltage vector is satisfied:

$$\frac{dV(k+1)}{dt} = \frac{\partial V(k+1)}{\partial \dot{t}\_{dq}^{k+1}} (A\dot{t}\_{dq}^{k+1} + B\dot{u}\_{dq}^{k+1} + E) \le 0. \tag{23}$$

The proofs of Lemma 2 and Lemma 3 are introduced in the Appendix A.

In order to minimize the ripple of the PMSM current and torque, the Lyapunov function is expected to keep *V* = 0 and *dV*(*k* + 1)/*dt* = 0 in a steady state. The duty cycle of each voltage vector satisfying the desired requirement is calculated as follows:

$$T\_{duty,k+1}^{j} = \begin{cases} \begin{array}{c} T\sigma, \quad \frac{dV(K+1)}{dt} > 0\\ 0, \quad \frac{dV(K+1)}{dt} = 0\\ \frac{-V(K+1)}{dV(k+1)/dt}, \quad \frac{dV(K+1)}{dt} < 0 \end{array} \end{cases},\tag{24}$$

Here, *T*<sup>σ</sup> *Ts* is a time constant. The voltage vector with *dV*(*k* + 1)/*dt* > 0 has to be taken into account in the FCS-MPC, and then the current reaches the limit, *T*σ is introduced, and the current constraint plays a major role in the cost function. When there is disturbance in the PMSM system, such as machine parameter drift and voltage error in the inverter, we also need to select a smaller *T*σ to compromise the disturbance at this point. When the PMSM model and the prediction are accurate, *<sup>T</sup>*<sup>σ</sup> = 0 is the ideal value for the ripple reduction. All voltage vectors *<sup>u</sup><sup>j</sup> dq*,*k*+<sup>1</sup> with *dV*(*<sup>k</sup>* + <sup>1</sup>)/*dt* <sup>&</sup>lt; 0 are candidates to minimize the cost function.

#### *3.3. Finite Control Set Model Prediction*

Finally, the optimum output voltage which can be realized by the SVPWM is obtained by Equation (23). Only when voltage *u<sup>j</sup> dq*,*k*+<sup>1</sup> acts on the PMSM will it affect the torque, that is, to ensure the implementation of MTPA and *dV*(*k* + 1)/*dt* = 0. It is noteworthy that setting the optimal duty cycle *Tk*+<sup>1</sup> *duty* equal to *Ts* in the transient state of the proposed control strategy can minimize the cost function. Therefore, under the same sampling frequency, the torque response of the new strategy is as fast as that of the traditional FCS-MPC. In steady state, *dV*(*k* + 1)/*dt* = 0 can be maintained. Therefore, current ripple and torque ripple can be minimized. Figure 5 is a block diagram of the predictive direct torque control algorithm of the FCS-MPC proposed in this paper.

$$
\begin{bmatrix} u\_d^{k+1} \\ u\_q^{k+1} \end{bmatrix} = (1 - T\_{\
atural}^{k+1}) \begin{vmatrix} R\_d^{k+1} - \omega L\_q u\_q^{k+1} \\ R\_q^{k+1} - \omega L\_d u\_d^{k+1} + \omega \psi\_F \end{vmatrix} + T\_{\
atural}^{k+1} \begin{vmatrix} u\_d^{j,k+1} \\ u\_q^{j,k+1} \end{vmatrix} \tag{25}
$$

**Figure 5.** Block diagram of the proposed MPC.

#### **4. Simulation Results**

In order to investigate the effectiveness and feasibility of the proposed method, the FCS-MPC of the surface-mounted PMSM based on MATLAB/Simulink software was built. Then, it was compared with that of the classical FCS-MPC method. The parameter settings are shown in Table 3.


**Table 3.** Surface-mounted permanent magnet synchronous motor (SPMSM) parameters for simulation.

#### *4.1. Steady-State Operation*

Figure 6 shows the simulation results of traditional FCS-MPC and improved FCS-MPC under steady-state conditions. The reference value of motor speed is set to 500 rpm, and the load torque is 20 N·m. As can be seen from the figure, compared with conventional FCS-MPC, the torque ripple of the improved method is significantly reduced. In Figure 6, the average values of the torque ripples of proposed (0.9 N·m) are smaller compared to those of conventional FCS-MPC (3 N·m) under the same conditions. It is noted that, in this paper, torque ripples are calculated by the following equation [22]:

$$T\_{rip} = \sqrt{\frac{1}{N} \sum\_{i=1}^{N} \left(T\_c - T\_{\text{ave}}\right)^2} \tag{26}$$

where *N* is the number of samples and *Tave* is the average value of the torque.

**Figure 6.** Torque steady-state response simulation.

#### *4.2. Dynamic Response*

In order to compare the torque dynamic, a magnified view of the torque response is shown in Figure 7. From Figure 7, we can see that the torque suddenly increases from 10 to 20 N·m in only 0.003 s, and in the process of torque mutation, the conventional FCS-MPC method has obvious overshoot. Compared with the conventional FCS-MPC, the improved method has faster dynamic response because the motor adopts optimized duty cycle modulation in the whole control cycle.

**Figure 7.** Torque dynamic simulation at *t* = 0.3 s.

#### *4.3. Motor Parameter Robustness*

As we all know, a temperature rise of the motor will cause the stator internal resistance to increase. The influence of internal resistance on the torque is discussed in this paper. The torque waveforms of the two control methods in the condition of rated stator resistance (the blue solid line) and 1.5-times the rated value (the red dashed line) are given in Figure 8a,b, respectively. It is noticeable that slight torque ripples occur under the conventional FCS-MPC method when the resistance increases, while the proposed FCS-MPC control has better robustness in which the torque is insensitive to the resistance

change. However, when entering a steady state, the two control systems are not affected by internal resistance changes.

**Figure 8.** Torque ripple simulation when the resistance is changed.

Almost all permanent magnet devices, including permanent magnet motors, will exhibit the demagnetization phenomenon in varying degrees due to factors such as the working environment and usage time. The effect of changes in the motor flux on torque is also discussed. Figure 9a,b shows the torque waveforms of the two control methods when the rotor flux is 0.9-times the rated value, equal to the rated value, and 1.1-times the rated value, to simulate permanent magnet motors that have been used for a long time, used normally, and newly manufactured. As shown in Figure 9, the blue point line is 0.9-times the rated flux, the red solid line is the rated flux, and the green dotted line is 1.5-times the rated flux. Evidently, the conventional FCS-MPC for the change of flux is the change of the maximum torque. However, the improved predictive control is insensitive to the flux change.

**Figure 9.** Torque ripple simulation when the flux is changed.

For a mechanical load, the oscillation of torque is very bad for the shaft and load of the motor. Therefore, it can be seen from the simulation waveforms of the above two sections that the robustness of predictive control to parameter changes is better than that of conventional FCS-MPC. In theory, the switch meter of direct torque control is fixed in advance and cannot be adjusted according to the running state of the motor. Therefore, the robustness of direct predictive control to parameter changes is better than that of direct torque control, which is also consistent with the previous prediction results.
