Vector control of Induction motor


Introduction

In this experiment, a mathematical model of an induction motor will be simulated using the parameters estimated in the previous experiment. Unlike the previous experiment, in which the model was in the abc domain, the motor will be modeled in the dq frame. With proper alignment of the dq frame, the motor model becomes simpler than a motor model in the abc frame. In addition to reducing the simulation run time, this approach makes it easier to design PI controllers for motor speed, current, or position. The controller will also be evaluated on an actual induction motor in real time.

Theoretical background

Motor model

The following set of equations represents a linearized induction motor in the dq frame [1]:

\[v_{\mathrm{sd}} = R_{s}i_{\mathrm{sd}} - \omega _{d}\lambda _{\mathrm{sq}} + \frac{d\lambda _{\mathrm{sd}}}{dt}\tag{1}\]
\[v_{\mathrm{sq}} = R_{s}i_{\mathrm{sq}} + \omega _{d}\lambda _{\mathrm{sd}} + \frac{d\lambda _{\mathrm{sq}}}{dt}\tag{2}\]
\[v_{\mathrm{rd}} = R_{r}i_{\mathrm{rd}} - \omega _{\mathrm{dA}}\lambda _{\mathrm{rq}} + \frac{d\lambda _{\mathrm{rd}}}{dt}\tag{3}\]
\[v_{\mathrm{rq}} = R_{r}i_{\mathrm{rq}} + \omega _{\mathrm{dA}}\lambda _{\mathrm{rd}} + \frac{d\lambda _{\mathrm{rq}}}{dt}\tag{4}\]
\[T_{\mathrm{em}} = \frac{P}{2}(\lambda _{\mathrm{rq}}i_{\mathrm{rd}} - \lambda _{\mathrm{rd}}i_{\mathrm{rq}})\tag{5}\]
\[\lambda _{\mathrm{sd}} = L_{s}i_{\mathrm{sd}} + L_{m}i_{\mathrm{rd}}\tag{6}\]
\[\lambda _{\mathrm{sq}} = L_{s}i_{\mathrm{sq}} + L_{m}i_{\mathrm{rq}}\tag{7}\]
\[\lambda _{\mathrm{rd}} = L_{m}i_{\mathrm{sd}} + L_{r}i_{\mathrm{rd}}\tag{8}\]
\[\lambda _{\mathrm{rq}} = L_{m}i_{\mathrm{sq}} + L_{r}i_{\mathrm{rq}}\tag{9}\]
\[T_{\mathrm{em}} = T_{l} + J\frac{d\omega _{\mathrm{mech}}}{dt} + B\omega _{\mathrm{mech}}\tag{10}\]
\[\omega _{d} = \frac{P}{2}\omega _{\mathrm{mech}} + \omega _{\mathrm{dA}}\tag{11}\]

where

  1. Vsd, Vsq, Vrd, and Vrq: stator d-axis, stator q-axis, rotor d-axis, and rotor q-axis voltages, respectively

  2. Isd, Isq, Ird, and Irq: stator d-axis, stator q-axis, rotor d-axis, and rotor q-axis currents, respectively

  3. λsd, λsq, λrd, and λrq: stator d-axis, stator q-axis, rotor d-axis, and rotor q-axis flux linkages, respectively

  4. Rs: stator resistance

  5. Rr: reflected rotor resistance

  6. Lm: per-phase mutual inductance

  7. Ls: Lls + Lm, where Lls is the stator leakage inductance

  8. Lr: Llr + Lm, where Llr is the rotor leakage inductance

  9. J: rotor inertia

  10. B: coefficient of viscous friction

  11. P: number of stator poles

  12. Tem: output/electromagnetic torque

  13. Tl: load torque

  14. ωmech: rotor mechanical speed

  15. ωd: d-axis rotational speed with respect to the stator A-phase magnetic axis

  16. ωda: d-axis rotational speed with respect to the rotor A-phase magnetic axis

The dq quantities are obtained from their corresponding abc by the following equations:

\[dq = \sqrt{2/3} \times (a \times e^{-j\theta } + b \times e^{-j(\theta - 2\pi /3)} + c \times e^{-j(\theta - 4\pi /3)})\tag{12}\]

where θ is obtained by integrating the d-axis speed with respect to the corresponding magnetic axis.

In induction-motor vector control, the d-axis is aligned with the rotor-flux axis, which implies that λrq = 0. For the motor under consideration, a squirrel-cage induction motor with shorted rotor bars, the rotor voltages vrd and vrq are both zero. Substituting these conditions and combining the d- and q-axis equations lead to the following simplified equations:

