PMSM Control
PMSM Control
PMSM Control
and Simulink
to
Real Time with TI DSPs
Sensored Field Oriented
Control of a Permanent Magnet
Synchronous Motor
(PMSM)
Slide 2
2007 Texas Instruments Inc,
Learning objectives
Review of Electromagnetic laws
Rotating magnetic fields
Structure of synchronous motors
Features of synchronous motors
BLDC and PMSM synchronous motor types
BLDC and PMSM control overview
Electro-mechanical parameters for a
synchronous motor
Slide 3
2007 Texas Instruments Inc,
Field generated by a current
I
Field
I
I
A conductor carrying a current produces a magnetic field around it.
A conductor that is wound into a coil produces a magnetic field
along the axis of the coil.
The flux produced is proportional to the current through the coil
and the number of turns in the coil.
B = k*n*I
Slide 4
2007 Texas Instruments Inc,
The Current in a Coil
A coil carrying a current,
placed in a magnetic field
experiences a force that
will cause it to rotate.
This force is given as the
vector cross product of
the flux produced by the
coil and the flux that is
impressed by the
external magnetic field.
I
B1
B2
F2
F1
d
( ) d B2 B1 T
B2 x B1 F2 F1
- - =
= =
Slide 5
2007 Texas Instruments Inc,
Back EMF generation
Magnet rotating in front of winding a create an inductive
voltage between A and B, e = V
A
-V
B
called Bemf (Back
electromotive force)
Magnetic flux seen by the winding is given by:
Bemf is then equal to:
t O = cos 2 |
O =
O = O O = =
2
) sin( ) sin( 2 ) (
|
|
E
t E t
dt
d
t e
S
N
e
a
A
B
) / ( s rad O
u
| Magnet flux
Slide 6
2007 Texas Instruments Inc,
Pole pairs
N
S
N
S
S
N
For a motor with p poles pairs we have
O = = e e with ) sin( ) ( t E t e
O = p e
1 pole pair 2 pole pairs
is the electrical frequency (rad/s)
is the mechanical frequency (rad/s) or simply
the speed of the machine.
e
O
O = = 2 with ) sin( ) ( e et E t e
e e
N
N
Slide 7
2007 Texas Instruments Inc,
Three phases winding
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
Slide 8
2007 Texas Instruments Inc,
Application to Three Phases Machine
Operation Fundamentals
-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.
Slide 9
2007 Texas Instruments Inc,
Synchronous operation
Three
phase AC
current
Phase 1
Coil 1
Phase 2
Coil 2
Phase3
Coil 3
Three
phase AC
current
Phase 1
Coil 1
Phase 2
Coil 2
Phase3
Coil 3
Three
phase AC
current
Phase 1
Coil 1
Phase 2
Coil 2
Phase3
Coil 3
Three
phase AC
current
Phase 1
Coil 1
Phase 2
Coil 2
Phase3
Coil 3
Three
phase AC
current
Phase 1
Coil 1
Phase 2
Coil 2
Phase3
Coil 3
Three
phase AC
current
Phase 1
Coil 1
Phase 2
Coil 2
Phase3
Coil 3
Slide 10
2007 Texas Instruments Inc,
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
Theory of operation:
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
Slide 11
2007 Texas Instruments Inc,
Electromechanical Parameters
v
e
stator
u
L
i
Simplified equivalent electrical scheme of a
winding of a three phases synchronous motor
Note: stator resistance neglected
I
V
u
L
E
s
O
O
=
) / ( speed rotation motor :
) ( current phase :
) ( voltage phase :
) . ( torque hanical electromec :
cos 3
s rad
I I
V V
m N T
VI
T
em
em
Slide 12
2007 Texas Instruments Inc,
Synchronous Motor Rotor
Construction
non-salient rotor
pole (p=1)
non-salient rotor
pole (p=2)
salient rotor pole
(p=2)
Slide 13
2007 Texas Instruments Inc,
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
-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
ea eb ec
Back EMF of PMSM
A
`
B
C
`
A
B
`
C
S
F
F
Synchronous machine
classification: BLDC and PMSM
N
Slide 14
2007 Texas Instruments Inc,
BLDC vs. PMSM
BLDC
Synchronous machine
Fed with direct currents
Trapezoidal BEMF
Stator Flux position
commutation each 60 degrees
Only two phases ON at the
same time
Torque ripple at
commutations
PMSM
Synchronous machine
Fed with sinusoidal currents
Sinusoidal BEMF
Continuous stator flux
position variation
Possible to have three
phases ON at the same time
No torque ripple at
commutations
Slide 15
2007 Texas Instruments Inc,
Conclusion
Synchronous motors use magnetic interaction
to convert electrical energy to mechanical.
Rotor must be synchronized with the rotating
stator magnetic field in order to produce
torque
Pole pair numbers and excitation frequency
determine the mechanical rotation speed
Synchronous motors are classified in two
categories: BLDC and PMSM
Each type require an appropriate control
Slide 16
2007 Texas Instruments Inc,
PMSM Control
Synchronous Motors such as PM motors
and SynRMs are getting more popular
because of their high power density and
high efficiency
PM Assisted SynRM uses advantages of
both PM and Reluctance motor
The vector control strategy is far more
complicated than control of a DC motor
requiring use of multiple control loops
Slide 17
2007 Texas Instruments Inc,
E PI E
E
PI
PI
S
V
PWM
3-phase
Inverter
PMASynRM
abc
-
e
i
-
-
Vdc
Clarke
Transformation
Park
Transformation
Inv. Park
Transformation
u
r
+
+
+
Mechanical Speed and
position of rotor
ds
e*
i
qs
e*
v
qs
e*
v
ds
e*
v
qs
s*
v
ds
s*
i
ds
s
i
qs
s
i
ds
e
i
qs
e
dq
s
s
dq
s
e
dq
s
e
dq
s
s
dq
s
s
ref
Control System Block-Diagram
Slide 18
2007 Texas Instruments Inc,
Using the DMC Library
3-Phase
Inverter
QEP
SV_GEN
DQ
_IQ
Vq
Vd
Ta
Tb
Tc
PARKI
_IQ
Ipark_D
Ipark_Q
theta
Ipark_d
Ipark_q
CLARK
_IQ
clark_a
clark_b
clark_c
clark_d
clark_q
PARK
_IQ
park_d
park_q
theta
park_D
park_Q
PID
_IQ
ref
fb
Uout
PID
_IQ
ref
fb
Uout
PID
_IQ
ref
fb
Uout
Speed
setpoint
id_ref =0
QEP
THETA
DRV
_IQ
QEP_A theta_elec
theta_mech
dir_QEP
index_sync_flg
QEP_A
QEP_index
SPEED
FRQ
_IQ
shft_angle
direction
speed_frq
speed_rpm
FC_PWM
DRV
Q0 / HW
mfunc_c1
PWM1A
PWM1B
PWM2A
PWM2B
PWM3A
PWM3B
mfunc_c2
mfunc_c3
mfunc_p
ILEG2
DRV
_IQ
Ia_out
Ib_out
LEG_A
LEG_B
Ia_gain
Ib_gain
Ia_offset
Ib_offset
Q15
Q15
Q13
Q13
PMSM
Motor
Slide 19
2007 Texas Instruments Inc,
The Equivalent Simulink
Model
TMS320F28x controller
v
as
*
v
bs
*
Inv.
Park
Space
Vector
Gen.
T
a
T
b
T
c
PMSM
i
as
i
bs
Ileg2_
Bus
Driver
ADCIN1
ADCIN2
ADCIN3
i
bs
Park Clarke
i
as
QEP_A
SMOSPD
speed
estimation
dir
v
qs
*
v
ds
*
PI
i
qs
*
PI
q
lr
v
ds
*
PI
q
lr
w
r
i
qs
Encoder
QEP_B
QEP_inc
q
m
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds
i
ds
*
Ramp
Gen.
QEP
driver
PWM
Driver
Voltage
Source
Inverter
Slide 23
2007 Texas Instruments Inc,
Hardware Setup
P
e
r
m
a
n
e
n
t
M
a
g
n
e
t
S
y
n
c
h
r
o
n
o
u
s
M
o
t
o
r
Encoder
+
-
Power Supply
24 Volts 4 Amps
Power Supply
5V
2 Power inputs:
5V PSU for the DSP board only (software debug)
0 - 24V PSU for the power stage
P3 P4 P5
analog
I/O
P6
P7
eZdsp 2812
DMC 550
P
a
r
a
l
l
e
l
P
o
r
t
Motor phases
Encoder signal
Slide 24
2007 Texas Instruments Inc,
Synchronous Reluctance Motor
Two pole singly
salient SynRM
Two pole doubly salient
Switched RM
Slide 25
2007 Texas Instruments Inc,
ds r
qs
qs s q
qs r
ds
ds s d
dt
d
i r v
dt
d
i r v
e
+ + =
+ =
m qs qs m qs mq qs ls qs
ds ds ds md ds ls ds
i L i L i L
i L i L i L
+ = + + =
= + =
( )
ds qs qs ds e
i i
P
T =
2 2
3
qs ds qs ds e
I I L L
P
T ) (
2 2
3
=
c
c
sin
cos
s qs
s ds
I I
I I
=
=
d-q axes voltage and flux equations:
Torque equation:
q-axis
d-axis
ds
V
qs
V
qs qs
I jX
ds ds
I jX
s s
I r
s
V
~
s
I
~ ds
I
qs
I
o
c
Background
Slide 26
2007 Texas Instruments Inc,
) (
m qs qs r
ds
ds ds s ds
i L
dt
di
L i r v e + + =
ds ds r
qs
qs qs s qs
i L
dt
di
L i r v e + + =
( )
qs ds qs ds ds m e
i i L L i
P
T ) (
2 2
3
+ =
Output Torque in MASynRM
Slide 27
2007 Texas Instruments Inc,
The PMS Motor Model
Slide 28
2007 Texas Instruments Inc,
Model-Based Design of a PMSM
Build Level 1 Space vector generation
Build Level 2 - Currents/DC-bus voltage
measurement verification
Build Level 3 - Tuning of dq-axis current closed loops
Build Level 4 Encoder verification
Build Level 5 Speed closed loop
Slide 29
2007 Texas Instruments Inc,
Space vector generation - Simulation
Slide 30
2007 Texas Instruments Inc,
Space vector generation Real Time
v
os
*
v
|s
*
Inv.
Park
Space
Vector
Gen.
PWM
Driver
T
a
T
b
T
c
Vq_testing
v
ds
*
rmp_out
Vd_testing
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
speed_ref
Ramp
Gen.
Ramp
control
key modules under test
TMS320F28x controller
Voltage
Source
Inverter
PMSM
Slide 31
2007 Texas Instruments Inc,
Currents/DC-bus voltage measurement
verification - Simulation
Slide 32
2007 Texas Instruments Inc,
Currents/DC-bus voltage measurement
verification Real Time
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
v
ds
*
Vq_testing
i
qs
Encoder
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds
Ramp
Gen.
Speed_ref
Ramp
control
u
e
rmp_out
TMS320F28x controller
Slide 33
2007 Texas Instruments Inc,
Tuning of dq-axis current closed loops
- Simulation
Slide 34
2007 Texas Instruments Inc,
Tuning of dq-axis current closed loops
Real Time
key module under test
Ramp
Gen.
Speed_ref
Ramp
control
Iq_ref
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
*
TMS320F28x controller
Slide 35
2007 Texas Instruments Inc,
Encoder verification - Simulation
Slide 36
2007 Texas Instruments Inc,
Encoder verification Real Time
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_ele
c
i
qs
Encoder
QEP_B
QEP_inc
u
m
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds
Ramp
Gen.
QEP
driver
Ramp
Gen.
Speed_ref
Ramp
control
Iq_ref
Id_ref
TMS320F28x
controller
Slide 37
2007 Texas Instruments Inc,
Speed closed loop - Simulation
Slide 38
2007 Texas Instruments Inc,
Speed closed loop Real Time
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
SMOSPD
speed
estimation
dir
v
qs
*
v
ds
*
PI
i
qs
*
PI
u
r
v
ds
*
PI
u
r
e
r
i
qs
Encoder
QEP_B
QEP_inc
u
m
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
i
ds
i
ds
*
Ramp
Gen.
QEP
driver
TMS320F28x controller