In this section you
Use electrical machines and power electronics to simulate a simple AC motor drive with variable speed control
Learn how to use the Universal Bridge block
Discretize your model and compare variablestep and fixedstep simulation methods
Learn how to use the Multimeter block
Learn how to use the FFT tool
Variable speed control of AC electrical machines makes use of forcedcommutated electronic switches such as IGBTs, MOSFETs, and GTOs. Asynchronous machines fed by pulse width modulation (PWM) voltage sourced converters (VSC) are nowadays gradually replacing the DC motors and thyristor bridges. With PWM, combined with modern control techniques such as fieldoriented control or direct torque control, you can obtain the same flexibility in speed and torque control as with DC machines. This section shows how to build a simple open loop AC drive controlling an asynchronous machine. Chapter 4 will introduce you to a specialized library containing models of DC and AC drives. These "ready to use" models will enable you to simulate electric drive systems without the need to build those complex systems yourself.
The Machines library contains four of the most commonly used threephase machines: simplified and complete synchronous machines, asynchronous machine, and permanent magnet synchronous machine. Each machine can be used either in generator or motor mode. Combined with linear and nonlinear elements such as transformers, lines, loads, breakers, etc., they can be used to simulate electromechanical transients in an electrical network. They can also be combined with power electronic devices to simulate drives.
The Power Electronics library contains blocks allowing you to simulate diodes, thyristors, GTO thyristors, MOSFETs, and IGBT devices. You could interconnect several blocks together to build a threephase bridge. For example, an IGBT inverter bridge would require six IGBTs and six antiparallel diodes.
To facilitate implementation of bridges, the Universal Bridge block automatically performs these interconnections for you.
PWM Control of an Induction Motor
Follow these steps to build a PWMcontrolled motor.
Open a new window and save it as power_PWMmotor
.
Open the Power Electronics library and copy the Universal Bridge block into your model.
Open the Universal Bridge dialog box and set its parameters as follows:
Power electronic device 
 
Snubber  
Rs 
 
Cs 
 
Ron 
 
Forward voltages  
Vf  0 V  
Vfd 
 
Tail  
Tf 
 
Tt 

Notice that the snubber circuit is integral to the Universal
Bridge dialog box. As the Cs capacitor value of the snubber is set
to Inf
(shortcircuit), we are using a purely resistive
snubber. Generally, IGBT bridges do not use snubbers; however, because
each nonlinear element in Simscape™ Power Systems™ software is modeled
as a current source, you have to provide a parallel path across each
IGBT to allow connection to an inductive circuit (stator of the asynchronous
machine). The high resistance value of the snubber does not affect
the circuit performance.
Open the Machines library. Copy the Asynchronous Machine SI Units block into your model.
Open the Asynchronous Machine dialog box and set its parameters as follows:
Nominal power, voltage (lineline), and frequency 

Stator resistance and inductance 

Rotor resistance and inductance 

Mutual inductance 

Inertia constant, friction factor, and pole pairs 