\[v_{\mathrm{sdq}} = R_{s}i_{\mathrm{sdq}} + j\omega _{d}\lambda _{\mathrm{sdq}} + \frac{d\lambda _{\mathrm{sdq}}}{dt}\]
\[\Rightarrow \frac{d\lambda _{\mathrm{sdq}}}{dt} = v_{\mathrm{sdq}} - R_{s}i_{\mathrm{sdq}} - j\omega _{d}\lambda _{\mathrm{sdq}}\tag{13}\]

From Eqns. 3 and 8

\[0 = R_{r}i_{\mathrm{rd}} + \frac{d\lambda _{\mathrm{rd}}}{dt} = R_{r}\frac{\lambda _{\mathrm{rd}} - L_{m}i_{\mathrm{sd}}}{L_{r}} + \frac{d\lambda _{\mathrm{rd}}}{dt}\]
\[\Rightarrow \frac{d\lambda _{\mathrm{rd}}}{dt} = \frac{L_{m}}{\tau _{r}}i_{\mathrm{sd}} - \frac{\lambda _{\mathrm{rd}}}{\tau _{r}}\tag{14}\]

where \(\tau _{r} = \frac{L_{r}}{R_{r}}\)

From Eqns. 4 and 9

\[0 = R_{r}i_{\mathrm{rq}} + \omega _{\mathrm{dA}}\lambda _{\mathrm{rd}}\]
\[\Rightarrow \omega _{\mathrm{dA}} = -R_{r}\frac{i_{\mathrm{rq}}}{\lambda _{\mathrm{rd}}} = \frac{L_{m}}{\tau _{r}\lambda _{\mathrm{rd}}}i_{\mathrm{sq}}\tag{15}\]

From Eqns. 5 and 9

\[T_{\mathrm{em}} = -\frac{P}{2}\lambda _{\mathrm{rd}}i_{\mathrm{rq}} = \frac{P}{2}\frac{L_{m}}{L_{r}}\lambda _{\mathrm{rd}}i_{\mathrm{sq}}\tag{16}\]

Equations 6 through 16 represent the simplified motor model when the d-axis is aligned with the rotor-flux axis.

Current controller design

In current-control mode, the stator d- and q-axis currents are controlled under varying load conditions. Under steady-state conditions, the rotor flux is solely a function of isd, as can be inferred from Eqns. 3 and 8. Throughout motor operation, isd is maintained at a constant rated value to achieve a fast dynamic response, i.e., to produce maximum torque with minimum isq. This value is calculated as follows.

Under steady-state conditions, the derivative terms in Eqns. 1 through 4 become zero, ωd = ωsync = 2πf, and ωdA = s * ωsync = ωslip, where s is the slip and f is the frequency of the applied voltage. Assume that the d-axis is aligned with the stator-voltage space vector at time t = 0. Then, vsq = 0 and vsd = √(3/2) x Va, where Va is the rated peak phase voltage. This will not be the case in steady state because the d-axis is aligned with the rotor-flux axis, which is not in phase with the applied stator voltage. However, this will be compensated for later in the computation. Substituting these conditions into Eqns. 1 through 4 yields:

\[R_{s}i_{\mathrm{sd}} - \omega _{\mathrm{sync}}(L_{s}i_{\mathrm{sq}} + L_{m}i_{\mathrm{rq}})= \sqrt{3/2} \times V_{a}\tag{17}\]
\[R_{s}i_{\mathrm{sq}} + \omega _{\mathrm{sync}}(L_{s}i_{\mathrm{sd}} + L_{m}i_{\mathrm{rd}}) = 0\tag{18}\]
\[R_{r}i_{\mathrm{rd}} - s \times \omega _{\mathrm{sync}}(L_{m}i_{\mathrm{sq}} + L_{r}i_{\mathrm{rq}}) = 0\tag{19}\]
\[R_{r}i_{\mathrm{rq}} + s \times \omega _{\mathrm{sync}}(L_{m}i_{\mathrm{sd}} + L_{r}i_{\mathrm{rd}}) = 0\tag{20}\]

From the four equations above, the stator and rotor dq currents can be computed. The rotor dq flux linkages can then be computed using Eqns. 8 and 9. In vector control, where the d-axis is aligned with the rotor-flux axis, λrq must be zero. This will not be the case here because the d-axis was aligned with the stator voltage. To compensate for this, all computed dq values are rotated by:

\[\theta _{r} = -\tan^{-1}\left(\frac{\lambda _{\mathrm{rq}}}{\lambda _{\mathrm{rd}}}\right)\tag{21}\]

In implementation, use a quadrant-aware arctangent when computing this angle.

This will make λrq = 0 and give the rated isd for a d-axis aligned with the rotor flux.

Having determined the reference d-axis stator current, let's proceed with designing the controller for the current loop. From Eqns. 6, 7, and 8, it can be derived that:

\[\lambda _{\mathrm{sd}} = \sigma L_{s}i_{\mathrm{sd}}+ \frac{L_{m}}{L_{r}}\lambda _{\mathrm{rd}}\tag{22}\]
\[\lambda _{\mathrm{sq}} = \sigma L_{s}i_{\mathrm{sq}}\tag{23}\]

