**2.1. Voltage Source Inverter (VSI) for adjustable speed or torque drive**

In large number of industries the PMSM's are required to be operated at different speeds or torques. In order to obtain variable speed or torque, these motors are fed from inverters with variable voltage and variable frequency supply. Figure 1 shows the VSI structure used to produce well the voltage waveforms at the terminal of the motor. The voltage control of this inverter is obtained by using switching table in case of basic DTC or by pulse width modulation (PWM) in case of modified DTC techniques.

**Figure 1.** Three phase voltage source bridge inverter structure

The model of the VSI is given by:

$$
\begin{bmatrix} \mathbf{v\_a} \\ \mathbf{v\_b} \\ \mathbf{v\_c} \end{bmatrix} = \frac{\mathbf{U\_{dc}}}{3} \begin{bmatrix} 2 & -1 & -1 \\ -1 & 2 & -1 \\ -1 & -1 & 2 \end{bmatrix} \begin{bmatrix} \mathbf{C\_{s1}} \\ \mathbf{C\_{s3}} \\ \mathbf{C\_{s5}} \end{bmatrix} \tag{1}
$$

Where Udc is the DC bus voltage and Cs1, Cs3, Cs5 are the transistor states.

#### **2.2. Modeling of the PMSM**

The stator voltages equation for a PMSM in the rotor oriented coordinates d-q can be expressed as:

$$
\begin{bmatrix} \mathbf{U\_{sd}} \\ \mathbf{U\_{sq}} \end{bmatrix} = \begin{bmatrix} \mathbf{R\_s} + \mathbf{s} . \mathbf{L\_d} & -\mathbf{P}. \boldsymbol{\omega}\_{\mathbf{m}} . \mathbf{L\_q} \\ \mathbf{P}. \boldsymbol{\omega}\_{\mathbf{m}} . \mathbf{L\_d} & \mathbf{R\_s} + \mathbf{s} . \mathbf{L\_q} \end{bmatrix} \begin{bmatrix} \mathbf{I\_{sd}} \\ \mathbf{I\_{sq}} \end{bmatrix} + \begin{bmatrix} \mathbf{0} \\ \mathbf{P}. \boldsymbol{\omega}\_{\mathbf{m}} . \boldsymbol{\Phi}\_{\mathbf{PM}} \end{bmatrix} \tag{2}
$$

Where Isd and Isq are the d - q axis stator currents, Rs is the stator resistance, ΨPM is the flux linkage of the rotor magnets linking the stator, Ld and Lq are the d - q axis stator inductances, P is the number of pole pairs and �� is the mechanical speed.

$$\mathbf{I}\_{\rm em} = \frac{3}{2} \mathbf{P} \{ \Phi\_{\rm sd} \mathbf{I}\_{\rm sq} - \Phi\_{\rm sq} \mathbf{I}\_{\rm sd} \} = \frac{3}{2} \mathbf{P} \left[ \Phi\_{\rm PM} \mathbf{I}\_{\rm sq} + (\mathbf{L}\_{\rm d} - \mathbf{L}\_{\rm q}) \mathbf{I}\_{\rm sd} \mathbf{I}\_{\rm sq} \right] \tag{3}$$

$$
\begin{bmatrix}
\Phi\_{\rm sd} \\
\Phi\_{\rm sq}
\end{bmatrix} = \begin{bmatrix}
\mathbf{L\_{d}} & \mathbf{0} \\
\mathbf{0} & \mathbf{L\_{q}}
\end{bmatrix} \begin{bmatrix}
\mathbf{I\_{sd}} \\
\mathbf{I\_{sq}}
\end{bmatrix} + \begin{bmatrix}
\Phi\_{\rm PM} \\
\mathbf{0}
\end{bmatrix} \tag{4}
$$

$$\mathbf{J} \frac{d\omega\_{\rm m}}{dt} = \boldsymbol{\Gamma}\_{\rm em} - \boldsymbol{\Gamma}\_{\rm r-} \mathbf{f}\_{\rm r} \boldsymbol{\omega}\_{\rm m} \tag{5}$$

$$
\Gamma \Gamma\_{\rm s}^{\tau} = \mathcal{R}\_{\rm s} \cdot \Gamma\_{\rm s} + \frac{\mathrm{d}\overline{\Phi}\_{\rm s}}{\mathrm{d}t} \tag{6}
$$

$$\Phi\_{\mathbf{s}} = \Phi\_{\mathbf{o}} + \int\_{0}^{\mathbf{r}} (\nabla\_{\mathbf{s}}^{\tau} - \mathbf{R}\_{\mathbf{s}} \cdot \mathbf{I}\_{\mathbf{s}}) \, \mathrm{d}\mathbf{t} \tag{7}$$