Setting the nominal power to 3*746 VA and the nominal linetoline voltage Vn to 220 Vrms implements a 3 HP, 60 Hz machine with two pairs of poles. Its nominal speed is therefore slightly lower than the synchronous speed of 1800 rpm, or w_{s}= 188.5 rad/s.
Notice that the Rotor type parameter
is set to Squirrel cage
, and
therefore the three rotor terminals a
, b, and c
are
not accessible, because during normal motor operation these terminals
should be shortcircuited together.
Connect a Bus Selector block at the measurement output of the machine. When this block is connected to a machine measurement output, it allows you to access specific internal signals of the machine. Select the following signals: Stator measurements.Stator current is_a (A), Mechanical.Rotor speed (wm), and Mechanical.Electromagnetic troque Te (N*m).
You now implement the torquespeed characteristic of the motor load. Assume a quadratic torquespeed characteristic (fan or pump type load). The torque T is then proportional to the square of the speed ω.
$$T=k\times {\omega}^{2}$$
The nominal torque of the motor is
$${T}_{n}=\frac{3\times 746}{188.5}=11.87\text{}Nm$$
Therefore, the constant k should be
$$k=\frac{{T}_{n}}{{\omega}^{2}}=\frac{11.87}{{188.5}^{2}}=3.34\times {10}^{4}$$
Open the UserDefined Functions library
of Simulink^{®} and copy the Fcn block into your model. Open the
block menu and enter the expression of torque as a function of speed: 3.34e4*u^2
.
Connect the input of the Fcn block to
the torque input of the motor, labeled Tm
.
Open the Electrical Sources library and copy the DC Voltage Source block into your model. Open the block menu and set the voltage to 400 V.
Open the Measurements library and copy a Voltage Measurement block into your model. Change the block name to Vab.
Using a Ground block from the Elements library, complete the power elements and voltage sensor interconnections as shown in PWM Control of an Induction Motor.
To control your inverter bridge, you need a pulse generator. Such a generator is available in the Control and Measurements/Measurements library:
Open the Control and Measurements/Pulse & Signal Generators blocks library and copy the PWM Generator (2Level) block into your model. The converter operates in an open loop, and the three PWM modulating signals are generated internally. Connect the P output to the pulses input of the Universal Bridge block
Open the PWM Generator (2Level) block dialog box and set the parameters as follows.
Generator type 

Mode of operation 

Carrier frequency 

Initial Phase 

Minumum and maximum values 

Sampling technique 

Internal generation of reference 

Modulation index 

Reference signal frequency 

Reference signal phase 

Sample time 

The block has been discretized so that the pulses change at multiples of the specified time step. A time step of 10 µs corresponds to +/ 0.54% of the switching period at 1080 Hz.
One common method of generating the PWM pulses uses comparison of the output voltage to synthesize (60 Hz in this case) with a triangular wave at the switching frequency (1080 Hz in this case). The linetoline RMS output voltage is a function of the DC input voltage and of the modulation index m as given by the following equation:
$${V}_{LLrms}=\frac{m}{2}\times \frac{\sqrt{3}}{\sqrt{2}}Vdc=m\times 0.612\times VDC$$
Therefore, a DC voltage of 400 V and a modulation factor of 0.90 yield the 220 Vrms output linetoline voltage, which is the nominal voltage of the asynchronous motor.
You now add blocks measuring the fundamental component (60 Hz) embedded in the chopped Vab voltage and in the phase A current. Open the Control and Measurements library of the simscapepowersystems_ST library and copy the Fourier block into your model.
Open the Fourier block dialog box and check that the parameters are set as follows:
Fundamental frequency 

Harmonic n 

Initial input 

Sample time 

Connect this block to the output of the Vab voltage sensor.
Duplicate the Fourier block. To measure the phase A current, you connect this block to the Stator current is_a output of the Bus selector block.
Stream these signals to the Simulation Data Inspector: the Te, ias, and w signals of the measurement output of the Asynchronous Machine block, and the VAB voltage.
Open the Simulation > Configuration
Parameters dialog box. Select the ode23tb
integration
algorithm. Set the relative tolerance to 1e4
,
the absolute tolerance and the Max step size to auto
,
and the stop time to 1 s
. Open the Simulation
Data Inspector and look at the signals.
The motor starts and reaches its steadystate speed of 181 rad/s (1728 rpm) after 0.5 s. At starting, the magnitude of the 60 Hz current reaches 90 A peak (64 A RMS) whereas its steadystate value is 10.5 A (7.4 A RMS). As expected, the magnitude of the 60 Hz voltage contained in the chopped wave stays at
$$220\times \sqrt{2}=311\text{}V$$
Also notice strong oscillations of the electromagnetic torque at starting. If you zoom in on the torque in steady state, you should observe a noisy signal with a mean value of 11.9 N.m, corresponding to the load torque at nominal speed.
If you zoom in on the three motor currents, you can see that all the harmonics (multiples of the 1080 Hz switching frequency) are filtered by the stator inductance, so that the 60 Hz component is dominant.
PWM Motor Drive; Simulation Results for Motor Starting at Full Voltage
The Universal Bridge block is not a conventional subsystem where all the six individual switches are accessible. If you want to measure the switch voltages and currents, you must use the Multimeter block, which gives access to the bridge internal signals:
Open the Universal
Bridge dialog box and set the Measurement parameter
to Device currents
.
Copy the Multimeter block from the Measurements library into your circuit. Doubleclick the Multimeter block. A window showing the six switch currents appears.
Select the two currents of the bridge arm connected to phase A. They are identified as
iSw1 