where σ is the leakage factor of the induction motor, given by \(\sigma = 1 - \frac{L^{2}_{m}}{L_{s}L_{r}}\)

Substituting these into Eqns. 1 and 2 yields:

\[v_{\mathrm{sd}} = R_{s}i_{\mathrm{sd}} + \sigma L_{s}\frac{di_{\mathrm{sd}}}{dt} + \frac{L_{m}}{L_{r}}\frac{d\lambda _{\mathrm{rd}}}{dt} - \omega _{d}\sigma L_{s}i_{\mathrm{sq}}\tag{24}\]
\[v_{\mathrm{sq}} = R_{s}i_{\mathrm{sq}} + \sigma L_{s}\frac{di_{\mathrm{sq}}}{dt} + \omega _{d}\frac{L_{m}}{L_{r}}\lambda _{\mathrm{rd}} + \omega _{d}\sigma L_{s}i_{\mathrm{sd}}\tag{25}\]

For controller design, the last two terms can be ignored as disturbances. The resulting equation in transfer function form is given below:

\[\frac{i_{\mathrm{sd}}(s)}{v_{\mathrm{sd}}(s)} = G_{c}(s) = \frac{1}{R_{s} + s\sigma L_{s}}\tag{26}\]

The transfer function for the q-axis current is the same as that for the d-axis current. Hence, tuning the PI loop for one axis is sufficient. The overall system is shown below:

Induction motor vector control current loop PI controller

The ki,p and ki,i gain values are adjusted to achieve the desired transient response. There are multiple ways to quantify the desired response. In the time domain, the desired rise time and overshoot for a step input are typically specified, and the gains are adjusted to satisfy these requirements. Alternatively, in the frequency domain, the desired phase margin and crossover frequency are specified. The latter approach is used here because it provides a clearer picture of system stability. The steady-state response of the system is obtained by substituting s = jω in Eqn. 26.

\[K_{c}(j\omega ) = PI_{c}(j\omega ) \times G_{c}(j\omega ) = \frac{j\omega k_{i,p} + k_{i,i}}{j\omega } \times \frac{1}{j\omega \sigma L_{s} + R_{s}}\tag{27}\]

The system above is tuned for a desired phase margin of Φi at a crossover frequency of ωi,c as follows. At the crossover frequency, the system gain equals 1 and the system phase shift equals -π + Φi. Substituting this into Eqn. 27:

\[\angle K_{c}(j\omega _{i,c}) = -\pi + \Phi _{i} = -\frac{\pi }{2} + \tan^{-1}\left(\frac{\omega _{i,c}k_{i,p}}{k_{i,i}}\right) - \tan^{-1}\left(\frac{\omega _{i,c}\sigma L_{s}}{R_{s}}\right)\]
\[\Rightarrow \frac{\omega _{i,c}k_{i,p}}{k_{i,i}} = \tan\left(\Phi _{i} - \frac{\pi }{2} + \tan^{-1}\left(\frac{\omega _{i,c}\sigma L_{s}}{R_{s}}\right)\right)\]
\[\Rightarrow k_{i,p} = \frac{k_{i,i}}{\omega _{i,c}} \times \tan\left(\Phi _{i} - \frac{\pi }{2} + \tan^{-1}\left(\frac{\omega _{i,c}\sigma L_{s}}{R_{s}}\right)\right) = C1 \times k_{i,i}\tag{28}\]

where

\[C1 = \frac{1}{\omega _{i,c}} \times \tan\left(\Phi _{i} - \frac{\pi }{2} + \tan^{-1}\left(\frac{\omega _{i,c}\sigma L_{s}}{R_{s}}\right)\right)\tag{29}\]

and

\[|K_{c}(j\omega _{i,c})| = 1 = |\frac{j\omega _{i,c}k_{i,p} + k_{i,i}}{j\omega _{i,c}} \times \frac{1}{j\omega _{i,c}\sigma L_{s} + R_{s}}|\]
\[\Rightarrow (\omega _{i,c}k_{i,p})^{2} + k^{2}_{i,i} = \omega ^{2}_{i,c}((\omega _{i,c}\sigma L_{s})^{2} + R^{2}_{s})\]
\[\Rightarrow k_{i,i}= \omega _{i,c}\sqrt{\frac{(\omega _{i,c}\sigma L_{s})^{2} + R^{2}_{s}}{(\omega _{i,c} \times C1)^{2} + 1}}\tag{30}\]

Given the desired Φi and ωi,c, and the motor parameters, the PI gains can be solved using Eqns. 28 through 30.

Speed controller design

The mechanical-system transfer function can be obtained from Eqn. 10. Ignoring the load torque as a disturbance:

