You are on page 1of 41

15 - 1

Texas Instruments Incorporated


European Customer Training Centre
University of Applied Sciences Zwickau (FH)
Module 15 : C28x Digital Motor Control
32-Bit-Digital Signal Controller
TMS320F2812
15 - 2
Electrical Motor families
Motor Classification:
Direct Current Motors (DC)
Alternating Current Motors (AC)
Asynchronous Induction Motor (ACI)
Permanent Magnet Synchronous Motor
(PMSM)
Synchronous Brushless DC Motor (BLDC)
15 - 3
3 Phase - Motor (PMSM)
For most three phase machines, the winding is stationery, and
magnetic field is rotating
Three phase machines have three stator windings, separated
120 apart physically
Three phase stator windings produce three magnetic fields,
which are spaced 120in time

=
=
=

3
4
3
2
.
.
.
t
e
t
e
e
t j
S c
t j
S b
t j
s a
e I i
e I i
e I i

=
=
=
O
O
O
3
4
3
2
.
.
.
t
t
t jp
c
t jp
b
t jp
a
e E e
e E e
e E e
N
S
a
c
b
i
a
i
c
i
b
15 - 4
-1,50
-1,00
-0,50
0,00
0,50
1,00
1,50
1 24 47 70 93 116 139 162 185 208 231 254 277 300 323 346
et
ia ib
ic
Phase currents
A`
A
Fa
B
C
`
C
B`
ia
Fb
Fc
Three stationary pulsating magnetic fields
The three phase winding
produces three magnetic
fields, which are spaced
120 apart physically.
When excited with three
sine waves that are a 120
apart in phase, there are
three pulsating magnetic
fields.
The resultant of the three
magnetic fields is a rotating
magnetic field.
3 Phase - Motor
15 - 5
Rotor is carrying a constant
magnetic field created either
by permanent magnets or
current fed coils
The interaction between the
rotating stator flux, and the
rotor flux produces a torque
which will cause the motor to
rotate.
The rotation of the rotor in this case will be at the same exact
frequency as the applied excitation to the rotor.
This is synchronous operation.
Rotor field
A`
B
C`
A
B`
C
N
S
|
Stator field
S
N
Synchronous Motor
phase per pair poles motor : p
(Hz) frequency supply AC :
(r.pm)
. 60
: (rad/s) speed Rotor
f
p
f
gives
p
e
= O
Example: a 2 poles pair
synchronous motor will
run at 1500 r.pm for a
50Hz AC supply
frequency
15 - 6
Both (typically) have permanent-magnet rotor and a
wound stator
BLDC (Brushless DC) motor is a permanent-magnet
brushless motor with trapezoidal back EMF
PMSM (Permanent-magnet synchronous motor) is a
permanent-magnet brushless motor with sinusoidal
back EMF
30
0
90
0
150
0
210
0
270
0
330
0
30
0
90
0

60
0
0
0
120
0
180
0
240
0
300
0
360
0
60
0

Phase A
Phase B
Phase C
i
a

i
b

i
c

u
e

u
e

u
e

E
a

