Vector Control of an Induction Machine
Overview
This demo model features an induction motor drive system with field oriented control. The drive is fed by a DC voltage of \(400\,\mathrm{V}\) and produces \(200\,\mathrm{Nm}\) of torque. The model consists of one subsystem called “Plant + Controller”. The subsystem contains the drive system and the controller using a vector control scheme. The following sections provide a brief description of the model and instructions on how to simulate it.
Real-time execution on the RT Box requires the model to execute using a fixed-step solver. The discretization step size parameter specifies the base sample time of the generated code and is used to discretize the physical model and control domain state-space equations. The execution time represents the actual time it takes to execute one discrete step of the PLECS model on the RT Box hardware. The chosen discretization step sizes and average execution times for each core in this demo model are shown in Tab. 1.
Core 0: exec. time / step size |
Core 1: exec. time / step size |
|
|---|---|---|
RT Box 2, 3 or 4 |
\(3.5\,\mu\mathrm{s}\) / \(5\,\mu\mathrm{s}\) |
\(2\,\mu\mathrm{s}\) / \(100\,\mu\mathrm{s}\) |
RT Box 1 |
\(5\,\mu\mathrm{s}\) / \(5\,\mu\mathrm{s}\) |
N/A |
Requirements
To run this demo model, the following items are needed (available at www.plexim.com):
One PLECS RT Box and one PLECS and PLECS Coder license
Follow the step-by-step instructions on configuring PLECS and the RT Box in the Quick Start guide of the RT Box Target Support Package Documentation.
Two 37 pin Sub-D cables to connect the box in loop-back setup at the front panel.
Note that this demo model primarily showcases the RT Box multi-tasking mode. All RT Boxes support multi-tasking, but the implementation differs depending on the model.
When the target is an RT Box 2, 3 or 4, the main CPU core (Core 0) runs the plant as “Base task” with a sample time of
Ts_plant. Another core (Core 1) runs closed-loop controls in “Controller” task in parallel with a sample time ofTs_controller, which is much slower and usually equals the switching period of the converter. In this way, the multi-core feature of the RT Box 2, 3 or 4 is showcased by splitting the computational effort onto different cores. Besides, the setup can easily transition to a HIL or RCP test later on.However if the user has only a single RT Box 1 available, this model can also run with the multi-tasking feature onto the only CPU core of the RT Box 1, but in a pre-emptive multi-tasking fashion. In this case, the “Base task” is doing the plant calculation with the highest priority with a sample time of
Ts_plant. The “Controller” task is executed as a background task with lower priority at the sample time ofTs_controller.
Please check the setting under Scheduling tab of the Coder options… window.
Note
Model
The top-level schematic contains one subsystem including both plant and controller models, as shown in Fig. 1. The subsystem is enabled for code generation from the Edit + Subsystem + Execution settings… menu. This step is necessary to generate the model code for the RT Box.
Fig. 1 Top-level schematic of the induction machine drive system model
Power Circuit
The power circuit includes an induction machine (IM) and a three-phase full bridge voltage source inverter (VSI). The mechanical interface of the IM is loaded by a linear friction block via a gear box. The DC voltage source \(V_{\mathrm{i}}\) with \(V_{\mathrm{dc}} = 400\,\mathrm{V}\) supplies the VSI, which is represented by three IGBT Half Bridge power modules.
The six switching signals are brought into the subsystem by a PWM Capture block from the PLECS RT Box component library. The measurements of the DC voltage and the AC current are exported out of the subsystem by Analog Output ports. The rotor angular position and rotational speed are converted by the Incremental Encoder block into digital orthogonal pulses, which can be measured outside of the subsystem.
Fig. 2 Power circuit of the induction machine drive system
Controls
In the controller part, the measurements of the DC-link voltage and the stator currents are imported by Analog In blocks. The mechanical angular speed of the rotor is obtained from the Quadrature Encoder Counter block, which converts the orthogonal digital pulses.
Rotor-field oriented control is applied to the drive system and the basic structure is shown in Fig. 3, where the stator current is regulated in the dq frame.
The voltage reference generated in dq-frame is converted to abc-frame, and then passes through a 3-Phase Index-Based Modulation block to generate three-phase modulation indices. Inside the 3-Phase Index-Based Modulation block mask dialog, one can choose the simple Sinusoidal PWM or other Space Vector PWM modulation methods.
Fig. 3 Controller model of the induction machine drive system
Fig. 4 shows the equivalent circuit of the induction machine in the dq frame, which rotates synchronously with the rotor flux. The values of \(L_{\mathrm{M}}\), \(L_{\mathrm{\sigma S}}\) and \(R_{\mathrm{R}}\) are calculated from the original machine parameters, which can be found in the initialization commands of the model, (see Note above in Section Overview).
Fig. 4 Equivalent circuit of the induction machine in the dq frame
The PI controllers for the d and q axis currents are included in the subsystem “PI”, as shown in Fig. 5. The proportional and integral gains are designed following the “Optimum Magnitude” method, which is described in more detail in the “Boost Converter” demo model of the RT Box Target Support Package.
Fig. 5 PI controller in the dq frame
To avoid the use of an embedded flux sensor, a magnetic flux estimator introduced on page 322 of [1] is employed in the subsystem “\(\Psi_{\mathrm{r}}\) esti.”. Making use of the measured mechanical angular speed \(\omega_{\mathrm{m}}\), the stator current is transformed into the rotor reference frame (RRF) as \(\vec{I}_{\mathrm{s, xy}}\). The rotor flux \(\vec{d\Psi}_{\mathrm{r, xy}}\) in the RRF is governed by the differential equation below:
Following the differential equation, \(\vec{d\Psi}_\mathrm{r, xy}\) can be calculated using \(\vec{I}_\mathrm{s, xy}\) as the input. Processing the “x” and “y” components of the rotor flux in the RRF by a Rectangular to Polar transformation block, yields the slip angular position. Summing up the slip angular position and the rotor electrical angular position, one can obtain the rotational flux angular position \(\theta_\mathrm{e}\). \(\theta_\mathrm{e}\) is further used to transform the stator currents from the abc frame to the dq frame. The structure of the rotor flux estimator is demonstrated in Fig. 6.
Fig. 6 Structure of the rotor flux estimator
The current reference in the dq frame is converted from the torque and flux reference by the subsystem “Transform”.
Simulation
This model can run both, in offline mode on a computer or in real-time mode on the PLECS RT Box. For the real-time operation, one RT Box (referred to as “Plant + Controller”) needs to be set up as demonstrated in Fig. 7.
Fig. 7 Hardware configuration for the real-time operation of the demo model
Please follow the instructions below to run a real-time model on a single RT Box:
Connect the Analog Out interface to the Analog In interface with one DB37 cable, and the Digital Out interface to the Digital In interface with another DB37 cable (as shown in Fig. 7).
From the System tab of the Coder options… window, select the “Plant + Controller” subsystem and Build it onto the RT Box.
Once the model is uploaded, from the External Mode tab of the Coder options… window, Connect to the RT Box and Activate autotriggering.
Note
On the plant side, both the “En SafeState” and the “Rst SafeState” Switches are set to false. These signals are output via DO-9 and DO-10, respectively, and are received by the “Controller” task in the Powerstage Protection block (DI-9) and the “reset” Digital In block (DI-10), provided that a DB37 cable is connected between the RT Box digital output and digital input ports.
At the start of a simulation, the Powerstage Protection block is in the safe state. This brings all PWMs into the corresponding safe state, as specified under the Protection tab of the PWM Out block. Normal operation is resumed by a rising edge on the Powerstage Protection block ‘en’ input. In offline simulation mode (Simulation + Start), the rising edge is generated after \(0.1\,\mathrm{s}\) by a Step signal applied to the “reset” Digital In block. When the model is executed in real time on an RT Box with external mode connected, normal operation is started by toggling the “Rst SafeState” Switch in the plant from false to true. This action generates a rising edge on the “reset” Digital In (DI-10).
To trip the Powerstage Protection, set the “En SafeState” Switch from false to true. To exit the safe state, first return “En SafeState” to false, then toggle “Rst SafeState” from false to true to resume normal operation. Simultaneously, the Powerstage Protection block ‘enable’ output resets the integral part of the PI controller.
For more detailed explanation, please refer to the Help page of the Powerstage Protection block.
The stator current, rotational speed and electrical torque are shown in the scope of the plant side. In the XY plot \(\Psi_{\mathrm{r}}\) the rotor flux is displayed and it should be a circle in steady-state operation. To observe a transient behavior of the system, e.g. a step change of the torque reference from \(100\,\mathrm{Nm}\) to \(200\,\mathrm{Nm}\), please further follow the scenario below:
Make sure that the External Mode and Activate autotriggering of the RT Box is enabled.
Switch the Trigger channel parameter to
[Electrical torque]in the External Mode tab of the subsystem’s Coder options… window.Setup the Trigger level parameter to be \(150\) and Trigger delay [steps] to be \(-50000\).
Change the Constant block “\(T_\mathrm{e}\)” in the “Controller” task from the default value of \(100\) to \(200\).
The step change will be captured by the scope on the plant topology, as shown in Fig. 8.
Fig. 8 Transient response of a step change of the torque reference in the controller task
Conclusion
This model demonstrates an induction machine drive system which can run in both offline simulation and real-time operation for Hardware-in-the-loop testing and rapid control prototyping.
Bibliography
[1]
R. De Doncker, D. Pulle and A. Veltman, “Advanced electrical drives”, Springer, 2011