\[\frac{\omega _{\mathrm{mech}}(s)}{T_{\mathrm{em}}(s)} = G_{s}(s) = \frac{1}{sJ + B}\tag{31}\]

Using Eqns. 14 and 16, the electromagnetic torque can alternatively be represented as follows for vector control in steady state:

\[T_{\mathrm{em}} = \frac{P}{2}\frac{L^{2}_{m}}{L_{r}}i_{sd,\mathrm{ref}}i_{\mathrm{sq}} = k_{t} \times i_{\mathrm{sq}}\tag{32}\]

The inner current loop can be modeled as a unity-gain transfer function. This assumption is valid as long as the response time of the inner current loop is an order of magnitude shorter than that of the outer speed loop. In other words, the crossover frequency of the inner current loop ωi,c >> the crossover frequency of the outer speed loop ωs,c. As with the current controller, the system above can be represented as follows:

\[K_{s}(j\omega ) = PI_{s}(j\omega ) \times G_{s}(j\omega ) = \frac{k_{s,p}s + k_{s,i}}{s} \times \frac{k_{t}}{Js + B}\tag{33}\]

The system above is similar to that of the current controller designed earlier. Following the same procedure, the speed-controller gains are:

\[k_{s,p} = C2 \times k_{s,i}\tag{34}\]

where

\[C2 = \frac{1}{\omega _{s,c}} \times \tan\left(\Phi _{s} - \frac{\pi }{2} + \tan^{-1}\left(\frac{\omega _{s,c}J}{B}\right)\right)\tag{35}\]

and

\[k_{s,i}= \frac{\omega _{s,c}}{k_{t}}\sqrt{\frac{(\omega _{s,c}J)^{2} + B^{2}}{(\omega _{s,c} \times C2)^{2} + 1}}\tag{36}\]

where ks,p and ks,i are the proportional and integral gains, respectively, of the speed PI controller.

Simulation of induction-motor speed control

The above speed control model is simulated using Workbench in this section.

please noteNote

Save the model at frequent steps.