Hall A
Hall B
Hall C
Back EMF of BLDC Motor
et
ea eb
ec
Back EMF of PMSM
A
`
B
C
`
A
B
`
C
N
S
F
F
Synchronous Motors: BLDC and PMSM
-1,50
-1,00
-0,50
0,00
0,50
1,00
1,50
1 24 47 70 93 116 139 162 185 208 231 254 277 300 323 346
15 - 7
Power
Switching
Devices
3 - phase
outputs to motor
terminals
+

Upper & lower
devices can not
be turned on
simultaneously
(dead band)
Six PWM signals
to control
Power Switches
DC - Voltage
3 Phase Voltage Inverter
15 - 8
Scalar Control Scheme ( V/f )
e*
PI
3-
Phase
Inverter
PWM
Command
E
+
PWM1
PWM2
PWM3
PWM5
PWM4
PWM6
V
f
V/f profile
Speed scaling
Speed calculator
+ Simple to implement: All you need is three sine
waves feeding the motor
+ Position information not required (optional).

Doesnt deliver good dynamic performance.
Torque delivery not optimized for all speeds
15 - 9
Field Oriented Control (FOC)
Field Oriented Control (FOC) or Vector
Control, is a control strategy for 3-phases
induction motors where the torque
producing and magnetizing components
of the stator flux are separately
controlled.
The approach consists in imitating the
DC motors operation
FOC will be possible with system
information: currents, voltages, flux and
speed.
15 - 10
FOC control scheme
Some key mathematical components are required!
e
PID
d,q
a,b,c
3-
Phase
Inverter
Space
Vector
PWM
E E
V
q

V
d

V
Q

V
D

i
a

i
b

I
q

I
d

I
Q

I
D

I
Q

I
D

+
+
+
e
r

q
r

i
c


: i
a
+ i
b
+ i
c
= 0
PWM1
D,Q
d,q
Park T
Clarke T


E
q
r

PWM2
PWM3
PWM5
PWM4
PWM6
Field Weakening
Controller
Speed
Calculator
Inverse Park
D,Q
d,q
PID
PID
15 - 11
PARK transform (1929):
(Vs): voltage vector applied
to motor stator (index s)
(
(
(

=
3
2
1
) (
S
s
s
S
v
v
v
V
Park transform is a referential change
| | | |
(
(
(

=
(
(
(

(
(
(

=
(
(
(

(
(
(

(
(
(
(
(
(

=
(
(
(

3
2
1
1
3
2
1
3
2
1
) ( and . ) (
1 )
3
4
sin( )
3
4
cos(
1 )
3
2
sin( )
3
2
cos(
1 sin cos
S
S
s
S
So
Sq
sd
so
sq
sd
S
S
S
s
So
Sq
sd
S S
S S
S S
s
s
s
v
v
v
P
v
v
v
v
v
v
P
v
v
v
v
v
v
v
v
v
u u
t
u
t
u
t
u
t
u
u u
1 s
v
3 s
v
2 s
v
sd
v
sq
v
0 =
so
v
t
S S
e u =
15 - 12
Park Transform key components
1 s
v
3 s
v
2 s
v
sd
v
sq
v
0 =
so
v
t
S S
e u =
(v
sd,
v
sq,
v
so
) are called the Park coordinates
v
sd
: direct Park component
v
sq
: squaring Park component
v
so
: homo-polar Park component
V
so
is null for a three-phases balanced system
Each pair of components is perpendicular to each other

=
=
=
= + +
0 .
0 .
0 .
system) balanced phases - (tri 0
3 2 1
So Sq
So Sd
Sq Sd
S S S
v v
v v
v v
v v v



15 - 13
CLARKE Transformation
Transform is usually split into CLARKE transform and one rotation
CLARKE converts balanced three phase quantities into balanced two
phase orthogonal quantities
t
S S
e u =
v
1
= v
o
v
3
v
2
v
|
3
. 2
1 2
1
v v
v
v v
+
=
=
|
o
v
d
v
q
(
(
(

(
(
(

(
(
(

=
|
o
u u
u u
v
v
S S
S S
q
v
d
v
) cos( ) sin(
) sin( ) cos(
CLARKE
+
Rotation
PARK TRANSFORM
15 - 14
PARK Transform summary
Clarke
v
1
v
2
v
3
v
o
v
|
Park
V
d
V
q
Three phase rotating
domain
Two phase rotating
domain
Stationary domain
1 s
i
3 s
i
2 s
i
0 =
so
i
t
S S
=e u
I
S
I
Sd
I
Sq
Stator phase current
example: I
s
is moving at
S

and its PARK coordinates
are constant in (d,q) rotating
frame.
Can be applied on any three-
phase balanced variables
(flux)
d

q


15 - 15
Texas Instruments Motor Control Solution
C2000 - Digital Motor Control Library (DMC) :

Single Phase ACI Motor Control Using Constant
V/Hz
3-Phase ACI Motor Constant V/Hz Control
3-Phase ACI Motor Field Oriented Control
3-Phase Sensored Field Oriented Control (PMSM)
3-Phase Sensorless Field Oriented Control
(PMSM)
3-Phase Sensored Trapezoidal Control (BLDC)
3-Phase Sensorless Trapezoidal Control (BLDC)
15 - 16
Digital Motor Control Library (DMC-Lib)
The DMC-Library is a collection of most
commonly used algorithms and function
blocks for motor control systems
For every algorithm and function:
Essential theoretical background information

Data types for input/output parameters with
numerical range and precision

Function prototypes and calling conventions

code size (program and data memory)

Build Level based code examples

15 - 17
Digital Motor Control Library (DMC-Lib)
The DMC-Lib contains
PID regulators,
Clarke transformers,
Park transformers,
Ramp generators,
Sine generators,
Space Vector generators,
Impulse generators,
and more
15 - 18
Laboratory: FOC for PMSM
TMS320F28x controller
v
os
*

v
|s
*

Inv.
Park
Space
Vector
Gen.
PWM
Driver
T
a

T
b

T
c

Voltage
Source
Inverter
PMSM
i
as

i
bs

Ileg2_
Bus
Driver
ADCIN1
ADCIN2
ADCIN3
i
|s

Park Clarke
i
os

QEP_A
SPEED
FRQ
dir
v
qs
*

v
ds
*

PI
i
qs
*

PI
u
r
v
ds
*

PI
e
r

i
qs

Encoder
QEP_B
QEP_inc
u
e
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds

i
ds
*

QEP
THETA
DRV
15 - 19
TI Library Solution PMSM 3-1 (sprc129)
Hardware for Laboratory setup:

Spectrum Digital eZdsp TMS320F2812
Spectrum Digital DMC550 drive platform
3-phase PMSM with a QEP encoder
Applied Motion 40mm Alpha Motor
Type: A0100-104-3-100
24V DC power supply ( DC bus voltage )
load , e.g. DC Motor as Generator
PC parallel port to JTAG
5V DC ( eZdsp )
RS232 ( optional )
Oscilloscope

15 - 20
TI Library Solution PMSM 3-1 (sprc129)
eZdsp
DMC 550
PMSM 3-1
Load
24V
PC- parallel port
5V DC
RS232
(optional)
15 - 21
PMSM 3-1 Laboratory
Student Workbench
15 - 24
Build Level 1
TMS320F28x controller
v
os
*

v
|s
*

Inv.
Park
Space
Vector
Gen.
PWM
Driver
T
a

T
b

T
c

Vq_testing
rmp_out

Vd_testing
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
speed_ref
Ramp
Gen.
Ramp
control
key modules under test
15 - 25
Code Composer Studio with
Real Time Mode
1. Load a workspace file pmsm3_1.wks
2. In build.h, #define BUILDLEVEL LEVEL1
3. Rebuild all
4. Load program to target
(..\pmsm3_1.out)
15 - 26
5. In Debug menu, Reset CPU and then set
Real-time Mode. Then, click Yes when the
message box pops up.
6. Click Run icon
Code Composer Studio with
Real Time Mode
15 - 27
8. Set enable_flg to 1 in watch window.
(to enable T1UF interrupt and PWM drive on DMC550)
7. Right click on watch window. Then, check
Continuous Refresh.
Code Composer Studio with
Real Time Mode
15 - 28
Changing !!
watch window
for build 1
Code Composer Studio Level 1
15 - 29
Results: Build Level 1
rmp_out
Ta
15 - 30
Build Level 2 Current verification
TMS320F28x controller
v
os
*

v
|s
*

Inv.
Park
Space
Vector
Gen.
PWM
Driver
T
a

T
b

T
c

Voltage
Source
Inverter
PMSM
i
a

i
b

Ileg2_
Bus
Driver
ADCIN1
ADCIN2
ADCIN3
i
|s

Park Clarke
i
os

Vq_testing
Vd_testing
i
qs

Encoder
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds

Ramp
Gen.
Speed_ref
Ramp
control
u
e
key module under test
rmp_out
15 - 31
Instructions: Build Level 2
1. Tune the 24V Power Supply to 10 Volts with 1 Amp limit
2. Load a workspace file pmsm3_1.wks
3. In build.h, #define BUILDLEVEL LEVEL2
4. Reset CPU, Compile, Load, start RTM and Run
5. Switch on 24V Power Supply
6. Set variable enable_flg to 1 in watch window.
7. Try to change motor speed by setting speed_ref (p.u.)
in watch window. Then, motor should change its speed
accordingly.
15 - 32
Results: Build Level 2
1. PMSM should run open-loop smoothly
2. The currents in the motor phases should be
sinusoidal.
15 - 33
Build Level 3 - Tuning of dq-axis current closed loops
TMS320F28x controller
Ramp
Gen.
Speed_ref
Ramp
control
Iq_ref
key modules under test
v
os
*

v
|s
*

Inv.
Park
Space
Vector
Gen.
PWM
Driver
T
a

T
b

T
c

Voltage
Source
Inverter
PMSM
i
a

i
b

Ileg2_
Bus
Driver
ADCIN1
ADCIN2
ADCIN3
i
|s

Park Clarke
i
os

i
ds
*

PI
PI
rmp_out

i
qs

Encoder
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds

Id_ref
v
qs
*

v
ds
*

15 - 34
Instructions: Build Level 3
1. In build.h, #define BUILDLEVEL LEVEL3
2. Compile, Load, start RTM and Run
3. Set enable_flg to 1 in watch window.
4. Tune-up the PI
Observe dq-axis current regulations at PI inputs (i.e., reference and feedback). For
example, pid1_iq.pid_ref_reg3 and pid1_iq.pid_fdb_reg3.
Try to change motor speed by setting speed_ref (p.u.) in watch window . Then,
observe dq-axis current regulations.
P
I
D
out
ref
fdb
15 - 35
Build Level 4 Encoder verification
TMS320F28x controller
v
os
*

v
|s
*

Inv.
Park
Space
Vector
Gen.
PWM
Driver
T
a

T
b

T
c

Voltage
Source
Inverter
PMSM
i
a

i
b

Ileg2_
Bus
Driver
ADCIN1
ADCIN2
ADCIN3
i
|s

Park Clarke
i
os

QEP_A
dir
v
qs
*

v
ds
*

PI
rmp_out

v
ds
*

PI
Theta_elec

i
qs

Encoder
QEP_B
QEP_inc
u
m
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds

QEP
THETA
DRV
Ramp
Gen.
Speed_ref
Ramp
control
Iq_ref
Id_ref
15 - 36
Instructions: Build Level 4
1. In build.h, #define BUILDLEVEL LEVEL4
2. Compile, Load, start RTM and Run
3. Set the DC-bus to 24 Volts 1 Amp
4. Set enable_flg to 1 in watch window.
15 - 37
Results: Build Level 4
Emulated angle VS sensed angle
15 - 38
Results: Build Level 4
Speed reference VS real speed
15 - 39
Build Level 5 close speed loop
TMS320F28x controller
v
os
*

v
|s
*

Inv.
Park
Space
Vector
Gen.
PWM
Driver
T
a

T
b

T
c

Voltage
Source
Inverter
PMSM
i
as

i
bs

Ileg2_
Bus
Driver
ADCIN1
ADCIN2
ADCIN3
i
|s

Park Clarke
i
os

QEP_A
SPEED
FRQ
dir
v
qs
*

v
ds
*

PI
i
qs
*

PI
u
r
v
ds
*

PI
e
r

i
qs

Encoder
QEP_B
QEP_inc
u
e
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds

i
ds
*

QEP
THETA
DRV
15 - 40
Instructions: Build Level 5
1. In build.h, #define BUILDLEVEL LEVEL5
2. Compile, Load, start RTM and Run
3. Set the DC-bus to 24 Volts
4. Set enable_flg to 1 in watch window.
15 - 41
Results: Build Level 5
Fastest response time with
the closed loop!
15 - 42
Application of PMSM 3-1:
img GmbH Nordhausen

You might also like