international symposium on electrical engineering and ... 2009/c1.01_afanasov cip…msk2812 kit c...
TRANSCRIPT
3rd
International Symposium on Electrical Engineering and Energy Converters September 24-25, 2009, Suceava
137
Abstract—The purpose of this paper is to present the use of
the DMCode-MS(IM) motion control library in the MATLAB-
Simulink development environment and in the DMCD-Pro
(Digital Motor Control Developer Pro) real control system. It
presents the way of using the DMCode-MS(IM)
MATLAB/Simulink library, and of simulating in
MATLAB/Simulink different control models for asynchronous
motors. These models can then be tested on the Technosoft
MSK2812 Kit C Pro, a digital control real time system
integrated with the TMS320F2812. This state-of-the-art
development approach of digital motor control applications
implements the developers’ old dream: start with the complete
system model, design the control blocks and analyze its
expected behavior by simulation, then automatically generate
executable code for the target control system and perform the
tests on the real system. Such an approach not only
significantly reduces the development time, but also lets you
focus on the application functionality and performance, thus
shortening the road from design and laboratory phase and
from there to industrial application level.
Index Terms—asynchronous motors, digital motor control,
motion control, vector control, simulation software.
I. INTRODUCTION
The rapid pace of technology development and progress
recorded in power electronics equipment allows at the
present production of highly efficient electric drives. Rapid
development of microelectronics and informatics, has
caused major changes in the electric motor control
technology and development of digital signal processor
dedicated to control movement made possible the
widespread deployment of numerical control algorithms.
In order to practically implement a system drive, in a way
as quickly as possible, in recent years have developed a
series of specially designed software to convert a drive from
the stage of simulation in machine code for digital signal
processors dedicated to different applications.
The solution used provides many significant benefits for
the following characteristics:
� automatic generation of C code - it eliminates the
need to write C code and assembly code;
� structure modeling and visual simulation system -
can quickly change the control structure, may be made an
optimization of control parameters, simulation results are
obtained immediately;
� analysis on the DSP system - validation of the
solution on the real control environment;
� “plug-and-play” approach - the first straightforward
step is to set up the hardware and software and then you can
already test that all parts operate properly (simulation, code
generation, download and execution on DSP structure).
Fig.1 The implementation of the scheme drive system - the software
simulation stage during the execution phase on DSP.
II. MATHEMATICAL MODEL OF INDUCTION
MOTOR
To simulate some transitional processes in asynchronous
machine was used a model of induction motor based on the
theory of representative space phasor. Using theory of
representative space phasor allowed to obtain a general and
simple model of induction motor, including the most
complex operating regimes.
The use of representative space phasors simplifies the
mathematical model of the motors with cylindrical
symmetry, as is the induction motor. The main advantage is
that it facilitates the understanding of the phenomena
occurring in the motor, through the direct link between the
representative space phasor of the current and the magnetic
voltage produced by a poly-phased winding. These
advantages are best illustrated within the “field control” of
the induction motor.
With practical control systems, the use of a model with a
number of equations as little as possible is preferred, even if
its parameters present certain variations.
In developing the model were taken into account the
following simplifying assumptions:
� the motor is unsaturated;
� the iron permeability is practically infinite;
Techniques for Implementing a Model
Simulated on a Physical Drive Vector Control
Ciprian AFANASOV
"Stefan cel Mare" University of Suceava
str.Universitatii nr.13, RO-720229 Suceava
138
� iron losses are practically insignificant;
� only the fundamental of magnetic fields are
considered;
� the motor has a perfect electric symmetry (stator
phases have the same number of coils and the same
parameters).
Taking into account the above simplifying assumptions
and the functioning equations of the induction motor,
through computing we can obtain the following final
operating equations [1]:
u�α � R� · i�α ��Ψα�
� �Ψα� � u�α R� · i�α (1)
u�β � R� · i�β ��Ψβ�
� �Ψβ� � u�β R� · i�β (2)
u�α � R� · i�α ��Ψ�α�
� �Ψ�α� � u�α R� · i�α (3)
u�β � R� · i�β ��Ψ�β�
� �Ψ�β� � u�β R� · i�β (4)
where:
i� � i�α � j · i�β (5)
i� � i�α � j · i�β � i�� � i�α j · i�β (6)
�ω� �
�� ·
��J · L� · I��i�, i��� M�
�J (7)
�ω� �
����J L� · I� � i�α � ji�β! i�α ji�β!" M�
�J (8)
�ω� �
�� ·
��J · L� · i�β · i�α i�α · i�β! M�
�J (9)
The variable parameters to be placed in SIMULINK
block of the induction motor are:
� stator winding resistance: Rs
� rotor winding resistance: Rr
� stator winding inductance: Ls
� rotor winding inductance: Lr
� mutual inductance: Lm
� moment of inertia: J
� number of pole pairs: p
SIMULINK diagram of three phase induction motor that
was simulated is shown in Fig. 2.
III. SYSTEM SIMULATION
At this first level, the working environment MATLAB
allows complete simulation of digital systems control for
induction motors. All models block to simulate motors,
sensors, power converters, etc., are provided by software
libraries. For example, Fig. 3 presents the principle scheme
for the vector control of an three phase induction motor
operating in a speed loop.
Equivalent scheme of vector control system described in
Fig. 3 was implemented in the MATLAB-Simulink
development environment, as can be seen in Fig. 4.
A separate tuning tool can be used to set up the
controllers, based on the system parameters and imposed
control performances. Fixed-point IQ Math type is
emulated, to reproduce the real environment from the DSP
controller [2].
Once the design phase has been accomplished, simulation
of different operating conditions will allow you to evaluate
the expected behavior of the system, and to improve the
system model and/or parameters, for better performance.
At this stage you can choose optimal parameters for all
regulators, may refrain simulated waveform that basically
have no way to be measured and verified if made properly
functioning system.
If results are satisfactory, can pass to the next stage - C
code generation for the model.
M
6
teta_mech[rad]
5
omega_mech[rad/s]
4
Phira
3
Ic [A]
2
Ib [A]
1
Ia [A]
p/J
2/3
a,b,o ->ABC
Tabo2ABC
3/2
ABC ->
a,b,o
TABC2abo
1/p
Rr
Rr
Rs
Rs
Phis Is
Phir Ir
Phib ---> Ib
Phis Is
Phir Ir
Phia ---> Ia3/2*p*p/J*Lm
Irb*Isa
Ira*Isb
1
s
I_w
1
s
I_Phi_sb
1
s
I_Phi_sa
1
s
I_Phi_rb
1
s
I_Phi_ra
1
s
1
4
Mr [Nm]
3
Uc [V]
2
Ub [V]
1
Ua [V]
Fig. 2 SIMULINK diagram of three phase induction motor
3rd
International Symposium on Electrical Engineering and Energy Converters September 24-25, 2009, Suceava
139
Fig. 3 Motion control scheme of an induction motor, operating in sinusoidal mode (vector control)
Fig. 4 The vector control scheme in MATLAB-Simulink
IV. C CODE GENERATION
At this level it is generating code C/C++ for all blocks
involved in the simulated system in order that they are
implemented and tested on a DSP controller (in this case
TMS320F2812). To do this the program uses Real Time
Workshop, offered by MATLAB working environment. It
helps generate a file C/C++ complete for each of the blocks
that were used to model the control system, as seen in Fig.5.
Thus, you will get the code to be embedded on the DSP,
implementing for example coordinate transformations,
current/speed/position controllers, etc. Specific
implementation aspects as fixedpoint numerical
representation can also be applied, including scaling,
overflow and saturation. Specific numerical representations
(as the IQ Math format) can be used to generate code that
can be correctly implemented and executed at DSP level [3].
V. IMPLEMENTATION OF THE DSP REAL TIME
APPLICATION
The C code generated from MATLAB is finally included
in a basic real-time interrupt application, which can be
executed on a TMS320F2812 DSP controller based module.
Using the Digital Motor Control Developer Pro (DMCD-
Pro) IDE platform, you will be able to download and run the
application on the real digital control environment (Fig. 6).
Also this program allows you to use some graphical tools
for analysis and could thus generate a graph of motion as a
benchmark for the system and can see how varied the
parameters of the system. The values are shown graphically
are saved in a first phase the memory controller, saving is
made in real time as they are transferred to the user's
computer and displayed graphically.
At this level, you can finally compare results obtained
from system simulation with the ones obtained in the real
time application.
i_a[bits]
i_b[bits]
i_c[bits]
spd_controller0
SLIP
COMPENSATION
sl ip0
sinsin_theta
iq_controller0
id_controller0
Id_ref
i_d_ref
cos cos_theta
z
1
Unit Delay
Power
module
UQ-ref + UD_ref
[biti]
UA +UB + UC
[A]
TETA
[RAD]
Transform
dq->abc
TDQ2ABC0
Transform
abc->dq
TABC2DQ0
Speed
reference
Copy
Rate Transition
REFERINTA DE VITEZA +
VITEZA MASURATA
[counts/sampl ing]
OMEGA
[RAD/S]
0.1 Mr [Nm]
IM
Induction Motor
IQ_ref +
ID_ref
[A]
IQ_reactie
ID_reactie
IA +IB
[A]
double
double
double
double
Convert
Convert
Convert
Convert
Convert
Convert
Convert
FLUX ROTORIC
[A]
Encoder
-K-
-K-
A/D
Current Measurement
CUPLU
ELECTROMAGNETIC
omg_mech
[counts/sampling]
iq[bits]
iq[bits]
id_ref [bits]
id[bits]
uq_ref [bits]
ud_ref [bits]
ua_ref [bits]
ub_ref [bits]
uc_ref [bits]
u_a [V]
theta_mech[rad]
spd_ref
[counts/sampling]
u_b [V]
u_c [V]
iq_ref [bits]i_a[A]
i_b[A]
theta_mech[counts]
speed
[counts/sampling]
speed
[counts/sampling]
speed
[counts/sampling]
140
Fig. 5 Using Real Time Workhop for C/C++ code generation
Fig. 6 Real-time Digital Motor Control Developer-Pro IDE platform
VI. EXPERIMENTAL RESULTS
Simulation of vector drive system described in Fig.4
presents the operation of a three phase induction motor with
rotor cage prescribing a reference speed. Throughout the
simulation, the induction motor was applied to the rotor a
resistant torque of 0.05 Nm. Parameters correspond to a
induction motor with power of 370W.
Drive system includes in addition to three phase induction
motor powered by a PWM inverter, two blocks performing
transformations of axes of DQ in ABC and the ABC in DQ,
a block is to compensate the rotor slip (SLIP
COMPENSATION), a block (A / D) which is to convert the
currents of the two phase of analog to digital, and three PI
regulators. An PI block is designed for speed regulator and
the other two serve as current regulators, one for component
Iq and one for component Id.
The entire drive system simulating vector control of
induction motor through a DSP. For this reason all units
with working digital signal processor are converted into bits
and scaled with the appropriate scale factor. Scale factor is
chosen for each size separately in line with current and
speed transducers which are used basically to measure the
strength parameters of the circuit.
In Fig.7 are presented simulation results of vector drive
system. In Fig.7 a) is present in blue prescribed speed and
the green speed at which the engine worked, where 100 bits
is 3000 rpm. In Fig.7 c) are presented current response after
the component Id and the Fig.7 d) real current component
has been established for Iq.
3rd
International Symposium on Electrical Engineering and Energy Converters September 24-25, 2009, Suceava
141
Fig. 7 a) Prescribed speed and the actual speed
of the system
Fig. 7 b) Reference of current component Iq and Id
Fig. 7 c) Current component Id
Fig. 7 d) Current component Iq
Fig.7 e) Electromagnetic torque
In Fig. 7 f) is presented as the variation of three phase
stator currents. Note that currents go to high levels during
the regimes of variation of speed between two constant
values of speed. Large amount of current is an image of
component Iq which produces torque in the motor, while the
lower value of current is an image of component Id which
produces magnetic field in the motor.
Fig.7 f) Three phase stator currents
In Fig. 8 are presented the results of practical
implementation a drive system on digital signal processor
TMS320F2812.
To make a comparison as well between the values
obtained by simulating the control system and the values
obtained by direct measurements, have been prescribed as a
reference speed of Fig.8 a), the same reference is used and
for simulation. In Fig.8 a) is presented in black prescribed
speed and with red the speed at which the engine worked.
In Fig.8 b) is presented the stator current Iq_ref and in
Fig.8 c) how the varied current Iq.
If a comparison is made between results obtained by
simulation and results are determined practically almost
finds no major differences, validating the correctness of this
vector drive system simulation.
142
Fig. 8 a) Prescribed speed and the real speed of the system
Fig. 8 b) Reference of current component Iq_ref
Fig. 8 c) Current component Iq
VII. CONCLUSION
Such a system design of drive not only significantly
reduces the development time, but also lets you focus on the
application functionality and performance, thus shortening
the road from design and laboratory phase and from there to
industrial application level.
APPENDIX A
Photographs of the experimental stand
REFERENCES
[1] K B. Bose. Power electronics and ac drives, New Jersey 07632 :
Prentice Hall.
[2] Instruments, Texas. Digital Motor Control SPRU485A. Dallas, Texas
75265 : Texas Instruments, August 2001.
[3] Technosoft. DMCode-MS(IM) MATLAB Library User Manual.
Chemin de Buchaux 38 Switzerland : Technosoft, 2006.
0 1 2 3 4 5
x1e3
-150
-75
0
75
150
Acquisition time
SpdRef Spd
0 1 2 3 4 5
x1e3
-15
-7.5
0
7.5
x1e3
Acquisition time
IqRef
0 1 2 3 4 5
x1e3
-10
-5
0
5
10
x1e3
Acquisition time
Iq