Open-loop motor model

  1. Create a new project and add a new model file and script file to it.

  2. Set this model file as the Start model/Function in project properties.

  3. Open the script file and initialize all the model parameters, as shown below, using the parameters estimated in the previous experiment.

    Code
    Public Module IM
    Public f As Native Double = 50 ! Rated frequency
    Public Rs As Native Double = 1.79 ! Stator Resistance
    Public Rr As Native Double = 1.05 ! Rotor Resistance
    Public Lls As Native Double = 5E-3 ! Stator leakage Inductance
    Public Llr As Native Double = 5E-3 ! Rotor leakage Inductance
    Public Lm As Native Double = 30E-3 ! Mutual Inductance
    Public Ls As Native Double = Lm + Lls ! Stator Inductance
    Public Lr As Native Double = Lm + Llr ! Rotor Inductance
    Public J As Native Double = 150E-6 ! Rotor Inertia
    Public B As Native Double = 100E-6 ! Coefficient of Viscous friction
    Public P As Native Double = 4 ! Number of poles
    Public Vllrms As Native Double = 14.7 ! Rated line to line voltage
    Public slip As Native Double = 0.1 ! Rated slip
    Public ωsyn As Native Double = 2 * π * f ! Synchronous speed at rated frequency
    Public ωm As Native Double = (1 - slip) * ωsyn ! Speed at rated slip
    Public Va As Native Double = VLLrms * √2 / √3 ! Phase voltage peak
    Public τr As Native Double = Lr / Rr
    End Module
  4. Open the model file and set its Step time property to 5E-5.

  5. Drag a Subsystem tool from the Signal Routing class in the Toolbox to the model.

  6. A subsystem is an enclosure within which more tools can be added. Double-click the subsystem to open it.

  7. Drag the following tools from the Toolbox to the subsystem and connect them as shown to create the abc-to-dq transformation given in Eqn. 12.

    # Tool type Tool class Tool name
    1 In-port Signal Routing I
    2 In-port Signal Routing I1
    3 Constant Signal Sources Constant
    4 Adder Subtractor Math Block Add
    5 Elementary Function Math Block ElemF
    6 Elementary Function Math Block ElemF1
    7 Multiplier Divider Math Block Mul
    8 Multiplier Divider Math Block Mul1
    9 Demux Signal Routing DeMux
    10 Demux Signal Routing DeMux1
    11 Adder Subtractor Math Block Add1
    12 Adder Subtractor Math Block Add2
    13 Gain Math Block Gain
    14 Gain Math Block Gain1
    15 Concatenate Matrix Manipulation Concat
    16 Out-port Signal Routing O

    ABC to DQ transformation

  8. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    I Name abc Input abc signal.
    I1 Name theta Input theta.
    Constant Magnitude {0, 2 * π / 3, 4 * π / 3} Muxed 3Φ phase shift signal.
    Add Arithmetic operation +- Add the cosine terms.
    ElemF Function Cos
    ElemF1 Function Sin
    DeMux Number of Ports 3 Splits the muxed signal into independent signals.
    DeMux1 Number of Ports 3 Splits the muxed signal into independent signals.
    Add Number of ports 3 Add the cosine terms.
    Add2 Number of ports 3 Add the sine terms.
    Gain Gain √2 / √3 Scale by sqrt(2/3).
    Gain1 Gain -(√2) / √3 Scale by -sqrt(2/3).
    Concat Pivot Dimension 2 Combines the signals to form a column matrix.
    O Name dq Output dq.

  9. Return to the main motor model by clicking its tab at the top.

  10. Resize the subsystem so that all ports are visible. To resize a tool, drag any of the four squares at its corners.

  11. Drag the following tools from the Toolbox to the model and connect them as shown to test whether the abc-to-dq transformation functions as expected.

    # Tool type Tool class Tool name
    1 Sine Signal Sources Sine
    2 Constant Signal Sources Constant
    3 Integrator Math Block Integrator
    4 Mag-Time Scope Display Scope

    ABC to DQ transformation

  12. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    Sine Phase shift (in degrees) {0, -120, -240} Input abc signal.
    Constant Magnitude 2 * π * 1 Frequency of the input signal in rad/s.

  13. Run the simulation and check whether the results are DC values, with the d-axis equal to zero and the q-axis negative.

  14. Drag the following tools from the Toolbox to the subsystem and connect them as shown to create the dq-to-abc transformation.

    # Tool type Tool class Tool name
    1 In-port Signal Routing I
    2 In-port Signal Routing I2
    3 Constant Signal Sources Constant
    4 Demux Signal Routing DeMux
    5 Adder Subtractor Math Block Add
    6 Elementary Function Math Block ElemF
    7 Elementary Function Math Block ElemF1
    8 Multiplier Divider Math Block Mul
    9 Multiplier Divider Math Block Mul1
    10 Adder Subtractor Math Block Add1
    11 Gain Math Block Gain
    12 Out-port Signal Routing O

    ABC to DQ transformation

  15. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    I Name dq Input dq signal.
    I1 Name theta Input theta.
    Constant Magnitude {0, 2 * π / 3, 4 * π / 3} Muxed 3Φ phase shift signal.
    Add Arithmetic operation +- Add the cosine terms.
    ElemF Function Cos
    ElemF1 Function Sin
    Add1 Arithmetic operation +- Subtract the cosine and sine terms.
    Gain Gain √2 / √3 Scale by sqrt(2/3).
    O Name abc Output abc.

  16. Return to the main motor model by clicking its tab at the top.

  17. Resize the subsystem so that all ports are visible. To resize a tool, drag any of the four squares at its corners.

  18. Drag the following tools from the Toolbox to the model and connect them as shown to test whether the abc-to-dq transformation functions as expected. The output of ABCtoDQ is a column matrix, while the input of DQtoABC is a muxed signal. Therefore, the signal format must be converted.

    # Tool type Tool class Tool name
    1 Decatenate Matrix Manipulation Decat
    2 Mux Signal Routing Mux

    DQ to ABC transformation

  19. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    Decat Pivot Dimension 2 Splits along the row.

  20. Run the simulation and check whether the results are the same as the input.

  21. Delete the Decat and Mux tools.

  22. The next step is to determine the motor's stator flux, as given in Eqn. 13. Create another subsystem, drag the tools listed below into it, and connect them as shown to implement the equation.

    # Tool type Tool class Tool name
    1 In-port Signal Routing I
    2 In-port Signal Routing I1
    3 In-port Signal Routing I1
    4 Constant Signal Sources Constant
    5 Multiplier Divider Math Block Mul
    6 Multiplier Divider Math Block Mul1
    7 Gain Math Block Gain
    8 Adder Subtractor Math Block Add
    9 Integrator Math Block Integrator
    10 Out-port Signal Routing O

    Induction motor stator flux

  23. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    I Name vsdq Stator voltage dq signal, vsdq.
    I1 Name isdq Stator current dq signal, isdq.
    I2 Name wd d-axis speed, ωd.
    Gain Gain IM:Rs Stator resistance, Rs.
    Constant Magnitude [[0, -1], [1, 0]] Rotational matrix.
    Add Number of ports 3
    Add Arithmetic operation +--
    Integrator Initial value [[0], [0]] Initial stator flux linkage.
    O Name fsdq Stator dq flux, λsdq.

  24. The next step is to determine the stator and rotor currents from the flux, as given in Eqns. 6 through 10. Drag the tools listed below into the model and connect them as shown to implement the equations.

    # Tool type Tool class Tool name
    1 Constant Signal Sources Constant1
    2 Concatenation Matrix Manipulation Concat
    3 Concatenation Matrix Manipulation Concat1
    4 Constant Signal Sources Constant2
    5 Multiplier Divider Math Block Mul
    6 Decatenation Matrix Manipulation Decat
    7 Decatenation Matrix Manipulation Decat

    Induction motor dq currents

  25. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    Concat Pivot Dimension 2 Combine λsd and λsq.
    Concat1 Pivot Dimension 2 Combine λrd and λrq.
    Constant1 Magnitude 0 λrq = 0.
    Constant2 Magnitude 1/[[IM:Ls, 0, IM:Lm, 0], [0, IM:Ls, 0, IM:Lm], [IM:Lm, 0, IM:Lr, 0], [0, IM:Lm, 0, IM:Lr]] Eqns. 6 through 10.
    Decat Pivot Dimension 2 Split into isdq and irdq.
    Decat Pivot Dimension 2 Split into isd and isq.

  26. The next step is to determine the rotor flux and d-axis speed to close the model loop. As before, add the following tools and connect them as shown.

    # Tool type Tool class Tool name
    1 Gain Math Block Gain
    2 Adder Subtractor Math Block Add
    3 Integrator Math Block Integrator1
    4 Gain Math Block Gain1
    5 Multiplier Divider Math Block Mul1
    6 Multiplier Divider Math Block Mul2
    7 Gain Math Block Gain2
    8 Gain Math Block Gain3

    Induction rotor flux and d-axis speed

  27. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    Gain Gain IM:Lm / IM:τr Eqn. 14. λrd calculation.
    Add1 Arithmetic operation -+ Eqn. 14. λrd calculation.
    Gain1 Gain 1 / IM:τr Eqn. 14. λrd calculation.
    Integrator1 Initial value 0.001 Eqn. 14. Prevents a division-by-zero error. Its output is λrd.
    Mul1 Arithmetic operation x/ Eqn. 15. ωdA calculation.
    Gain2 Gain IM:Lm / IM:τr Eqn. 15. ωdA calculation. Its output is ωdA.
    Gain3 Gain (IM:p / 2) * IM:Lm / IM:Lr Eqn. 16. Torque calculation. Its output is Tem.

  28. The last remaining step is to determine the rotor speed using Eqn. 10. The rotor-flux-axis speed is obtained from the rotor speed and ωdA using Eqn. 11. To do this, add the following tools and connect them as shown.

    # Tool type Tool class Tool name
    1 Constant Signal Sources Constant3
    2 Adder Subtractor Math Block Add1
    3 Transfer function Continuous TransferFnc
    4 Gain Math Block Gain4
    5 Adder Subtractor Math Block Add2

    Vector control d-axis speed

  29. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    Constant3 Magnitude 0 Eqn. 10. Load torque Tl.
    Add1 Arithmetic operation +- Eqn. 10. Tem - Tl.
    TransferFnc Numerator {1} Eqn. 10 can be represented in transfer function form as (Tem - TL)/(sJ + B).
    TransferFnc Denominator {IM:J, IM:B} Eqn. 10 can be represented in transfer function form as (Tem - TL)/(sJ + B). Output of this block is the motor mechanical speed, ωmech.
    Gain4 Gain IM:p / 2 ωm = P/2 x ωmech.
    Add2 Arithmetic operation ++ ωd = ωm + ωdA.

  30. All that remains is to close the loop. Delete the Constant tool connected to the abc → dq subsystem. This was initially used as the d-axis speed and is no longer needed since we have the actual d-axis speed, aligned with rotor flux. Connect the output of Add2, which is ωd, to the input of Integrator2. The output of Integrator2 is θda, which must be connected to the theta input of the dq → abc subsystem. Also connect the output of Add2, ωd, to the ωd input of the stator-flux subsystem. The stator dq currents for the stator-flux subsystem, isdq, are obtained by connecting the output of Decat. Finally, the rotor d-axis flux, λrd, i.e., the output of Integrator1, is connected to the input of Concat1. The overall induction-motor dq model, with its d-axis aligned with the rotor flux, is shown below.

    Overall induction motor dq model, with d-axis aligned with rotor flux

  31. Set the input voltage and frequency in the Sine block.

    Tool name Property field Property value Comments
    Sine Magnitude IM:Va Rated peak phase voltage.
    Sine Frequency (Hz) IM:f Rated frequency.

  32. Set the model Run time to 3.

  33. Add scopes to observe the abc and dq stator voltages and currents, motor speed, electromagnetic torque, and any other values of interest.

  34. Run the simulation and observe the results.

  35. Obtain results for the following operating conditions:

    1. Input frequency = 0.5 x Rated frequency, Input voltage = 1 x Rated voltage

    2. Input frequency = 1 x Rated frequency, Input voltage = 0.5 x Rated voltage

    3. Input frequency = 0.5 x Rated frequency, Input voltage = 0.5 x Rated voltage

    4. Input frequency = Rated frequency, Input voltage = Rated voltage

  36. Replace the constant load torque with a Step from Signal Sources. Set the step's Final value to 0.1 and its Step time to 2.

  37. Rerun the simulation and observe the results.