$$
\Phi\_{\rm s} \approx \left. \Phi\_{\rm o} + \int\_{0}^{\rm t} \left| \nabla\_{\rm s} \right| \mathrm{d}t \right. \tag{8}
$$

$$
\overline{\Phi}\_{\text{s}}(\text{k}+1) \approx \,\,\overline{\Phi}\_{\text{s}}(\text{k}) + \,\,\overline{\mathcal{V}}\_{\text{s}} \,\, \overline{\ }\,\, \text{T}\_{\text{e}} \tag{9}
$$

$$
\Delta \overline{\Phi}\_{\text{s}} = \overline{\mathcal{V}}\_{\text{s}} \cdot \mathcal{T}\_{\text{e}} = \ \overline{\Phi}\_{\text{s}}(\text{k} + 1) - \ \overline{\Phi}\_{\text{s}}(\text{k}) \tag{10}
$$

**Figure 3.** Stator flux vector evolution in the αβ subspace

$$\boldsymbol{\Phi}\_{\rm sat} = \boldsymbol{\Phi}\_{\rm PM} + \int\_{0}^{\mathrm{r}} (\mathbf{V}\_{\rm sa} - \mathbf{R}\_{\rm s} \, \mathrm{l}\_{\rm sa}) \, \mathrm{d}\mathbf{t} \tag{11}$$

$$\Phi\_{\rm s\beta} = \int\_0^\mathbf{r} \{\mathbf{V}\_{\rm s\beta} - \mathbf{R}\_{\rm s} \cdot \mathbf{l}\_{\rm s\beta}\} \,\mathrm{d}\mathbf{t} \tag{12}$$

Note that �� is the permanent magnet flux. From equations 11 and 12, the stator flux module and its argument are given by:

$$
\widehat{\Phi}\_{\rm s} = \sqrt{{\Phi\_{\rm s\alpha}}^2 + {\Phi\_{\rm s\beta}}^2} \tag{13}
$$

$$\hat{\Theta}\_{\rm s} = \tan^{-1}(\frac{\Phi\_{\rm s\beta}}{\Phi\_{\rm sa}}) \tag{14}$$

A two level hysteresis controller, as indicated in figure 3, is used to control the stator flux, which compares the reference stator flux Ф� <sup>∗</sup> with the estimated stator flux ��. The flux hysteresis comparator output is denoted by Boolean variable KФ which indicates directly if the amplitude of flux must be increased KФ = 1 or decreased KФ = 0 : if KФ = 1, it means that the actual value of the flux linkage is below the reference value and outside the hysteresis limit; so the stator flux must be increased, while if KФ = 0, it means that the actual value of the flux linkages is above the reference value and outside the hysteresis limit; so the stator flux must be decreased.

The two level VSI, as shown in figure 1, is used to select proper voltage vectors from the output of flux and torque hysteresis controller (will be presented in the next part). The inverter has eight permissible switching states (V0, V1 … V7), out of which six are active (V1, V2… V6) and two zero or inactive states (V0 and V7). The voltage vector plane is divided into six sectors so that each voltage vector divides each region in two equal parts as shown in Figure 4. In each sector four of the six non-zero voltage vectors along with zero vectors may be used.

**Figure 4.** Control of stator flux by selection of the suitable voltage vector Vi(i=0,...,7)

#### **3.2. Torque control**

172 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

β

�� = �� <sup>+</sup> � (V�� − R�. I��) dt �

��(k+1)

∆θ<sup>s</sup>

θ��

 �� <sup>=</sup> � �V�� − R�. I��� dt �

Note that �� is the permanent magnet flux. From equations 11 and 12, the stator flux

 �� = ���� + ��

A two level hysteresis controller, as indicated in figure 3, is used to control the stator flux,

hysteresis comparator output is denoted by Boolean variable KФ which indicates directly if the amplitude of flux must be increased KФ = 1 or decreased KФ = 0 : if KФ = 1, it means that the actual value of the flux linkage is below the reference value and outside the hysteresis limit; so the stator flux must be increased, while if KФ = 0, it means that the actual value of the flux linkages is above the reference value and outside the hysteresis limit; so the

The two level VSI, as shown in figure 1, is used to select proper voltage vectors from the output of flux and torque hysteresis controller (will be presented in the next part). The inverter has eight permissible switching states (V0, V1 … V7), out of which six are active (V1, V2… V6) and two zero or inactive states (V0 and V7). The voltage vector plane is divided into six sectors so that each voltage vector divides each region in two equal parts as shown in Figure 4. In each sector four of the six non-zero voltage vectors along with zero vectors may

 �� ��

 � = tan��( 

� (11)

∆Φ��

α

��

� (13)

 ) (14)