iSw2 

Click Close. The number of signals (2) is displayed in the Multimeter icon.
Send the signal from the Multimeter block to the Simulation Data Inspector.
Restart the simulation. The waveforms obtained for the first 20 ms are shown in this plot.
Currents in IGBT/Diode Switches 1 and 2
As expected, the currents in switches 1 and 2 are complementary. A positive current indicates a current flowing in the IGBT, whereas a negative current indicates a current in the antiparallel diode.
Note Multimeter block use is not limited to the Universal Bridge block. Many blocks of the Electrical Sources and Elements libraries have a Measurement parameter where you can select voltages, currents, or saturable transformer fluxes. A judicious use of the Multimeter block reduces the number of current and voltage sensors in your circuit, making it easier to follow. 
You might have noticed that the simulation using a variablestep integration algorithm is relatively long. Depending on your computer, it might take tens of seconds to simulate one second. To shorten the simulation time, you can discretize your circuit and simulate at fixed simulation time steps.
Open the Powergui, click Configure Parameters,
and in the Powergui block parameters dialog box set Simulation
type to Discrete
. Set the Sample time to 10e6
s.
When you restart the simulation, the power system, including the asynchronous
machine, is discretized at a 10 µs sample time.
As there are no more continuous states in the electrical system,
you do not need a variablestep integration method to solve this system.
In the Simulation > Configuration Parameters
> Solver dialog box
pane, select the Fixedstep
and Discrete
(no continuous states)
options.
Start the simulation. Observe that the simulation is now faster than with the continuous system. Results compare well with the continuous system.
The two Fourier blocks allow computation of the fundamental component of voltage and current while simulation is running. If you would like to observe harmonic components also you would need a Fourier block for each harmonic. This approach is not convenient.
Now use the FFT tool of Powergui to display the frequency spectrum of voltage and current waveforms. These signals are stored in your workspace in the ASM structure with time variable generated by the Scope block. Because your model is discretized, the signal saved in this structure is sampled at a fixed step and consequently satisfies the FFT tool requirements.
Open the Powergui and select FFT Analysis. A new window opens. Set the parameters specifying the analyzed signal, the time window, and the frequency range as follows:
Structure 

Input 

Signal number 

Start time 

Number of cycles 

(pulldown menu)  Display FFT window 
Fundamental frequency 

Max Frequency 

Frequency axis 

Display style 

The analyzed signal is displayed in the upper window. Click Display. The frequency spectrum is displayed in the bottom window, as shown in the next figure.
FFT Analysis of the Motor LinetoLine Voltage
The fundamental component and total harmonic distortion (THD) of the Vab voltage are displayed above the spectrum window. The magnitude of the fundamental of the inverter voltage (312 V) compares well with the theoretical value (311 V for m=0.9).
Harmonics are displayed in percent of the fundamental component. As expected, harmonics occur around multiples of carrier frequency (n*18 + k). Highest harmonics (30%) appear at 16th harmonic (18  2) and 20th harmonic (18 + 2).
Finally, select input Ia instead of Vab and display its current spectrum.