If a runtime exception occurs, use the DataPeek window docked on the right to inspect each tool's inputs, outputs, and parameters immediately before the exception occurred. This window can be used to observe the value of any tool or code variable at any time. Click the Data peek show selected icon in the DataPeek window and select a tool to view its value. Similarly, to view the value of a variable in the script file, place the cursor on the variable and double-click it. Its value will appear in the DataPeek window.

Motor current control

In this section, the current through the motor is controlled using a PI controller.

  1. Compute ki,p and ki,i using Eqns. 28 through 30 so that the system has a phase margin of Φi = π/3 at a crossover frequency of ωi,c = 2π x 200. The crossover frequency is chosen as 200 Hz, which is less than one-tenth of the 6 kHz switching frequency. As a rule of thumb, every additional loop should have a bandwidth no greater than one-tenth that of the inner loop. In this case, it helps prevent the current controller from trying to compensate the switching current harmonics.

  2. Open a new instance of Workbench.

  3. In the motor model designed earlier, the motor currents and speed are determined from the applied terminal voltage and load torque. These two parameters are measured using current and speed sensors for sensored vector control. From these two parameters, the rotor-flux position is established using Eqns. 11 and 15, as implemented earlier within the motor model. The control voltages are generated in the dq frame and must be converted to abc voltages to be generated by the power processing unit. This dq-abc transformation has been implemented earlier as well.

    These two blocks are already implemented and can be opened from the examples folder, usually located at C:\Program Files (x86)\Sciamble\WorkBench v1\Examples\CUSPLab\AdvancedDrives\Experiment4\CurrentController. This motor-model subsystem is the model that was built in the previous section and has been enclosed within a subsystem. In addition, the abc-dq transformation and the estimator subsystem have been added to the model file.

    Motor estimator model

  4. Add another subsystem to the model in which the d-axis PI current controller will be modeled. Double-click the subsystem to open it.

  5. Drag the following tools from the Toolbox to the subsystem and connect them as shown.

    # Tool type Tool class Tool name
    1 In-port Signal Routing I
    2 In-port Signal Routing I1
    3 Adder Subtractor Math Block Add
    4 Gain Math Block Gain
    5 Gain Math Block Gain1
    6 Integrator Math Block Integrator
    7 Adder Subtractor Math Block Add2
    8 Saturation Non-linear Saturation
    9 Out-port Signal Routing O

    PI current controller

  6. Change the properties of each tool to the values listed in the table below.

    Tool name Property field Property value Comments
    I Name Ref Desired reference motor current.
    I1 Name Fbk Actual motor current.
    Add Arithmetic operation +- Difference between the desired and actual motor current.
    Gain Gain ki,p Substitute the value of ki,p computed in step 1.
    Gain1 Gain ki,i Substitute the value of ki,i computed in step 1.
    Integrator Integrator Type Anti-windup Reason explained later.
    Integrator Upper Limit 20
    Integrator Lower Limit -20
    Saturation Upper Limit 20
    Saturation Lower Limit -20
    O Name Out Applied terminal voltage to generate the desired current profile.

    When there is a large difference between the desired and actual currents, the PI controller produces a large output voltage to correct the error quickly. In a physical system, the magnitude of this voltage is limited by either the available DC-bus voltage or the voltage ratings of the motor and power electronics. Therefore, in a practical implementation of a PI controller, the controller output is limited to the maximum possible voltage. During transient conditions, when the actual current differs from the desired current, the integrator in the PI controller can rapidly build its output to a large value because of the persistent input error. When the error returns to zero, this large accumulated output does not immediately decay and can cause the actual current to overshoot the desired value. The error then becomes negative, causing the integrator output to fall, but it can fall by more than desired and cause the current to undershoot. This cycle can repeat, and the oscillation may decay slowly. To avoid this, the range over which the integrator is active is clamped by setting it to Anti-windup. If the integrator output reaches this limit, the integrator is disabled until the polarity of the error reverses. This improves the response of the system significantly.

  7. Create a copy of the PI subsystem for q-axis current control. Connect the outputs of these two PI controllers to the dq-to-abc subsystem as shown:

    Induction motor current control.

  8. Set the d-axis current reference to a constant obtained by solving Eqns. 17 through 21.

  9. Set the q-axis current reference to step from 0 A to 1 A at time t = 2 s.

  10. Add a step load torque and for the time being set the Final value to 0.

  11. Run the simulation and observe whether the steady-state dq currents match the reference currents and whether the transient response is satisfactory.