<sup>∗</sup> with the estimated stator flux ��. The flux

� (12)

��(k)

Ф� ∗

**Figure 3.** Stator flux vector evolution in the αβ subspace

module and its argument are given by:


K<sup>Φ</sup>

∆Ф� = Ф�

1

0

<sup>∗</sup> − Ф� �

which compares the reference stator flux Ф�

stator flux must be decreased.

be used.

The electromagnetic torque equation is defined as follows:

$$\Gamma = \text{k.} \left( \overline{\Phi}\_{\text{s}}, \overline{\Phi}\_{\text{r}} \right) = \| \| \overline{\Phi}\_{\text{s}} \| . \| \overline{\Phi}\_{\text{r}} \| \| . \sin \text{\(\)} \tag{15}$$

Where δ is the angle between the rotor and the stator flux vectors and the constant k is expressed as (when Ld = Lq):

$$\mathbf{k} = \frac{\mathbf{3P}}{\mathbf{2L\_q}}$$

The equation 15 indicates that the electromagnetic torque depends to the rotor and stator amplitude, and the angle δ. So, if the stator flux vector is perfectly controlled, by mean of the stator voltage vector V� ����, in module and in position; consequently, the electromagnetic torque can be controlled by the same stator voltage vector.

**Figure 5.** Three level hysteresis controller

Note that the electromagnetic torque can be controlled by mean of a two level comparator as the same as stator flux (see figure 3) or by using a three level comparator as shown in figure 5. In this work, a three level comparator has been used in order to minimize the switches commutation numbers and to have the two senses of the motor rotation. The output of this controller is represented by a Boolean variable KT which indicates directly if the amplitude of the torque must be increased, maintained constant or decreased, respectively, when KT is equal 1, 0 or -1. The goal of this controller is to maintain the torque variation ∆Г in the bandwidth [-εT , εT] chosen by the programmer of DTC algorithm. Indeed, this controller adjusts the torque variation generated by a comparator of electromagnetic torque reference ( Г∗ )and the estimated torque (Г�).

$$
\Delta \Gamma = \Gamma^\* - \Gamma \tag{16}
$$

#### **3.3. Switching table for controlling flux and torque**

According to the signal generated by the hysteresis controller of stator flux and electromagnetic torque presented in figure 3 and 5, respectively; just one voltage vector can be selected to adjust the torque and flux. The choice of this vector depends on the outputs of the torque and flux controller and the position of the stator flux vector, as shown in table 1.


**Table 1.** Takahashi and Noguchi switching table

#### **3.4. Torque and flux estimator**

In this chapter, two estimators of torque and stator flux will be presented.

#### *3.4.1. Classical Torque and Flux Estimator (CTFE)*

The figure 2 shows that the torque and stator flux can be estimated by measuring the mechanical position, stator voltages and currents. Indeed, the stator flux is estimated by using equations 11, 12 and 13. Whereas, the torque is estimated by using equation 17:

$$\mathbf{f}^\* = \frac{3}{2} \mathbf{P} \left[ \Phi\_{\rm sa} \mathbf{l}\_{\rm s\beta} - \Phi\_{\rm s\beta} \mathbf{l}\_{\rm s\alpha} \right] \tag{17}$$

Note that the stator voltages used in this estimator can be measured directly by mean of two or three sensors, or indirectly by combining the measured DC bus voltage and the transistor states (Cs1, Cs3, Cs5) of the VSI.

Improved DTC Algorithms for Reducing Torque and Flux Ripples of PMSM Based on Fuzzy Logic and PWM Techniques 175

$$
\begin{bmatrix}
\mathbf{V\_{sa}} \\
\mathbf{V\_{s\beta}}
\end{bmatrix} = \mathbf{U\_{dc}} \sqrt{\frac{2}{3}} \begin{bmatrix}
\mathbf{1} & -\frac{1}{2} & -\frac{1}{2} \\
\mathbf{0} & \mathbf{1} & \mathbf{1}
\end{bmatrix} \begin{bmatrix}
\mathbf{C\_{s1}} \\
\mathbf{C\_{s3}} \\
\mathbf{C\_{s5}}
\end{bmatrix} \tag{18}
$$

Cs1, Cs3 and Cs5 are the switching commands of each VSI leg and they are complementary. For the first leg (transistors S1 and S4), Cs1 is 1 if the upper switch (S1) is commanded to be closed and 0 if the lower one (S4) in commanded to be closed first.

