DSP Based Electric Drives Laboratory: User Manual
DSP Based Electric Drives Laboratory: User Manual
USER MANUAL
iii
7.4 RUNNING THE EXPERIMENT ...........................................................................................69
7.5 LAB REPORT ..................................................................................................................72
7.6 REFERENCES ..................................................................................................................72
EXPERIMENT – 8 V/F SPEED-CONTROL OF A THREE-PHASE INDUCTION
MOTOR .................................................................................................................................73
8.1 INTRODUCTION ..............................................................................................................73
8.2 REAL-TIME IMPLEMENTATION .......................................................................................74
8.3 CREATING THE LAYOUT .................................................................................................75
8.4 RUNNING THE EXPERIMENT ...........................................................................................76
8.5 LAB REPORT ..................................................................................................................78
EXPERIMENT – 9 PERMANENT MAGNET AC (PMAC) MOTOR ........................79
9.1 INTRODUCTION ..............................................................................................................79
9.2 REAL-TIME IMPLEMENTATION .......................................................................................79
9.3 RUNNING THE EXPERIMENT ...........................................................................................86
9.4 LAB REPORT ..................................................................................................................88
APPENDIX – A SAFETY PRECAUTIONS AND POWER-ELECTRONICS-
DRIVES-BOARD FAMILIARIZATION .........................................................................89
1.1 WHY IS SAFETY IMPORTANT? ........................................................................................89
1.2 POTENTIAL PROBLEMS PRESENTED BY POWER ELECTRONIC CIRCUITS.........................89
1.3 SAFETY PRECAUTIONS TO MINIMIZE THESE HAZARDS ...................................................90
1.4 POWER-ELECTRONICS-DRIVES-BOARD FAMILIARIZATION ..........................................93
iv
Experiment-1
Introduction to the DSP-based
Electric-Drives System
1.1 Introduction
There are four major components of the DSP-based electric-drives system, which will be
used to perform all the experiments in this course. They are as follows: 1) Motor coupling
system, 2) Power Electronics Drive Board, 3) DSP based DS1104 R&D controller card and
CP 1104 I/O board and 4) MATLAB Simulink and Control-desk. In this experiment, you
will be briefly introduced to the role of abovementioned four components in the DSP-based
electric-drives system. An example of speed-control of a DC-motor will be demonstrated.
The Simulink file and Control-desk layout will be supplied to perform this experiment. The
communication between the four components will be explained while controlling the speed
of the motor. Section 1.2 details the DSP-based electric-drives system vis-à-vis the role of
the four components listed above. In Section 1.3 a step-by-step procedure to run the DC
motor speed-control will be performed.
• Motor coupling system: This system contains the motor that needs to be
characterized or controlled. The system has a mechanical coupling arrangement to
couple two electric machines. The motor under test or whose speed/torque needs to
be controlled, could be either a DC motor or Three-phase induction motor or Three-
phase permanent-magnet AC (PMAC) motor. The system also has an encoder
mounted on the machine which is used to measure the speed of the machine. This
can be used for close loop feedback speed-control of the motor. The motor demands
a controlled pulse-width-modulated (PWM) voltage to run at controlled speed or
torque. The PWM voltage is generated by Power Electronics Drive Board (briefed
1
next); the voltage source thus generated is connected to the motor coupling system
as shown in Fig 1.1.
42 V DC Power
Supply
CURR A1 CURR B1 VOLT DC CURR A2 CURR B2
MATLAB-
Simulink +42 V Power Electronics Drive Board
A1 B1 C1 A2 B2 C2
• Power Electronics Drive Board: This board has the capability to generate two
independent PWM voltage sources (A1B1C1 and A2B2C2) from a constant DC
voltage source (see Fig). Hence two machines can be controlled independently for
independent control variables, at the same time. This board also provides the motor
phase currents, dc-bus voltage etc. to control the motor for a desired speed or
torque. To generate the controlled PWM voltage source, this board requires various
digital control signals. These control signals dictates the magnitude and phase of the
PWM voltage source. They are generated by the DS1104 R&D Controller board
inside the computer.
• DS1104 R&D controller Board and CP 1104 I/O board: In each discrete-time-step,
the DS1104 controller board takes some action to generate the digital control
signals. The type of action is governed by what we have programmed in this board
2
with the help of MATLAB-Simulink real-time interface. This board monitors the
input (i.e. motor current, speed, voltage etc) with the help of CP1104 I/O board in
each discrete-time step. Based on the inputs and the variables that need to be
controlled (i.e. motor speed or torque); it takes the programmed action to generate
the controlled digital signals. The CP1104 I/O board is an input-output interface
board between the Power Electronics Drive Board and DS1104 controller board. It
takes the motor current, dc-voltage etc. from the Power Electronics Drive Board
and also, speed signal (from encoder) from motor coupling system, to the DS1104
controller board. In turn, the controlled digital signals supplied by DS1104
controller board are taken to the Power Electronics Drive Board by CP1104.
3
DS1104 board via CP 1104. The requirement of feeding back phase-current and speed of
the motor will be studied in experiment-4. For now, assume that theses two quantities are
required to control the speed of DC motor. Perform the following steps to run the
experiment. The communication between the four components (explained in section 1.2) is
detailed in each step, wherever necessary.
ADC 5 CP 1104
From
ENCODER
INC 1
Input
+12 V
Digital I/O
Control-desk GND
42 V DC Power
Supply
CURR A2
MATLAB-
Simulink Power Electronics Drive Board
+42 V
A2 B2
To INC 1
(on CP 1104)
Computer
ENCODER
_ _
• Connect the circuit as shown in Fig 1.2. You are given with files Exp1.mdl
(Simulink control-system file) and Exp1.lay (control panel in Control-desk).
Create a new folder on desktop as Exp1 and bring these two files into that folder.
Open MATLAB Simulink and set the folder Exp1 as the path of the current
working directory. Verify in the command window for the correct path (Fig
1.3).Open the Simulink file Exp1.mdl as shown in Fig 1.3.
4
Fig 1.3 Opening the Simulink file Exp1.mdl, changing the path of current working directory
• The Simulink file Exp1.mdl will look as shown in Fig 1.4. Open the simulation
parameters from the tools menu and set the parameters as shown in Fig 1.4. The
fixed step size is the same as the discrete-step, which will be used by the DSP
DS1104. This means that in every “discrete-step” the whole program (i.e. control-
system in this case) will be executed, I/O data will be exchanged and the decision
making will be done inside DS1104.
• Press CTRL+B to build the control-system in real-time now. Refer to Fig 1.5, note
the sequence: 1) Compilation of C-code that is generated by Simulink, which will
be used to implement control-system in hardware DS1104, 2) Generation of
Exp1.sdf file, which will be used later on by Control-desk, to access the variables of
control-system.
5
Fig 1.4 Simulink file Exp1.mdl, setting the simulation parameter
6
• Check the folder Exp1; this should contain the file Exp1.sdf in addition to the other
system files. Leave them as such for the proper operation of Control-desk. Open
Control-desk by double clicking on the dSPACE Controldesk icon. The icon
should be located on the desktop of the computer; the opened control-desk is shown
in Fig 1.6 (ignore the lower panel window shown in Fig. 1.6 at this moment, and
also the pop-up window showing Exp1.lay). Click File->Open Variable File. A
pop-up window will appear, locate the Exp1.sdf file in the directory Exp1 and click
Open. Now you should be able to see the lower panel window shown in Fig 1.6.
Click File->Open, the pop-up window will appear again asking for layout file this
time. Locate the file Exp1.lay as shown in Fig 1.6 and click Open. Click yes if a
pop-up box opens asking for data-connection. The layout thus opened should look
as shown in Fig. 1.7. At this stage the control panel of the control-desk is ready to
communicate or transfer data with DS1104 via CP1104. Click Start (PLAY) and
switch to the Animation mode. The motor will start running. It will rotate in the
positive direction for some-time and in the negative direction for some time, i.e. the
direction of rotation alternates. Right click on the graph and select edit capture
setting, set the capture setting as shown in Fig 1.8.
7
Fig. 1.7 Control panel layout
Fig. 1.8 Various control buttons, starting and stopping the system
8
• You should be able to observe the speed of the motor on control panel (Fig. 1.8).
The waveform for motor phase current, reference speed and actual speed is also
shown. Press the button Edit mode and then press STOP. Take the waveform as
shown in Fig 1.9. Study the explanations detailed next. The control-desk is able to
access the following data with the help of Exp1.sdf file:
o Actual Speed of the motor from W_mech subsystem which is inside the
Simulink control-system. You can open the subsystem W_mech; you will
observe how the input port INC1 (DS1104ENC_POS_C1) of CP 1104 is
utilized to read the actual speed of the motor. In the actual system, this port
is connected (hardwired) to DS1104 though. But, this port is also a part of
Simulink control-system; hence it will be listed as a variable inside the
Exp1.sdf. Since the control-desk has access to the variables of control-
system through Exp1.sdf, hence the control-desk can read the port INC1,
modify the data and send it back to any of the output port of CP 1104, if
necessary.
o Motor current, reference speed and actual speed can be observed in the
same manner, the communication among components is same as explained
above.
9
1104, which is connected to the Power-Electronics-Drives-Board (for
current feedback) and Motor coupling system (for speed feedback).
o The motor will receive the PWM voltage at its terminals and hence start
rotating. It will speed up; the current in the winding will increase. Since the
speed and the current of the motor thus increased are fed back to DS1104 in
real-time, the DS1104 will take the next action as per control-system.
DS1104 will change the pattern of digital signal to change the speed of the
motor such that the motor will achieve the speed as commanded in the
control-system (block Wref_4quad). Note that, the speed command in
control-system is alternating; hence the motor alternates its direction of
rotation. The instantaneous motor speed and current is shown in Fig 1.8.
Fig. 1.9 Motor actual speed (red), reference speed (green) and phase current (blue)
10
1.4 Lab Report and Reading assignment
• List the sequence of events i.e. the communication between the four major
components when STOP button is pressed in the control panel.
11
Experiment – 2
Simulation and Real-time
Implementation of a Switch-
mode DC Converter
2.1 Introduction
In the previous experiment, a demonstration highlighting various components of the
electric drives laboratory was performed. Real-time simulation file (*.mdl) and a Control-
desk layout file (*.lay) were provided.
The switching power-pole building block has been explained in Section 1-6-1 of [1].
Depending on the position of the bi-positional switch, the output pole-voltage v A is either
Vin or 0. The output pole-voltage of the power-pole is a switching waveform whose value
alternates between Vin and 0 depending on the pole switching function q A . The average
output voltage v A of the power-pole can be controlled by controlling the pulse width of the
12
Tup
vA = Vin = d AVin (1)
Ts
Tup → pulse-width of q A
Ts → switching time period
As seen in section 2.2.1, in order to control the average output voltage of the switching
power-pole, the pulse width of the pole switching function q A needs to be controlled. This
vcntrl , a is compared with a triangular waveform vtri of time period Ts . Switching signal
vaN
vcntrl , a = (3)
Vd
where vaN = v A = average pole-output voltage with respect to negative DC-bus voltage.
voltages.
13
To achieve both positive and negative values of vo , a common-mode voltage equal in
given by:
Vd vo
vaN = + (5)
2 2
V v
vbN = d − o (6)
2 2
1 1 vo
d a = vcntrl ,a = + (7)
2 2 Vd
1 1 vo
db = vcntrl ,b = − (8)
2 2 Vd
• Type “simulink” at the command prompt and create a new model from File menu.
• In the Library Browser expand the Simulink tree and click on Sources. Drag and
drop the Repeating Sequence block into your model.
14
the blocks. Double click on the Repeating Sequence block and edit the properties as:
Where “fsw” is the switching frequency set as a global variable in the Matlab prompt.
• Connect the output of Repeating Sequence block to the input of the Scope.
• Type the value of “fsw” at the Matlab prompt, fsw = 10000 (Switching frequency:
10 kHz)
• The simulation model is now ready. However before running the simulation
parameters need to be changed. Go to Simulation menu and select Simulation
Parameters. Set the parameters to the following values:
• Run the simulation by clicking on the triangular button on the top. Double click on the
scope after the simulation finishes. The result should look similar to the one shown in
Fig. 2.1.
For a desired average output pole-voltage vaN , the control voltage vcntrl , a is given by
equation (3). Equation (3) is implemented in Simulink and the control voltage thus
generated is compared with the triangular signal generated in the last part.
15
Fig. 2.1 Triangular Waveform with 10 kHz frequency
The desired voltage vaN is set by a Constant block with value one, and can be varied with
a Slider gain from ‘0’ to the maximum DC-bus voltage Vd ( Vd = 42V in the model). The
control voltage is generated by dividing vaN by Vd . This is done by using a Gain block (of
Comparison of the triangular signal and the control voltage is done using a Relay block.
The triangular signal is subtracted from the control voltage. The Relay block output is then
set to ‘1’, when the difference is positive and ‘0’ when the difference is negative.
• Copy and paste the model of triangular waveform generator from section 2.3.1 (Fig
2.1).
16
o Slider Gain from Simulink → Math Operations.
o Change the value of Gain to 1/ Vd ( Vd will be set to 42V from the command
prompt later).
17
• Rename the blocks and connect them as shown in Fig. 2.2.
• Set the simulation parameters as in section 2.3.1 and save the model.
• Run the simulation and save the waveform for the switching function. (Fig. 2.2)
Equations (7) and (8) describe the control voltages of the two poles A & B depending on
the desired output voltage vo = vab . These equations will be implemented in Simulink (Fig.
2.3). Also, the switching power-poles will be modeled using a Switch. The Relay blocks
provide the switching functions for the poles qa and qb . Depending on the value of the
Create the Simulink model as shown in Fig. 2.3. The Switch block can be found in
Simulink → Signal Routing.
• Set the simulation parameters and values of fsw and Vd as in section 2.3.2. Run the
simulation.
o Simulation results of two pole converter model for two different values of
V_ab, one positive and one negative.
18
Fig 2.3 Two Pole Switch-Mode Converter Model in Simulink
19
dSPACE provides a block called DS1104SL_DSP_PWM3, which embeds the triangular
waveform generator and the comparator for all converter poles. The inputs for
DS1104SL_DSP_PWM3 are the duty-ratios for the poles. In Fig. 2.3, the lower part of the
model is called the Duty Ratio Calculator. This part of the model will again be used in the
real-time model to generate the pole duty ratios. The triangular wave generator and
comparison using relays will be replaced by DS1104SL_DSP_PWM3, as these functions
are internal to the block. Two legs of the drives board (refer appendix ‘A’) will replace the
two poles (modeled using the Switches in Simulink).
• Create the real-time model as shown in Fig. 2.4. Use the Duty Ratio Calculator from
section 2.3.3.
• For the DS1104SL_DSP_PWM3 block, set the switching frequency as 10000 Hz and
the dead-band to ‘0’.
• Open the simulation parameters. Change the stop-time to inf, fixed step size to 0.0001
and turn block reduction OFF.
20
Once the real-time model is ready, it can be implemented on the DSP of DS1104 by
building the model. As explained in experiment-1 building the model will broadly cause:
2. Generation of a variable file (with extension .sdf) that allows access to the variables
and signals in the real-time Simulink model.
• Build the Simulink model by pressing (CTRL+B). Observe the sequence of events in
the Matlab command window.
• Once the real-time model is successfully built, open Control Desk (icon on PC
Desktop).
• Using the File menu, create a New Experiment and save it in the same working root
as the real-time Simulink model. Create a New Layout using the File menu again.
Two new windows will appear in the Control Desk workspace. The one called
Layout1, will contain the instruments used for managing the experiment. The
second window is a library which will let us drag and drop the necessary controls for
the experiment into the Layout.
• Now, select File>Open Variable File. Browse to the directory containing the real-
time Simulink model. Open the .sdf file (E.g. For Simulink model named
twopole.mdl, the variable file will be twopole.sdf).
• After opening the variable file, notice that a new tab in the lower window called
Variable Manager appears below the layout (Fig 2.5). The variables of the real-time
Simulink model file are under the tree Model Root. Expand Model Root, observe
the variables and relate them with the real-time Simulink model.
21
Fig 2.5 New Layout Window for Instrumentation and Control
• Now a user-interface that allows us to change input variables & system parameters
(in real-time) and also observe signals will be created. The input variable in this
experiment is the output voltage of the switch-mode converter. The duty ratios
generated by the Duty Ratio Calculator will be the signals that will be observed in
the layout. The actual pole voltages will be observed directly from the power
electronics drives board using an oscilloscope.
• In order to change the reference output voltage and observe the duty ratios, suitable
parts need to be added to the layout. These parts are available in the window to the
right of the layout. The output voltage reference V_AB will be set using a Slider and
a Numerical Input. Both these parts are found under Virtual Instruments. Drag
22
and drop these parts in the layout. The duty ratios will be observed in a Plotter
available in Data Acquisition. Select Plotter and draw it in the layout.
• Now appropriate variables will be assigned to the parts. Under Model Root, locate
V_AB and select it. It will have a parameter called Value (right side panel) which
corresponds to the value of the Constant block V_AB in the real-time Simulink
model. Drag and drop V_AB/Value into the Slider and also on Numerical Input
one-by-one. Now, the value of V_AB can be changed in real-time using these two
parts. Similarly, to observe the duty ratios in real-time, assign the two outputs (Out1
and Out2) of the De-mux (the one following the Gain2 block) to the plotter. The
experiment is now ready, it should look as shown in Fig 2.6. Start the experiment by
clicking the Start button and select the animation mode (Fig 1.8)
• Turn the power supply ON and observe the pole-voltages on the oscilloscope. Vary
the output voltage reference (V_AB) using the Slider or the Numerical Input.
Observe the changing duty-ratios and pulse-widths of the pole-voltages.
23
2.5 Lab Report
• Record the output voltage waveform on the oscilloscope for the values of V_AB set
in section 2.4.
• Record the corresponding duty ratio waveforms for the above values.
• Measure the output voltage frequency and comment on the result obtained (Hint:
relate the frequency set in the PWM block to the frequency of the voltage observed
on the oscilloscope).
2.6 References
[1] “FIRST COURSE ON Power Electronics” by Ned Mohan, 2005, MNPERE.
24
Experiment – 3
No-Load DC Motor Test
3.1 Introduction
The output voltage control of a two-pole DC-Switch-mode-converter was implemented in
real-time, in the last experiment. The purpose of the real-time implementation was to obtain
a variable DC-voltage at the output of the power converter, while controlling its amplitude
with a dSPACE-based Control-desk user interface. In this experiment, a DC-motor will be
connected to the output of the power converter. With this arrangement, a variable voltage
can be applied to the terminals of the DC-motor. We will observe that by changing the
magnitude of the applied voltage, the speed of the motor can be varied. This is also referred
as open-loop voltage controlled DC-motor. At the end of the experiment we will make a
case for open-loop control and also for the characterization of DC-motor, which will be
done in the next experiment.
Before starting the implementation of the model, for control of the DC Motor in open-loop,
connect the armature of the DC-motor under test to the output of two converter poles A and
B. Connect the CURR. A1 (phase-current measurement port) on the drives board to the
Channel ADCH5 of CP 1104 I/O board. Also, connect the encoder output (mounted on
the DC-motor) to the INC1 9-pin DSUB connector on CP 1104 I/O board.
The speed of a DC-motor can be changed by varying its supply voltage. The model of
output voltage control of the switch-mode dc converter was discussed in experiment – 2
and the same will be used.
• Copy the model from experiment-2 and save the new model.
25
• Change the name of the Constant block from V_ab to V_motor; this will be the
input voltage of the DC-motor.
• The current and speed measurement blocks need to be added to the existing model.
For measuring the current, Channel 5 of the A/D converter (ADCH5) on CP 1104 will be
used. Remember that the data have to be scaled by a factor of 10. In addition, the current
sensor outputs 1V for 2 amps of current; therefore it actually needs to be scaled by 20
(shown in Fig. 3.2).
• Drag and drop the DS1104ADC C5 block from the dSPACE library.
• Connect a Gain block at its output and set its value at 20.
• Connect a Terminator at the output of the Gain block and label the signal as I a .
To measure speed we shall use the DS1104ENC_POS_C1 block from the dSPACE
library. This block provides read access to the delta-position and position of the first
encoder interface input channel. The delta position represents the scaled difference of two
successive position values of a channel. To receive the radian angle from the encoder the
2π 2π
result has to be multiplied with = ; where encoder_lines is 1000 for
encoder _ lines 1000
the encoders used in the laboratory setup.
The delta-position scaled to a radian-angle has to be divided by the sampling time to obtain
the speed, as in:
dθ ∆θ ∆θ
ω= = = (1)
dt tk +1 − tk Ts
26
Drag and drop the DS1104ENC_POS_C1 block from the dSPACE library. In addition the
encoder set-up block DS1104ENC_SETUP is to be added to the model. Connect a
Terminator block to the Enc position. Connect a Gain block at Channel 1 output (i.e. Enc
2π
delta position) and set its value as where Ts is the sampling time set in the
1000Ts
simulation parameters under the fixed-step box. The output of this block is the motor speed
in rad/s.
However at low speeds, there will be oscillations in the measured speed values. Hence an
averaging to get more accurate readings is needed. For preparing the averaging block,
• Select the Unit Delay block from Simulink → Discrete and drag the required
number of blocks into the model (say 10 for 11 point averaging).
• Select the input port In from Simulink → Source library and drag it into your
model.
• Drag a sum block and double click on the sum block and add the required number
of ‘+’ signs in list of signs.
• Drag a Gain block and connect it at the output of Sum block. Set the value to 1/11
for 11 point averaging.
27
Fig. 3.1: Averaging model in Simulink
• Select the output port Out from Simulink → Sink and drag it into the model.
• Select the unit delays, input port, output port, gain and sum blocks together and
create a subsystem. For creating a subsystem, go to Edit menu of your model and
then click Create Subsystem.
• The system obtained is an 11-point averaging system. Change the subsystem name
to Averaging Block.
• The model obtained should look like the one shown in Fig. 3.2. Before building the
real-time model, don’t forget to define Ts and Vd as global variables at Matlab
prompt.
• Start Control-desk and create a new experiment in the same working directory as
that of Simulink file. Load the variable file (*.sdf) into the Control-desk (Refer
experiment-1).
• Create a layout and drag a slider gain control and two plotters.
• Assign one of the plotters for Ia and another one for wm.
28
• In order to record the numerical values of current and speed, add two Displays into
the layout. Drag and drop Ia in one and wm in another.
The experiment should look similar to the one shown in Fig. 3.3.
29
Fig. 3.3 Control Desk Layout
• Record the values of current and speed for different set of readings for the
corresponding voltage values specified in Table. 3.1
3.3 Making the Case for Open-Loop Speed Control and Characterization of DC-
Motor
In steady state, with voltage Va applied to the armature terminal of a DC-motor, following
equation can be written:
30
Va = I a Ra + Ea = I a Ra + k E ω (2)
From equation (2), the armature voltage can be calculated in real-time to run the DC-motor
at a desired speed ω (rad/s). Note that, there is no feedback here, we are calculating the
equivalent amount of voltage that need to be applied, to run the motor at a desired speed.
Hence this type of speed control can be termed as open-loop voltage control. To calculate
the value of Va from equation (2), the value of armature resistance Ra and the back-EMF
constant k E should to be known beforehand. The measurement of Ra and k E will always
carry some error and also, the right hand side of equation (2) is load dependent ( I a ). Hence
in open-loop the accuracy of speed control will be a function of load and measurement
error. In the next experiment, we will characterize the DC-motor to find the value of Ra
and k E , in addition to other parameters. In experiment-5, we will implement a close-loop
control of DC-motor, which can maintain the desired speed independent of load and
measurement errors.
• Plot of voltage vs. speed curve for the no-load operation of DC machine.
• Assume Ra = 1Ω and k E = 0.1V/rad/s . Now using (2), calculate the speed (rad/s) for
each measurement in Table 3.1. Add a new row speed_cal in Table 3.1 and fill the
calculated speeds. By using (3), report the % error for each measurement (add
another row) in Table 3.1.
speed_cal - speed
% error = × 100 (3)
speed_cal
31
Experiment – 4
Characterization of DC Motor
4.1 Introduction
In the earlier experiment, you designed and implemented the switch mode control and no
load measurement of DC-motor along with the current and speed measurement. In this
experiment characterization of a DC-motor will be done, which will be helpful in designing
the closed loop control of DC-motor.
We will be using the Simulink model prepared in the earlier experiment and modify the
same to perform the characterization of DC-motor.
• Open the Simulink model used in the last experiment (Section 3.4).
To this model, appropriate blocks for controlling the active load (a DC-generator whose
electromagnetic torque will be varied) need to be added.
To determine the DC-motor steady state characteristics, a second DC-motor will be axially
coupled to the motor under test (MUT). The second motor will be open-loop voltage-
controlled, similar to the MUT.
32
Fig. 4.1 Real-time Simulink model for motor and load control
• Add a second set of voltage-control blocks in the Simulink model and connect the
duty-cycles to the 2 and 3 inputs of DS1104SL_DSP_PWM.
33
• Double click the DS1104SL_DSP_PWM block, go to PWM Stop and
Termination, uncheck “Set all Ch” and then click on “Set all”.
• Make the load current (CURR. A2) available in the Simulink model by copying the
first current measurement blocks, and then double clicking on DS1104ADC_C5
and changing it to channel 6.
• Save the model as Step1_04.mdl. The model should like the one shown in Fig. 4.1.
• Open Control Desk and create a new experiment in the same working root as the
Simulink file.
• Create a new layout and drag two Slider Gain controls and two Plotters.
• Drag and drop the V_motor and V_load variables to the Slider gains.
• Assign one plotter to display I a and I L (Im and IL in Fig. 4.1) currents and one
• In order to record the numerical values of currents and speed, add three Displays to
the layout and assign them the speed and current variables. The control desk layout
should look like as shown in Fig. 4.2.
34
4.3 Steady-state characteristics of dc-motor drives
In this experiment, you will derive the characteristics of a DC-motor, using the second
motor as load. For a constant V_motor voltage, the load is varied using V_load. The
MOTOR current and speed are recorded in a table. A set of measurements are obtained for
different supply voltages. The characteristics will be drawn using Matlab.
The steady-state mechanical characteristics of a DC-motor are the dependency between the
electromagnetic torque (N-m) and the electrical speed (rad/s). Since the dependency is
linear, the characteristics will be straight lines for the entire voltage range 0 - Vrated and is
35
Vmotor = Ra I a + k Eω (1)
Te = kT I a (2)
From equation (1), one can obtain the steady-state motor characteristic:
Ra V
ω(Ia ) = − I a + motor = mI a + n (3)
kE kE
where
Ra V
m=− and n = motor
kE kE
The steady-state model for the load can be approximated with a friction-type model, where
the torque is proportional to the speed, and a constant friction torque is always present:
Te = TL + Bω + T friction (4)
where all terms in the right hand side are load related. For our setup, where the load is a
voltage controlled DC-machine, the load torque TL is, in fact, the electromagnetic torque
developed by the second DC-motor. The procedure to determine the parameter for the
steady-state model uses the current, voltage and speed measurements to obtain a linear
approximation for both equation (3) and (4). Once the slope and the interception point are
found, the parameters can be easily calculated.
According to the theoretical description from section 4.3.1, the motors will be driven in
several steady-state operating points.
36
Estimation of k E :
• At the rated armature voltage supplying the MOTOR, control the LOAD in the
active region, such that the MOTOR current would become zero ( I a = 0). Measure
Va _ rated
kE = (Va _ rated = 42V ) (5)
ω
• To perform the previous step, increase the V_motor slider gain to 42 V. Now
adjust V_load voltage such that the active torque will decrease the MOTOR current
Im (same as I a ) until it becomes zero.
• Record the values for speed, at Im = 0 and calculate k E as per equation (5).
• Maintain the MOTOR voltage at constant levels {42; 21; 10; 3 V}. Adjust the
LOAD voltage reference such that the MOTOR current takes the following values
at each voltage: {0; 1.0; 2.0; 3.0; 4.0; 5.0 A}.
• Record the speed ( ωm ), the LOAD current (IL) and LOAD voltage (V_load)
required to obtain the specified MOTOR currents. All current measurements will be
multiplied with k E to obtain the corresponding torque values as per equation (2).
• Draw the MOTOR and LOAD characteristics using the data acquired during the
measurement process.
37
Table 4.1: Steady-state Experimental Data
V Motor[V] V Load[V] I Motor[A] I Load[A] Speed[rad/s]
42 0.0
42 1.0
42 2.0
42 3.0
42 4.0
42 5.0
21 0.0
21 1.0
21 2.0
21 3.0
21 4.0
21 5.0
10 0.0
10 1.0
10 2.0
10 3.0
10 4.0
10 5.0
3 0.0
3 1.0
3 2.0
3 3.0
3 4.0
3 5.0
o The slope and the intercept of the linearized characteristic could be determined
with the following instructions:
m = p(1)
n = p(2)
38
o w_data is the array of speed data, while ia_data is the corresponding current
data for the speed.
o Two set of parameters (m, n) are determined for each dc-machine (MOTOR and
LOAD).
• Determine Ra, k E : Using the corresponding m and n, the machine parameters can be
determined using the following equations
Va _ i
ke _ i =
n
k E = avg{ke _ i }
Ra = − ke m
A table for final values of Ra and k E is obtained by averaging the data in TABLE 4.2
For determining the friction parameters, the MOTOR will be run under no-load conditions
as done in the previous experiment. Since the MOTOR has to overcome only friction
( TL = 0 ), the electromagnetic torque ( Te = k E I a ) will follow the linear friction model (see
equation (4)) in steady-state. Fill in the TABLE 4.3 using the values obtained in the earlier
experiment. Linearize the dependency of Te (ω ) by determining the coefficients (m, n)
39
depicted in equation (4) (Use the same procedure as for drawing the torque speed
characteristics).
• Determine B and T friction : Using equation (4), the friction parameters will be
In this section the dynamic characteristics of the DC-motor will be derived. The dynamics can
be divided into electrical and mechanical dynamics. By independently studying both transients,
two motor parameters can be determined: armature inductance ( La ) and moment of inertia (J).
For this section the same Simulink model and dSPACE layout as in earlier section will be used.
To analyze the dynamics of a DC-motor some theoretical background will be presented, then
using the already determined steady-state parameters, the experiment steps will be described.
The setup consists of two DC-motors, axially coupled and supplied from two converters. One
motor is current controlled, such that it will act as an active load. This motor will be named as
LOAD. The second motor (MUT) is open-loop voltage controlled. This motor will be named as
40
MOTOR. In this experiment two parameters need to be determined: La - armature inductance
There are several ways to determine the inductance and the inertia. All methods involve the
dynamic analysis of the machines in transient operation. The dynamic equations of a dc-motor
are:
dia
Va = Ra ia + k Eω + La (6)
dt
dω
Te = TL + T friction + Bω + J (7)
dt
The system of two first order differential equations shows that the DC-motor is a second order
system. The two state variables, armature current ( ia ) and angular speed (ω ) , are not
independent. Therefore, the inductance ( La ) and the moment of inertia (J) would both
contribute to the variation of each of the two state variables. It is convenient to “isolate” the
state variables described in equations (6) and (7), thus only a first-order differential equation
has to be solved for each variable. Two sets of experiments are then required to determine La
and J, while keeping the speed and the current zero respectively.
Inductance Determination:
To estimate the armature inductance, the motor must be held a standstill (ω = 0 ) . If the rotor is
blocked and a step voltage is then applied to the armature terminals, the current increases
exponentially in time and equation (6) becomes:
di
Va = Ra ia + La (8)
dt
41
Solving equation (8) for current,
Va − t
τa
ia = 1 − e (9)
Ra
La
where τ a =
Ra
Va
The current increases exponentially to the final value equal to . The slope of this exponential
Ra
Ra
dia Va Ra − La .0 Va
= e = (10)
dt t =0 Ra La La
A graphical determination of the slope, at a given voltage, would lead to the determination of
the motor inductance ( La ) .
Determination of Inertia
dω
The motor is brought to a no-load steady-state J = 0 speed ω0 , by disconnecting the
dt
load (TL = 0 ) . At this point (t = 0− ) ,
To make electrical torque (Te ) equal to zero in the mechanical dynamics equation (7), a
complete shutdown of the motor supply is required. At (t = 0− ) the whole system is shutdown.
This implies that the electromagnetic torques in the MOTOR (Te ) becomes zero. The dynamic
42
dω
0 = T friction + Bω + J (11)
dt
At (t = 0+ ) i.e. just after shutting down the system, the equation (11) can be written as
dω
0 = T friction + Bω0 + J (12)
dt t =0+
Thus,
dω
By knowing ωo , I a (0− ) and graphically determining the slope of the speed curve
dt t =0+
The model presented in section 4.3 will be used for this section. However, one additional block
has to be inserted, such that a step command in voltage is possible.
Both, electrical and mechanical dynamic parameters require either a positive (from 0 to Va ) or a
The Va = 0 condition implies also that the motors have no armature current ia = 0 . To achieve
43
The IO10/11/12 digital channels will be added as slave bit out blocks for our model from the
slave library. In addition two constant blocks and two Boolean conversion blocks should be
added with SD1 and SD2 using the same signal. The model should like the one shown in Fig.
4.3.
• A new experiment will be created in the same directory containing the Step1_04.mdl
file.
44
• Copy the Layout from the previous experiment and rename it.
• Link all variables from the model with the controls in the Layout, as in earlier section.
45
4.4.4 Dynamical parameters determination
Inductance determination
• Uncheck and then recheck the SD control. This button works as a switch to connect and
disconnect the machines from the power supply.
• Set the V_motor to a low value (around 3 V) and uncheck Reset to give a step input
voltage. The current should increase exponentially (as shown in Fig. 4.6) and reach a
constant steady state value.
• To save the current response, open View/Control bars/Capture Settings Window. Drag
the Reset signal from the Tool Window into the gray box situated below the Level -
Delay set boxes. Check the box called On/Off, check the edge direction, and set the
Level value to 0.5.
• Now, you will observe that every time you uncheck the Reset control in the layout, the
plot area will display the current and it will stop when it reaches the maximum
measurement time. Set the Length to 0.2 (see Fig.4.5). This will set the data capture
time as 0.2s which is large enough to observe the whole transient process in current.
• Check and uncheck SD and Reset to make some measurements. The current waveform
will look similar to the one shown in Fig. 4.6. After you are satisfied with the data
displayed go to the Capture Settings Window and press the SAVE button. The dialog
box will ask you to name the .mat file that will contain the graphic data in all plot areas.
• Plot the .mat file by using MATLAB command “plot” (refer to help by typing help plot
in the command window, if required); determine the inductance value as explained in
section 4.4.1.
46
Inertia determination
• In the Capture Settings Window two modifications must be made: Increase the display
length to 2 seconds and change the Trigger Signal to SD.
• Check the SD control and increase the voltage on the MOTOR to 42 V. Make sure that
the LOAD terminals are disconnected from the Power-Electronics-Drive-Board.
• Record the speed ω0 and armature current Im = I a (0− ) value at this operating point.
• Uncheck the Shutdown button. This will initiate the display process and, after two
seconds, the speed plot will stop and a decreasing exponential curve will be obtained
(see Fig. 4.7).
• Press again the SAVE button in the Capture Settings Window and store the data in
another .mat file. Plot the .mat file using MATLAB command “plot”. Calculate the
value of J as explained in section 4.4.1.
47
Fig. 4.6 Current Waveform
48
4.5 Lab Report
• Provide all the machine parameters which you obtained using the above procedure.
• Provide all the graphs you obtained while finding the machine parameters.
49
Experiment – 5
DC motor Speed Control
5.1 Introduction
In experiment-3, speed of the DC-motor was controlled by using an open-loop voltage control.
The purpose of this experiment is to design and implement a close-loop speed control of a DC-
motor drive. We shall use the same DC-motor for which the parameters were calculated in the
previous experiment. At first, the controllers will be designed and tested on a simulation model
of the DC-motor. Once the parameters are tuned, the model of the DC-motor will be replaced
with the real motor. The tuned controllers will be implemented in real-time on DS1104 to
perform the close-loop speed control of the DC-motor.
Va ( s ) − Ea ( s )
I a (s) = ; Ea ( s ) = k E .ωm ( s ) (1)
Ra + sLa
Tem ( s ) − TL ( s )
ωm ( s ) = ; Tem ( s ) = kT I a ( s ); kT = k E (2)
sJ eq
Equations (1) and (2) can be easily implemented in Simulink using standard blocks as shown in
Fig. 5.1
• Create a new Simulink model and drag all blocks as shown in Fig. 5.1.
• Make the connections and define the parameters as shown in Fig. 5.1.
• The representation in Fig.5.1 uses integrators instead of transfer functions. This allows
setting the initial conditions for the current and speed state variables. The model also
includes the friction coefficient B. However, during simulations, B can be considered
zero, and the model will be similar to the one described by equations (1) and (2). Note
50
that the torque constant is replaced with the voltage constant in the Gain block at the top
of the figure. Create a subsystem by selecting component shown in Fig 5.1 and name it
as DC Machine. The system will look as shown in Fig 5.3 (a).
• Now enter the values of DC-motor parameters which were evaluated in experiment - 4.
You can either built a *.m file and run it, or access the various blocks in Fig 5.1 in the
actual model and replace with the parameter values.
• The model for a PI controller is first created - see Fig.5.2. Double click the integrator
block and enable limit output. Then set the Upper and Lower saturation limits to +lim/-
lim. The lim value should be set to 1 as the absolute maximum value of control voltage
is 1, which is the input to Kpwm block. The resultant maximum value of voltage
applied to the DC motor will be ±42 which is the rating of the DC motor.
51
Fig 5.2 PI controller model
• The parameters of the PI controller (namely Kp_i and Ki_i) are computed using the
motor parameters, which were evaluated in the earlier experiment. This procedure is
described in section 8-7-1 [1].
• The Saturation block sets the maximum and minimum limits for the control voltage (in
our case ±1 ).
• Set the value of Kp_i and ki_i in Matlab prompt. Also set the values of lim = 1, Kpwm
= 42, Ia_ref=1 in Matlab prompt.
Instead of setting the values of various variables in Matlab prompt, create an m-file which
contains the values of all the variables. Run the m-file before running the simulation, which
will load the values of all the variables.
• Running the Simulink model for the current controller with reference current as 1A,
results similar to the Fig.5.3 (b) and Fig. 5.3(c) will be obtained.
• Once the response in current is considered optimal (low overshoot, fast rise-time, zero
steady state error), the speed controller can be designed.
• A similar PI controller for the speed loop will be added to the Simulink model.
• Follow the procedure described in 8-7-2 [1] to design the speed control loop, using the
motor parameters determined in earlier experiment.
52
(a) Simulink model for current control loop
(b) Current waveform for 1A current reference (c) Speed waveform for 1A current reference
Fig 5.3 Simulink model and result for current control loop
53
(a) Simulink model for cascade control
(b) Current waveform for a step change in speed (c) Speed waveform for a step change in speed
54
The Simulink model for the cascade control and the waveforms for speed and current are
shown in Fig.5.4. The Speed PI controller has a current limit output of ±5A, necessary to limit
the current during transients (both in simulation and real-time systems). To check the controller
design, we will give a step change in the speed reference. In the example of Fig.5.4, the speed
is commanded to a step change to 200rad/s at t=0s, then at t=5s it is changed to 450 rad/s. The
above reference speed command is implemented using a constant and step source blocks. The
results of cascade control are shown in Fig. 5.4(b) and Fig. 5.4(c). If the controller parameters
were correctly tuned, then it’s time to go on for the next step, and implement the controllers in a
real-time system.
• Modify the Speed Control block as shown in Fig. 5.5. Change the integrator block
parameters by double clicking on it and changing its external reset to either. Open the
Current Controller and change its integrator’s reset as was done in the Speed Control.
Connect the reset inputs of speed controller and current controller as shown in Fig. 5.5.
These changes allow the integrators to start up correctly in the real-time environment.
55
• Remove the DC-motor mask model and gain Kpwm block.
• Copy and paste the duty-cycle calculator from the Simulink model used in previous
experiments.
• The current and the speed are to be measured. For measurements use the blocks already
designed in previous experiments.
• Replace the speed ref, wm_ref_step and sum block with a constant block for setting the
speed reference.
• At the Matlab prompt, set the sampling time Ts=0.0001 and the dc-bus voltage at
Vd=42V. Also set the values of various variables you have defined in the model.
• Set the simulation parameters with Ts as sampling time and inf as total simulation time.
Now, the model looks like in Fig.5.6.
• Create a new Experiment and set the working root the same as the path for the Simulink
model.
• Run the experiment and compare the real-time results with the simulations.
56
Fig 5.6 Simulink model for real-time implementation of DC motor control
57
Fig 5.7 Control-desk interface for DC motor control
• Why is the bandwidth of the current-control loop much higher than that of the speed-
control loop?
5.6 References
[1] “ELECTRIC DRIVES an integrative approach” by Ned Mohan, 2000, MNPERE.
58
Experiment-6
Four-Quadrant Operation of DC-
motor
6.1 Introduction
In this experiment, the four-quadrant operation of DC-motor will be studied. The four-quadrant
operation is performed by giving an alternating reference-speed command to the DC-motor,
from positive speed (500 r/min) to negative speed (-500 r/min) with a constant ramp. The
speed controller designed in the previous experiment is used to track the instantaneous
reference-speed command. Fig. 6.1 shows the circuit diagram of the system. To keep the same
inertia constant of the system, which was used to design the speed-control-loop in the
experiment-5, another DC-motor is coupled to the DC-motor whose four-quadrant operation is
desired.
42 V DC Power
Supply
59
Switch takes the speed command as per the value of start_4quad_op. Initially, when the
system is ready to run, the value of start_4quad_op is zero. Hence it takes the reference speed
from Wref_start, i.e. at this time the motor is operating in the first quadrant only. The four-
quadrant operation is started by changing the value of start_4quad_op to 1. Follow the steps
below to make the real-time Simulink model.
60
Fig 6.3 Alternating reference speed command
• Speed Measurement: The speed measurement is done in the same way as done in the
previous experiments. Connect a gain block (60/(2*pi)) at the output of averaging block
(see Fig. 6.4) to convert the speed in rad/sec to r/min. Create a sub-system and name it
as Speed Measurement as shown in Fig. 6.4. Also, connect a gain block (2*pi/60)
before feeding the error signal (i.e. the difference of reference speed and actual speed)
to the speed-controller PI_speed.
• PI controllers for current and speed loop: The design of the speed and current
controller was explained in the last experiment. Follow the same procedure to
determine the values of k p and ki . The bandwidth of current control loop should be 1.5
kHz and that of speed loop should be 150 Hz. Add a reset input to the integrator (by
61
choosing the external reset option as “level”, see Fig. 6.5) and check the “limit output”
option in the integrator block. The values of the limit would be the rated-current of the
motor. Also, connect a “saturation” block (the limit would be same as the rated current
of the motor; the block is located at Simulink → discontinuities → saturation) at the
output of the controller. Follow the same procedure for current controller PI_current.
Note that the output limits in this controller would be the rated-voltage of the motor.
• Connect the Duty cycle generation block and DS1104SL_DSP_PWM block as done
in the previous experiments. The whole system should look as shown in Fig. 6.2.
• At the Matlab prompt, set the sampling time Ts = 0.0001 and the dc-bus voltage at Vd =
42V. Also set the values of various variables (like k p and ki ) you have defined in the
62
model. Set the simulation parameters with Ts as sampling time and “inf” as total
simulation time. Build (CTRL+B) the model.
• Start Control Desk and create a new experiment in the same working directory as that
of Simulink file. Open the variable file (*.sdf) for the Simulink model that you built.
Create a new layout and drag the following parts in it: Plotter, Slider, Display and two
Check Boxes. Assign the variables to the parts in the layout as shown in Fig. 6.7.
• Change the Slider properties such that it ranges from 0 to 500 r/min. Right click on the
Plotter and click on “Edit Capture Settings”. Change the capture settings parameter
length to 40.
• In the edit mode, press the play button. Select the Animation Mode and verify that the
Reset and Wref_start Check Boxes are unchecked. Check and uncheck the Reset
Check Box so that the PI integrators are reset.
• Slowly increase the speed reference (Wref_start) to its maximum (500 r/min). Notice
that the DC-motors will start turning. Verify that the Display for Speed Measurement
displays a speed about 500 r/min.
• Observe the Wref_4quad waveform in the Plotter. It should change between -500 to
500 r/min. When this waveform is constant at +500 r/min, check the Wref_start Check
Box. This will make the speed reference for the DC-motor to be the same as the
Wref_4quad waveform. You will now observe that the speed of the DC-motor varies
like the Wref_4quad waveform. When one complete cycle of Wref_4quad is in the
plotter, select the Edit Mode and copy the screen. An example is shown in Fig. 6.7.
63
Fig. 6.7 Output Example
64
Experiment – 7
Characterization of Induction
motor
7.1 Introduction
In this experiment, a three-phase induction motor will be characterized to determine the various
parameters used in its per-phase equivalent circuit (Fig. 7.1). The circuit diagram for this
experiment is shown in Fig 7.2, where a DC motor is coupled to the induction motor under test.
DC resistance test will be done to determine the value of Rs . The magnetizing
inductance ( Lm Lls ) will be calculated by running the induction motor at synchronous speed,
at rated-voltage and rated-frequency. Speed of the DC motor (coupled to the induction motor)
will be controlled, to run the induction motor at synchronous speed. The rotor circuit
parameters i.e. Llr and Rr ' will be calculated by blocked-rotor test while injecting slip
Rs
Lls Llr
Rr '
Vs Lm s
• Create the variable magnitude and variable frequency voltage source: A three-phase
balanced voltage source of variable-magnitude and frequency is required, to run the
induction motor at synchronous and slip-frequency respectively. The duty ratios for the
65
three poles A, B and C to generate this type of voltage source are given in section 4-6-
2[1]. Equations (1-3) are modified form of equations given in [1] which are suitable for
real-time implementation. Create a subsystem in Simulink as shown in Fig. 7.4. Drag
and drop Fcn block from Simulink → user-defined-function → Fcn, to create these
sources. Rename them as dA, dB and dC as shown. Write the equations inside the Fcn
block as shown, which actually corresponds to equations (1-3).
To SCOPE
CP 1104
ADC 5 DAC 1
From
ENCODER
INC 1
+42 V
A1 B1 C1 A2 B2 C2
+
To INC 1
(on CP 1104)
- ENCODER
3-PHASE INDUCTION
MOTOR DC MOTOR
Fig. 7.2 Circuit diagram for the characterization of a three-phase induction motor
vc , A (t ) 1
d A (t ) = 0.5 + ; vc , A (t ) = Vˆc sin(u[2]) (1); u[2] = 2π ft = f × 2π
Vd s
vc , B (t )
d B (t ) = 0.5 + ; vc , B (t ) = Vˆc sin(u[2] − 2π / 3) (2); s → Laplace operator
Vd
vc ,C (t ) Vm ˆ
dC (t ) = 0.5 + ; vc ,C (t ) = Vˆc sin(u[2] − 4π / 3) (3); u[1] = ; Vc = Vm
Vd Vd
66
Fig. 7-3 Simulink block-set for charcterization of a three-phase induction motor
67
o Select_slip_op → Used to select the reference for the magnitude of three phase
voltage, either from Vslip or from a proportional voltage reference (V/f block).
V/f block generates the magnitude, proportional to the required frequency of the
three-phase voltage, which is applied to the induction motor. This reference is
used by duty cycle generation IM block to generate three-phase balanced
voltage source. V/f block also ensure proper starting of induction motor. The
value of gain used in V/f block would be the ratio of rated-peak-phase voltage
to the rated-frequency (Hz) of the induction motor.
• Connect the duty ratio for pole ‘A’ ( d A ) to DAC channel DS1104DAC_C1. The wave-
form of d A and phase ‘A’ voltage will be same, this in conjunction with the input phase
‘A’ current iA , will be used to calculate the power factor and input power to the
induction motor drive.
• Connect the rest of the blocks as shown in Fig. 7.3. Refer to experiment-6 for any
clarification in connecting the remaining blocks. Set the simulation parameter as done
in the previous experiments and build the model (CTRL+B). Create a new experiment
and set the working root the same as the model, create a new Layout and add controls as
explained in section 7.3.
68
Fig. 7.5 Control-desk
• Run the experiment and select the animation mode. Verify that the Reset,
select_slip_op and Torque_SpeedControl Check Boxes are all unchecked. Check and
uncheck the Reset Check Box.
• Determination of Lm
69
o Now, increase the reference frequency for the induction machine to rated
frequency in Hz. Use the Numerical Input to accurately set the frequency
reference.
o Observe the waveforms for d A and iA on the oscilloscope. Set the channel
displaying d A to AC coupling. Take the readings for the rms values of these
variables using the Measurement option on the oscilloscope. Also measure the
phase difference between the two waveforms using the cursors.
o Now set the frequency reference of induction motor to zero and subsequently
the speed reference of DC-motor to zero so that the machines come to rest. Stop
the experiment in the edit mode.
o The scaling factor for d A and iA are 10 and 0.5 respectively. Actual rms values
of the phase ‘A’ voltage, phase ‘A’ current and the per phase reactive power
drawn by the three-phase induction motor can be calculated as follows:
Q = i A,rms 2 .X m ,
70
• Determination of rotor parameters ( Rr ', Llr )
o Run the experiment and select the animation mode. Verify that the Reset,
select_slip_op and Torque_SpeedControl Check Boxes are all unchecked.
Check and uncheck the Reset Check Box. Check the Torque_SpeedControl
Check Box. The DC-motor will now operate under torque-control.
o Slowly increase the reference frequency of the induction motor to the rated
frequency in Hz. Now, increase the DC-motor torque reference while observing
the induction motor phase ‘A’ current waveform. Increase the torque reference
till the peak phase ‘A’ current of the induction motor reaches 4.6 A. This is the
rated current of the machine and it is now operating at rated conditions.
o Record the speed from the display. This is the speed of the induction motor at
rated load. The rated rotor slip speed and slip frequency can now be calculated
as,
o Decrease slowly the reference torque of DC-motor to zero and subsequently the
rated frequency of induction motor to zero. Shut down the experiment into edit-
mode.
o Run the experiment again and select the animation mode, Verify that the Reset,
select_slip_op and Torque_SpeedControl Check Boxes are all unchecked.
Check and uncheck the Reset Check Box. Check the select_slip_op Check
Box. The DC-motor operates under speed control. Increase the speed reference
of the DC-motor to the rated slip speed calculated in the previous section.
71
o Now increase the reference frequency of the induction motor to the slip
frequency calculated in the previous section. Increase the value of Vslip using
the slider and observe the phase ‘A’ current of the induction motor. Adjust
Vslip such the induction motor draws the rated magnetizing current (same as the
current drawn while determining Lm .
o Now bring the speed reference of the DC-motor to zero. Verify that the motors
come to rest. Take readings for the rms phase ‘A’ voltage & current and the
phase difference between the two. The per-phase equivalent circuit of a three-
phase induction motor, under such condition will be same as shown in Fig. 7.1
with s=1.
2
o At this stage, the values of Lm and Rs are known. Assuming Lls = Llr , we have
3
two unknowns, i.e. Rr 'and Llr . Calculate the impedance seen by the voltage
source, in the per-phase equivalent circuit, in terms of the two unknown
quantities. Having known the voltage and current vectors (previous step), the
two unknown quantities can be solved for.
7.6 References
[1] “ELECTRIC DRIVES an integrative approach” by Ned Mohan, 2000, MNPERE.
72
Experiment – 8
V/f speed-control of a three-
phase induction motor
8.1 Introduction
In a three-phase induction motor, the frequency of the applied voltage f ref ( Hz ) and the
mechanical speed ω m _ ref ( r / min) in r/min are related by equation (1). The slip frequency f slip ( Hz ) is
a load dependent quantity, which can be calculated in real-time, if the value of load-torque and
the slope of the motor torque-speed characteristic are known. Having known the value of
f slip ( Hz ) and the desired mechanical speed ω m _ ref ( r / min) , the frequency f ref ( Hz ) of the three-phase
torque at the rated-current for each values of f ref ( Hz ) . The constant k is known as V/f-constant
which is given by equation (2). In the first part of this experiment, by using the motor torque-
speed characteristic, we will derive a relation between the load torque and f slip ( Hz ) . Also, we
will observe that in low frequency range, to maintain the rated-torque at rated-current a voltage
boost is required, i.e. the proportional relation Vref = k × f ref ( Hz ) seizes to exist. Having known
the relation between load torque and f slip ( Hz ) , the second part of the experiment uses equation
(1) to implement V/f speed-control. The circuit diagram for this experiment is same as that of
experiment-7.
p
× ωm _ ref ( r / min) + f slip ( Hz )
f ref ( Hz ) = (1)
120
where, p → number of poles
Vrated
k= (2)
f rated ( Hz )
where, Vrated → rated phase voltage and f rated ( Hz ) → rated frequency in Hz
73
8.2 Real-time Implementation
The real-time Simulink model is shown in Fig. 8.2. This model is similar to the model in
experiment-7. Open the model used in experiment-7; delete the blocks which are not shown in
Fig. 8.2. Perform the following steps to add new blocks.
• Add constant source Wref_r_min and fref. Wref_r_min will be used to do V/f speed-
control of the motor, while f_ref will be used when determining the motor torque-speed
characteristic.
• Adding f_ref_slip_comp: This block is used to determine f ref ( Hz ) for a desired speed
reference, by calculating f slip ( Hz ) . Create a subsystem as shown in Fig. 8.3 and name it
in section 8.4.2.
• Set the simulation parameter (as done in previous experiments) and build the model
(CTRL+B)
74
Fig. 8.3 Generation of reference frequency
• Drag and drop variables into appropriate parts as shown in Fig. 8.4, Change the slider
properties as indicated.
75
8.4 Running the experiment
8.4.1 Torque-Speed Characteristics
TIM = TDC + T fr + Bω
The values of T fr and B were calculated in Experiment - 4.
• In the Simulink model file, verify that the frequency input of the Duty Ratio Gen.
subsystem is from the constant f_ref. If not, make necessary changes and rebuild the
model. In the Control Desk layout, run the experiment and select the animation mode.
Check and uncheck the Reset Check Box.
• Take the following readings (Table 8.1) for the specified values of Tref (varied using
Slider). Prepare the sets of readings for the following frequencies applied to the
induction motor: 30, 40, 60, 80 and 100 Hz (set using Slider and Numerical Input). Care
must be taken to use proper units while calculating TIM .
• The torque-speed characteristics can now be plotted for various input frequencies.
76
8.4.2 Speed Control at Constant V/f Ratio
• Disconnect the DC-motor terminals from the drives board. The system now consists of
an induction motor coupled with a DC-motor which does not produce any torque. So
the load-torque in the systems is T = T fr + Bω . Since T fr and B are known, torque for
• The objective is to apply such a frequency reference to the induction motor so that the
system rotates at the reference mechanical speed. This frequency reference can be
calculated from the torque-speed characteristics derived in the previous section as
follows:
Let the mechanical speed reference in rad/sec be ωmech . The torque at this speed
77
• Having known ω syn , the frequency to be applied to the induction motor can be
p × ωsyn ωsyn
calculated for a 4-pole motor as f ref ( Hz ) = =
120 30
• Calculate the slope ' m ' (N-m/r/min) of the torque-speed characteristics that was
derived in the previous section. Enter this value in the appropriate block of the
Simulink model.
• In the Simulink model, change the frequency input of the Duty Ratio Gen. subsystem
to the output of f_ref_slip_comp subsystem. Build (ctrl+B) this model.
• Increase the reference speed and note the actual speed from the Display. Make
observations for the following values of reference speed: 500 rpm, 1200 rpm, 2000
rpm, and 3000 rpm.
• Why there is an error in the reference speed and actual speed (you measured in 8.4.2) in
V/f speed-control? (Hint: open loop speed-control)
78
Experiment-9
Permanent Magnet AC (PMAC)
Motor
9.1 Introduction
In this experiment, the vector control of a three-phase permanent magnet AC (PMAC) motor
will be studied. Real-time Simulink and layout files are given to perform the experiment. The
objective would be to understand how maximum electromagnetic torque from the motor is
achieved, when stator current space vector is maintained perpendicular to the rotor flux vector.
This angle is changed in real-time to verify the decrease in electromagnetic torque. Also to
verify the angle itself, first, the PMAC would be characterized to determine the value of
inductance, resistance of the motor and the back-EMF constant. These values would then be
used in the per-phase equation of motor to calculate and hence verify the angle between the
back-EMF and phase “A” current of the motor. The preliminary steps for the preparation of
vector control are given for reference. This is an advance material that can be used to
understand the Simulink file and layout file given, to perform the experiment.
79
9.2.1 Preliminary steps to prepare the vector control of PMAC motor
1. Observation of index pulse: Run the motor as a generator; observe the output line
voltages. In the present case the index pulse comes when the back-emf Eab peaks. The
PMAC motor has 10 poles; hence the next index pulse will come after 5 electrical
cycles (i.e. one complete rotation of shaft), exactly when Eab peaks. This index pulse
will be used to maintain the value of θ = 90° in each rotation.
Eab
Position of Locking,
when line AB is
excited with DC
T=0
80
Eab
Ψab
Position of Locking,
when line AB is
excited with DC
Ψm = Ψab = Ψs
or, T=0
Br vector
q-axis
B
T=0, Θda=0
- π/6 A
O
d-axis
Eab=0, or
position of Br. or
Position of Ψm
C When locking with
Vab = 2V
81
position, at T=0+ current space vector I s is calculated using the value of Isq [1] and θ da
such that θ = 90° . In fact, this is done through a PI controller that generates the d-axis
and q-axis voltage magnitude. The magnitude and phasor of the required phase voltages
are calculated by using θ da , Vsd and Vsq [1].
3. Maintaining θ = 90° in each rotation of shaft: Refer to Fig. 9.1, the index pulse comes
after 360n + 270 (where n = 0-5) electrical degrees from T=0. Hence, when index pulse
is received, Br has moved in anti-clockwise direction by 270 electrical degrees or 270-
30 = 240 electrical degrees from physical a-axis winding. To align the d-axis with Br ,
the value of θ da at each index pulse is reset to 240 degrees, hence θ = 90° is maintained.
4. Assuring the correct direction of rotation and phase sequence: Before finding the
position of Eab in Fig. 9.3, the correct phase sequence ABC (anticlock) need to be
checked. This is the assumed direction of positive speed of rotation. The phase
sequence can be verified by injecting DC voltages in line AB, BC and CA, one-by-one.
The rotor should move forward in positive direction, each time the DC voltage is
applied to the line AB, line BC and line CA respectively.
Subsystem: This contains the logic to maintain θ = 90° at starting and at each rotation of
shaft. The logic action is divided into two parts, 1) From T=0 to reception of first index
pulse and 2) After reception of first index pulse. In part-1, the position information is
calculated by integrating the frequency (from port-1). Part-1 uses the following blocks:
Integrator2 (initial condition -30 electrical degrees, as calculated before) and port-1.
The output of “Triggered Subsystem” dictates the end of part-1. When the first index
pulse is received, the system “Triggered Subsystem” is triggered, which changes the
initial output of “Triggered Subsystem”=0 to “Triggered Subsystem”=1 (see how to set
the initial output in Fig 9.4). Hence “theta_da” is taken from the top port of the
82
“switch”, which is a continuous position information form encoder with reset value as
240 degrees.
(Note: Encoder outputs the encoder lines from 0-1000 as it makes a full rotation; Here 0
and 1000 is converted into 0 and 360 electrical degrees respectively. When the index
pulse is received, the encoder output is 0, this is added with reset angle value of
“Angle”=240 degrees to give the value of “theta_da”)
83
Fig. 9.5 Simulink block-diagram
84
1. Using “Enc position” from DS1104ENC_POS_C1:
2. Current sensing: At the input of the current sensors put a first order filter of bandwidth
4 kHz. This is done to remove noise and proper starting of the system.
3. PI controller: While designing the controller, take into account the filter used in step-3.
The specification of current loop is as follows: Phase margin=82 degrees and
bandwidth = 450 Hz. Lower phase margin with high bandwidth has resulted into
significant oscillation at higher speed.
4. Switching frequency: The inductance and resistance of the motor under test is very low.
Switching frequency of 10 kHz (as used in previous experiments) will result into a very
high ripple in the motor current. This has resulted into significant oscillation in the
controller behavior. The switching frequency was increased to 50 kHz for this
experiment.
85
5. Locking and starting the motor: When Lock=1 the output of the inverter terminal AB
will be a 2 V dc. This will bring the rotor to a known position at starting.
6. Activate_index: This deactivates the index pulse while locking the motor to a known
position. The deactivation is actually a pseudo deactivation, i.e. the input “Reset” of
“Subsystem” will not see a transition if an index pulse will come during the locking of
motor. This is required, otherwise, the starting angle will not be correct and the reset
logic will jump directly into part-2.
• Determination of Rs : Measure the line-line resistance of the induction motor with the
• Start Control-desk and create a new experiment in the same working root as your
Simulink model file. Open the layout (*.lay) file provided and select “yes” to make data
connections. The layout should look as shown in Fig. 9.6.
• Uncheck Lock, Act index and Resetinteg. The functions of these variables have been
explained above.
86
Fig. 9.6 Control-desk Layout
• Observe that the numerical display for Angle displays 4.189 which equals π + π / 3 , the
value to which the integrator resets every rotation.
• Now increase Isq_ref to 1.5 A. Under vector control, the torque is proportional to Isq.
Note down the speed of the machine. Observe the phase ‘A’ current and voltage
(derived from phase ‘A’ duty ratio, as in experiment-7).
• Calculate the back-emf of phase ‘A’ using the per-phase equivalent circuit [1]. Verify
that the phase ‘A’ current and back-emf are in phase.
• Change the angle value by ±10o using the numerical input Angle. Note down the speed
of the motor for the two cases.
87
9.4 Lab Report
Include the following in your lab report:
• Phasor diagram showing the phase ‘A’ voltage, current and back-emf.
• Give reasons for the change in speed of the motor when Angle is changed in 9.3.2.
9.5 References
[1] “ADVANCED ELECTRIC DRIVES Analysis, Control and Modeling using Simulink” by
Ned Mohan, 2001, MNPERE.
88
Appendix – A
Safety Precautions and Power-
Electronics-Drives-Board
familiarization
1.1 Why is safety important?
Attention and adherence to safety considerations is even more important in a power electronics
laboratory than it’s required in any other undergraduate electrical engineering laboratories.
Power electronic circuits can involve voltages of several hundred volts and currents of
several tens of amperes. By comparison the voltages in all other teaching laboratories rarely
exceed 20V and the currents hardly ever exceed a few hundred milliamps.
In order to minimize the potential hazards, we will use dc power supplies that never exceed
voltages above 40-50V and will have maximum current ratings of 20A or less. Most of the time
we will use dc supplies of 20V or less and 1 A or less output current capability. However in
spite of this precaution, power electronics circuits on which the student will work may involve
substantially larger voltages (up to hundreds of volts) due to the presence of large inductances
in the circuits and the rapid switching on and off of amperes of current in the inductances. For
example a boost converter can have an output voltage that can theoretically go to
infinite values if it is operating without load. Moreover the currents in portions of some
converter circuits may be many times larger than the currents supplied by the dc supplies
powering the converter circuits. A simple buck converter is an example of a power electronics
circuit in which the output current may be much larger than the dc supply current.
• Exploding components (especially electrolytic capacitors) and arcing circuits can cause
blind- ness and severe burns.
89
• Burning components and arcing can lead to fire.
• When working with voltages over 40V or with currents over 10A, there must be at least
two people in the lab at all times.
• Always wear safety glasses when working with the circuit at high power or high
voltage.
• Use rubber floor mats (if available) to insulate yourself from ground, when working in
the Lab.
• Be sure about the locations of fire extinguishers and first aid kits in lab.
• A switch should be included in each supply circuit so that when opened, these switches
will de-energize the entire setup. Place these switches so that you can reach them
quickly in case of emergency, and without reaching across hot or high voltage
components.
• Use only isolated power sources (either isolated power supplies or AC power through
isolation power transformers). This helps using a grounded oscilloscope and reduces the
possibility of risk of completing a circuit through your body or destroying the test
equipment.
90
1.3.3 Precautions to be taken before powering the circuit
• Check for all the connections of the circuit and scope connections before powering the
circuit, to avoid shorting or any ground looping that may lead to electrical shocks or
damage of equipment.
• Double check your wiring and circuit connections. It is a good idea to use a point-to-
point wiring diagram to review when making these checks.
• Switch of all the power supplies and remove the power supply connections.
• Let the load be connected at the output for some time, so that it helps to discharge
capacitor or inductor if any, completely.
91
• Modify the connections as per your requirement.
• Again check the circuit as per steps in section 3.3, and switch ON as per steps in section
3.4.
• No loose wires or metal pieces should be lying on table or near the circuit, to cause
shorts and sparking.
• Avoid using long wires, that may get in your way while making adjustments or
changing leads.
• Keep high voltage parts and connections out of the way from accidental touching and
from any contacts to test equipment or any parts, connected to other voltage levels
• When working with inductive circuits, reduce voltages or currents to near zero before
switching open the circuits.
• BE AWARE of bracelets, rings, metal watch bands, and loose necklace (if you are
wearing any of them), they conduct electricity and can cause burns. Do not wear them
near an energized circuit.
• When working with energized circuits (while operating switches, adjusting controls,
adjusting test equipment), use only one hand while keeping the rest of your body away
from conducting surfaces.
92
1.4 Power-Electronics-Drives-Board familiarization
The drives board which we use in the Electric Drives Laboratory has been designed to enable
us to perform a variety of experiments on AC/DC machines. The main features of the board
are:
The basic block diagram of drives board is shown in Fig. 1 and the actual drives board is shown
in Fig. 2. Please note that various components on the board are indicated in Table. 1.
1.4.1 Inverters
Each 3-phase inverter uses MOSFETs as switching devices. The 3-phase outputs of the first
inverter are marked A1 (D-6 in Fig. 2), B1 (E-6 in Fig. 2), C1 (F-6 in Fig. 2) and those of the
second inverter are marked A2 (I-6 in Fig. 2), B2 (K-6 in Fig. 2), C2 (L-6 in Fig. 2).
±12 volts signal supply is required for the isolated analog signals output form the drives board.
This is obtained from a wall-mounted isolated power supply, which plugs into the DIN
connector J90 (B-2 in Fig. 2). Switch S90 (C-2 in Fig. 2) controls the signal power to the board.
The green LED D70 (C-2 in Fig. 2) indicates if the signal supply is available to the board.
Fuses F90 (C-2 in Fig. 2) and F95 (B-2 in Fig. 2) provide protection for the +12 V and −12 V
supplies respectively. Please note that the green LED indicates the presence of only the +12 V
supply. Please note that turning off S90 will not stop the PWM signals from being gated to the
93
Table 1: Locations of components on drives board
No. Component Ref. Des. Location in Fig. 2
1 Terminal +42 J1 A-4
2 Terminal GND J2 A-3
3 Terminal PHASE A1 J3 D-6
4 Terminal PHASE B1 J4 E-6
5 Terminal PHASE C1 J5 G-6
6 Terminal PHASE A2 J6 J-6
7 Terminal PHASE B2 J7 K-6
8 Terminal PHASE C2 J8 L-6
9 DIN connector for ±12 V signal supply J90 B-2
10 Signal supply switch S90 C-2
11 Signal supply +12 V fuse F90 C-2
12 Signal supply-12 V fuse F95 B-2
13 Signal supply LED D70 C-2
14 MOTOR1 FAULT LED D66 D-2
15 MOTOR2 FAULT LED D67 L-2
16 DIGITAL POWER LED D68 I-2
17 MAIN POWER LED D69 B-3
18 Inverter 1 D-3 to G-4
19 Inverter 1 I-3toL-4
20 DC Link capacitor of Inverter 1 C1 B-5
21 DC Link capacitor of Inverter 2 C2 G-5
22 Driver IC IR2133 for Inverter 1 U1 E-2
23 Driver IC IR2133 for Inverter 2 U3 J-2
24 Digital Supply Fuse F2 G-1
25 dSPACE Input Connector P1 H-1 and I-1
26 RESET switch S1 L-1
27 Phase A1 current sensor (LEM) CS2 C-5
28 Phase B1 current sensor (LEM) CS3 D-5
29 Phase A2 current sensor (LEM) CS5 H-5
30 Phase B2 current sensor (LEM) CS6 J-5
31 DC link current sensor (LEM) CS1 L-5
32 VOLT DC BNC5 B-4
33 CURR A1 BNC1 B-3
34 CURR B1 BNC2 C-3
35 CURR A2 BNC3 H-3
36 CURR B2 BNC4 I-3
inverters. The power supply for the 3-phase bridge drivers for the inverters is derived from the
DC Bus through a flyback converter (A-2 in Fig. 2).
94
Fig 1 Block Diagram of Electric Drives Board
Test points are provided to observe the inverter output voltages. BNC connector VOLT DC (B-
4 in Fig. 2) has been provided to sense the DC bus voltage. To measure the DC bus voltage,
LEM sensors are used to measure the output current of the inverters. Only A and B phase
currents are sensed. The C phase current can then be calculated using the current relationship
Ia+Ib+Ic = 0, assuming that there is no neutral connection for the machines. The calibration of
95
the current sensor is such that for 1 A current flowing through the current sensor, output is 0.5
V. To measure the output current of phase A of inverter 1,
The inverters are driven by 3-phase bridge drivers (IR2133). The PWM inputs are isolated
before being fed to the drivers.
PWM and other digital signals for the board are to be given to the 37-pin DSUB connector (H-
1 in Fig. 2). For pin-out of the connector, see Table 2.
The Drives Board consists of over-current protection for each inverter. An over-current fault
occurring on inverter 1 is indicated by red LED ”MOTOR FAULT 1” (D-2 in Fig. 2), while
that of inverter 2 is indicated by red LED ”MOTOR FAULT 2” (L-2 in Fig. 2). Each time a
fault occurs, reset the fault using the ”RESET” switch (L-1 in Fig. 2) on the board. All the
faults are reset by this switch.
96
Table 2: 37-pin DSUB Connector
No. Pin Number Description
1 GND Digital Digital ground
2 FAULT 1 Inverter 1 Fault output. Fault Signal high
3 NC Not Connected
4 GND Digital Digital ground
5 NC Not Connected
6 GND Digital Digital ground
7 PWM A1 A phase PWM signal of Inverter 1
8 PWM B1 B phase PWM signal of Inverter 1
9 PWM C1 CphasePWMsignalofInverter1
10 PWM A2 A phase PWM signal of Inverter 2
11 PWM C2 C phase PWM signal of Inverter 2
12 GND Digital Digital ground
13 GND Digital Digital ground
14 GND Digital Digital ground
15 GND Digital Digital ground
16 SD1 Shutdown signal for Inverter 1
17 FLTCLR-IN Clear Fault signal
18 VCC
19 VCC
20 GND Digital Digital ground
21 FAULT 2 Inverter 2 Fault output. Fault Signal high
22 NC Not Connected
23 NC Not Connected
24 NC Not Connected
25 GND Digital Digital ground
26 NC Not Connected
27 NC Not Connected
28 NC Not Connected
29 PWM B2 CphasePWMsignalforInverter2
30 GND Digital Digital ground
31 GND Digital Digital ground
32 GND Digital Digital ground
33 GND Digital Digital ground
34 NC Not Connected
35 SD2 Shutdown signal for Inverter 2
36 GND Digital Digital ground
37 GND Digital Digital ground
97
Fig 2 Power Electronics Drives Board
98