Motor speed control

In this section, the speed of the motor is controlled using a PI controller.

  1. Compute ks,p and ks,i using Eqns. 33 through 36 so that the system has a phase margin of Φs = π/3 at a crossover frequency of ωs,c = ωi,c/10 = 2π x 20. The crossover frequency is chosen as 20 Hz, which is one-tenth of the crossover frequency of the inner current loop.

  2. Replace the step source for the q-axis current reference with a PI-controller subsystem whose output will be the reference q-axis current.

  3. Change the PI gains to the values computed in the earlier step. Saturate the integrator and the PI subsystem's output to 5, which is the transient current limit of the motor under test.

  4. Connect the feedback input to the motor speed from the motor-model subsystem. Apply a step-speed reference from 0 to 100 rad/s at time t = 2 s.

  5. Change the Final value of the load torque to 0.05 N·m at time t = 4 s.

  6. Run the simulation and observe whether the motor's steady-state speed matches the reference speed.

This concludes the simulation of induction-motor vector control. In the following section, a prebuilt induction-motor vector-control model is run in real time.

Real-time vector control of an induction motor
  1. Open Workbench and pin the Explorer and Properties docks.

  2. Navigate to and open the IMVectorControl project file in the Experiment4\Realtime folder, usually located at C:\Program Files (x86)\Sciamble\WorkBench v1\Examples\CUSPLab\AdvancedDrives.

  3. Expand the project in the Explorer and open the ModelFile model file shown below:

    Induction motor vector control model

    The top section of the model contains the induction-motor vector control and is a replication of the simulation model developed earlier, with a few additions to enable real-time control. On the left is the speed PI controller, followed by the d- and q-axis current PI controllers, whose outputs are the dq terminal voltages. The following subsystem converts the dq voltages to abc voltages. In the simulation model, this terminal-voltage signal was connected to the motor model. Here, it is converted to the inverter's PWM duty cycles to control the induction motor in real time. In real-time mode, ADCs measure the actual motor stator currents; these are located in the top-right corner of the model. The A-quad-B encoder measures the mechanical rotor position, from which the model obtains the mechanical rotor speed. The encoder does not directly measure the rotor-flux angle. The controller obtains the rotor-flux electrical speed by adding the mechanical electrical speed to the estimated slip speed, then integrates that result to obtain the rotor-flux angle used by the dq transformations.

    The bottom section consists of the DC motor current control. This is used to emulate the load torque.

  4. The Init() function in the IMParam script file computes the controller parameters from the motor parameters, loop crossover frequency, and phase margin. Set the speed-loop crossover frequency ωc and phase margin φm in the script to the same values used in the simulation.

  5. The Init() function must be called before running the simulation model to initialize the controller gain values. To do this, open the project properties by double-clicking the IMVectorControl project node in the Explorer, and set the Prerun Model/Function to IMParam:Init() as shown below:

    Similarly, set Start model/Function to ModelFile to run the model after parameter initialization.

    Project prerun property setting

  6. Click the Numerical simulation and real-time prototyping Run button button to run the model in simulation mode. Using DataPeek, verify that the controller-gain parameters computed by the Init() function match the values computed earlier.

  7. Turn ON the DC power supply and set the voltage to 40 V.

  8. Ensure that the Numerical simulation to Real-time mode transition button button on the top dock is pressed to enter real-time mode. Click the run button.

    please noteNote

    When the real-time mode button is pressed, the motor model is grayed out. Grayed-out tools are not coded for real-time operation. Workbench can automatically identify which tools need to be coded for real-time operation and which do not. This allows a single unified model to be used for both real-time operation and simulation while generating highly optimized real-time code.

  9. Observe the speed and current results in the scope. Click Model display scope autofocus time axis alone to focus the results. After about 5 s, stop data logging by clicking Numerical simulation and real-time prototyping Stop button.

  10. Turn OFF the DC power supply.

  11. If necessary, repeat the experiment for different loop crossover frequencies and phase margins.

  12. Turn OFF the DC power supply and disconnect all connections, including the USB cable.

Lab report and reading assignment
  1. List the kp and ki values of the current and speed PI controllers.

  2. Attach the plot of 3φ stator and rotor currents from simulation.

  3. Attach plots of the electromagnetic-torque response, stator dq currents, and rotor speed from both the simulation and real-time experiment.

  4. Ignoring the noise in the waveform in real-time mode, do the stator dq currents and the electromagnetic torque waveforms match those obtained from simulation? If not, explain why.

  5. Read through the Init() function and add comments to each line of code. Later experiments will require writing a script file to compute the controller parameters.

Reference
  1. "Analysis and Control of Electric Drives: Simulations and Laboratory Implementation," Ned Mohan and Siddharth Raju, Wiley Publication.