Fast Ac Electric Drive Development Process Using Simulink Code Generation Possibilities
Fast Ac Electric Drive Development Process Using Simulink Code Generation Possibilities
Fast Ac Electric Drive Development Process Using Simulink Code Generation Possibilities
i
s2 r
Figure 1 - Vector diagram of stator current and rotor magnetic flux
2
s
1
S
i
i
s2 i
s1
Figure 2 - Vector diagram of the IM state variables
Figure 3 - Simplified flow chart of vector control
All the controllers and observers are derived from the mathematical model of the induction
machine:
s k
s
s s s
j
dt
d
i R u
+ + =
(3)
r sl
r
r r
j
dt
d
i R
0 + + =
(4)
}
{
2
3
*
r s
r
m
m
i
L
L
p M =
(5)
m
p ' =
(6)
dt
J M M
l m
d
=
s
i
s
u
r
(7)
Table 1 - Description of symbols and acronyms used in this paper:
- angular speed of motor
sl
- slip speed
p - number of pole pairs
L
s
- stator leakage inductance
L
s
- stator winding inductance
L
r
- rotor winding inductance
L
m
- mutual inductance
R
s
- stator resistance
R
r
- rotor resistance
R
1
- combined resistance (R
1
=R
s
+L
m
2
/L
r
2*
R
r
)
T
1
- current model time constant (T
1
=L
s
/R
1
)
T
r
- rotor time constant (T
r
=L
r
/R
r
)
J - moment of inertia
M
m
- motor torque
M
l
- load torque
- stator current vector
- stator voltage vector
- rotor flux vector
s
- stator flux vector
The structure type of all controllers is PI and they are designed by using pole-placement
method. All systems are described by first order dynamic equations.
Current controllers
Design of current controllers is derived from the following transfer function:
( )
( )
( )
( )
( ) 1
1 2 1
+
= = =
s T s u s u
s G
S S
S
/ 1
1 2 1
R s i s i
S S
o
(8)
Final current controller parameters are achieved using the following equations:
( is desired dynamics, desired damping) b
1 1
1
2 T R b K
o p
=
1
T
2
p
i
K
T =
( )
( )
( )
1 1 o
T R
(9)
Flux controller
Design of flux controller is derived from transfer function:
1
1
+
=
=
s T
L
s i
s
s
r
m
S
r
S
G
(10)
Final current controller parameters
m r
r
o p
L
T
T
b K
=
1
2
2
o r
m p
i
T
L K
=
( )
( )
( )
T
(11)
Speed controller
Speed controller is designed by knowing the mechanical parameters
Transfer function:
B Js L
L
p
s i
s
s G
r
r
m
S
S
+
= =
1
'
2
3
1
(12)
Final equations:
( )
2
'
2
3
o
r
r
m
p
i
J
L
L
p K
T
=
r
r
L
m
o
p
L
p
B J b
K
=
'
3
2
2
(13)
Flux weakening controller
Flux weakening is necessary for achieving speeds higher than rated speed of the motor. The
design of flux weakening controller is too complicated for this paper. But in general it is voltage
controller which is activated when the voltage is close or equal to saturation.
Flux observer
Flux observer is the heart of vector control, because of the control algorithm is oriented in rotor
magnetic flux reference frame. That is one of the reasons vector control is often called Field Oriented
Control.
is mechanical angular speed, Following equations and figure 4 describes presented flux observer.
is mechanical rotor position (time integral of ).
s
r
m
r r
r
r
i
T
L
j
T
s + + =
1
(14)
Figure 4 flux observer
Simulation model
The aim of our project was to develop speed vector control and sensorless vector control for the
Induction Machine. Speed sensorless vector control means feedback speed control without any
mechanical speed sensor. Speed is observed from motor voltages and motor currents only.
Our primary platform for developing and testing purposes was Simulink with
SimPowerSystems toolbox. We used model of induction machine, three phase source and many other
power electronics blocks for close-to-reality simulation of the drive.
The basic block is VECTOR CONTROL which contains all the required controllers, observers,
state information, error flags, etc. This block is later copied to the dSpace model. Figure 5 shows the
main window of the simulation SimPowerSystems model.
Figure 5 - Simulation model
Figures 6, 7 and 8 show the inner connections of selected blocks. The model is purely discrete
with sample time of 200 s. All the blocks are part of Embedded MATLAB subset, so there is not any
problem with code generation. Sample time for simulating the electronics has been chosen as 10 s. In
figure 8 the flux current controller is presented.
We prefer to use constant blocks for parameters instead of gain blocks. Because constant blocks
can be more easily tuneable, they might be configured as inputs in the ControlDesk applications and
its value can be changed on the fly. The same applies for code generation for the other platforms.
Variables inside the constant block may be configured as exported variables as part of global structure
or as global variable as well. These variables may be changed by the custom code. So it is possible to
change the behaviour of the model on the fly. The entire model is based on IEEE 754 single precision
floating point numbers so this model is faster in execution and can be very easily ported to any target
with floating point numbers support.
Figure 6 - Inner connection of the VECTOR CONTROL block
Figure 7 - Inner connection of the inverter block
Figure 8 - Inner connection of the current controller block
dSpace model
The dSpace board allows real-time control of different systems. Its main advantage is
integration into the MATLAB/Simulink environment. So instead of complicated time-intensive
rewriting model to the C code, we developed the program in Simulink and then we just built and
executed the finished model. Model is executed and controlled via the ControlDesk application. It is
also very easy to export any graphs to MATLAB.
Figure 9 Screen capture of proposed dSpace model
DSpace models and simulation models are pretty similar as can be seen in figure 9. Instead of
induction machine and inverter blocks, the block of communication with inverter is used. Inputs
represent reference voltages. The block of communication with inverter contains the compensation of
DC voltage fluctuations as well and the computed duty cycles are inputs for the dSpace PWM block.
Figure 10 shows the basic schema of connection dSpace controller board to frequency
converter and the induction machine as well.
Figure 10 Schema of connecting dSpace equipped PC with frequency inverter and induction motor
Comparison
Figures 11-14 show the comparison of simulation and real behaviour of modelled system.
Vector control at low speed is demonstrated. Small differences and noise in dSpace figures are caused
by non-calibrated current sensors, but indeed we can say that we reached comparative results within
the toleration.
0 0.5 1 1.5 2 2.5 3 3.5 4
-20
0
20
40
60
80
100
120
Speed: dSpace - w* =0-20-40-60-80-100 rad/s
time [s]
a
n
g
u
l
a
r
s
p
e
e
d
[
r
a
d
/
s
]
measured
reference
Figure 11 dSpace experiment: steps of reference speed up to 100 rad/s
0 0.5 1 1.5 2 2.5 3 3.5 4
-20
0
20
40
60
80
100
120
time [s]
a
n
g
u
l
a
r
s
p
e
e
d
[
r
a
d
/
s
]
Speed: Simulation - w* =0-20-40-60-80-100 rad/s
measured
reference
Figure 12 Simulation: steps of reference speed up to 100 rad/s
0 0.5 1 1.5 2 2.5 3 3.5 4
-15
-10
-5
0
5
10
15
Speed: dSpace - w* =10 rad/s to -10 rad/s
time [s]
a
n
g
u
l
a
r
s
p
e
e
d
[
r
a
d
/
s
]
measured
reference
Figure 13 dSpace experiment: performance of low speed and speed reversal
0 0.5 1 1.5 2 2.5 3 3.5 4
-15
-10
-5
0
5
10
15
time [s]
a
n
g
u
l
a
r
s
p
e
e
d
[
r
a
d
/
s
]
Speed: Simulation - w* =10 rad/s to -10 rad/s
measured
reference
Figure 14 Simulation: performance of low speed and speed reversal
Conclusion
In this paper we had focus on induction machine vector control development. Since the
beginning we tried to keep the model simple, robust and fully discrete as well, because we planned to
share the basic model with other platforms dSpace in our case. The basic testing during the creation
and development of the model was by simulation only, later we tried it also on a dSpace platform
where real capabilities were demonstrated.
In the future we may use another platform and it can be used for educational purposes and also
for testing some advanced control structures.
Acknowledgement
This work has received support from the Slovak Research and Development Agency. Project reference
number is APVV-0530-07.
References
[1] alman M.: Akn leny (Slovak language), STU Bratislava 2003
[2] Milan alman lectures for Inteligent Servosystems, 2007/2008.
http://servo.urpi.fei.stuba.sk/index.php?option=com_content&task=view&id=15&Itemid=26
[3] Doki, S.; Kinpara, Y.; Okuma, S.; Sangwongwanich, S., "Unified interpretation of indirect
and direct vector control [of electric machines]," Power Conversion Conference, 1993.
Yokohama 1993., Conference Record of the , vol., no., pp.297-302, 19-21 Apr 1993
URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=264167&isnumber=6639
[4] DS1104 R&D Controller Board, dSpace Inc. 2009 Catalogue,
URL:http://www.dspaceinc.com/ww/en/inc/home/medien/papers/download_page.cfm?FileI
D=778
[5] The MathWorks, SimPowerSystems Documentation, 2008
URL:
http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/powersys/index.html?/a
ccess/helpdesk/help/toolbox/physmod/powersys/
[6] The MathWorks, SimPowerSystems Demos, 2008
Ing. Jakub Vonkomer, Email:jakub.vonkomer@stuba.sk
Ing. Tatiana Radiov, Email: tatiana.radicova@stuba.sk
prof. Ing. Milan alman PhD, Email: milan.zalman@stuba.sk
Ing. Miroslav Suchnek, Email: miroslav.suchanek@stuba.sk
Institute of Control and Industrial Informatics, Faculty of Electrical Engineering and Information
Technology, Slovak University of Technology in Bratislava,