The drawbacks of this estimation technique are: In addition to stator current sensors, at least one voltage sensor is necessary. In addition, the estimated torque and stator flux dependent to the stator resistance.

#### *3.4.2. Robust Torque and Flux Estimator (RTFE)*

174 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

( Г∗ )and the estimated torque (Г�).

**3.3. Switching table for controlling flux and torque** 

**1** 

**0** 

**Table 1.** Takahashi and Noguchi switching table

*3.4.1. Classical Torque and Flux Estimator (CTFE)* 

**3.4. Torque and flux estimator** 

states (Cs1, Cs3, Cs5) of the VSI.

Note that the electromagnetic torque can be controlled by mean of a two level comparator as the same as stator flux (see figure 3) or by using a three level comparator as shown in figure 5. In this work, a three level comparator has been used in order to minimize the switches commutation numbers and to have the two senses of the motor rotation. The output of this controller is represented by a Boolean variable KT which indicates directly if the amplitude of the torque must be increased, maintained constant or decreased, respectively, when KT is equal 1, 0 or -1. The goal of this controller is to maintain the torque variation ∆Г in the bandwidth [-εT , εT] chosen by the programmer of DTC algorithm. Indeed, this controller adjusts the torque variation generated by a comparator of electromagnetic torque reference

∆Г = Г∗ − Г� (16)

According to the signal generated by the hysteresis controller of stator flux and electromagnetic torque presented in figure 3 and 5, respectively; just one voltage vector can be selected to adjust the torque and flux. The choice of this vector depends on the outputs of the torque and flux controller and the position of the stator flux vector, as shown in table 1.

**K<sup>Φ</sup> KT θ <sup>1</sup> θ <sup>2</sup> θ <sup>3</sup> θ <sup>4</sup> θ <sup>5</sup> θ <sup>6</sup>**

In this chapter, two estimators of torque and stator flux will be presented.

 Г� <sup>=</sup> � �

**1** V2 V3 V4 V5 V6 V1 **0** V7 V0 V7 V0 V7 V0 **-1** V6 V1 V2 V3 V4 V5

**1** V3 V4 V5 V6 V1 V2 **0** V0 V7 V0 V7 V0 V7 **-1** V5 V6 V1 V2 V3 V4

The figure 2 shows that the torque and stator flux can be estimated by measuring the mechanical position, stator voltages and currents. Indeed, the stator flux is estimated by

Note that the stator voltages used in this estimator can be measured directly by mean of two or three sensors, or indirectly by combining the measured DC bus voltage and the transistor

P� ��I�� − Ф��I��� (17)

using equations 11, 12 and 13. Whereas, the torque is estimated by using equation 17:

In order to estimate stator flux and electromagnetic torque with this estimator, just current components and rotor position are measured without measuring stator voltages directly or by using transistor states and DC bus voltage sensor. The bloc diagram of this estimation technique is shown in figure 6.

The advantages of this NTFE are: Any stator voltage sensor is necessary to estimate stator flux or electromagnetic torque and the estimated stator flux and electromagnetic torque are independent to the stator resistance variations, which can improve the performances of the drive and reduce the cost of this equipment.

**Figure 6.** Robust Torque and Flux Estimator structure

#### **3.5. Speed PI controller synthesis**

The speed closed loop with the PI controller is presented by the bloc diagram in Figure 7. To eliminate the zero effect due to corrector, the compensation method is used to the corrector synthesis. In this case the regulator parameters are given by the relationships:

**Figure 7.** Closed loop PI speed controller

### **3.6. Simulation results**

The PMSM parameters used in this simulation are shown in table II. These parameters will be used in all the simulations of this chapter.


**Table 2.** PMSM parameters

The models of the PMSM, VSI and basic DTC algorithm are developed in Matlab/Simulink in order to examine the complete behaviour of the basic DTC. The sampling period has been chosen equal to 50 µs (20 KHz) for basic DTC. Various tests have been carried out in order to investigate the drive performance and to characterize the steady-state and transient behavior.

**Figure 8.** Mechanical speed (on the left) and electromagnetic torque (on the right) tracking performance under load variations in case of basic DTC

Improved DTC Algorithms for Reducing Torque and Flux Ripples of PMSM Based on Fuzzy Logic and PWM Techniques 177

**Figure 9.** Stator current waveform at 800 rpm with nominal load under basic DTC

**Figure 10.** Stator current spectrum at 800 rpm with nominal load (on the left) and Stator flux in (α,β) axes under load variations (on the right) in case of basic DTC
