15 - 1 texas instruments incorporated european customer training centre university of applied...
TRANSCRIPT
15 - 15 - 11
Texas Instruments Incorporated
European Customer Training Centre
University of Applied Sciences Zwickau (FH)
Module 15 : C28x Digital Motor ControlModule 15 : C28x Digital Motor Control
32-Bit-Digital Signal ControllerTMS320F2812
15 - 15 - 22
Electrical Motor familiesElectrical Motor families
Motor Classification:Motor Classification:Direct Current Motors (DC)Direct Current Motors (DC)Alternating Current Motors (AC)Alternating Current Motors (AC)
Asynchronous Induction Motor (ACI)Asynchronous Induction Motor (ACI) Permanent Magnet Synchronous Motor Permanent Magnet Synchronous Motor
(PMSM)(PMSM) Synchronous Brushless DC Motor (BLDC)Synchronous Brushless DC Motor (BLDC)
15 - 15 - 33
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 120°in time
3
4
3
2
.
.
.
tj
Sc
tj
Sb
tjsa
eIi
eIi
eIi
3
4
3
2
.
.
.
tjp
c
tjp
b
tjpa
eEe
eEe
eEe
N
S a
c
b
ia
ic
ib
15 - 15 - 44
-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 346t
ia ib icPhase 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 The resultant of the three magnetic fields is a magnetic fields is a rotating rotating magnetic fieldmagnetic field..
3 – Phase - Motor
15 - 15 - 55
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 fieldA`
B
C`
AB`
C N
S
F
F Stator field
S
N
Synchronous Motor
phaseper pair polesmotor :p
(Hz)frequency supply AC :
(r.pm) .60
:(rad/s) speedRotor
f
p
fgives
p
Example: a 2 poles pair
synchronous motor will run at 1500 r.pm for a 50Hz AC supply frequency
15 - 15 - 66
Both (typically) have permanent-magnet rotor and a Both (typically) have permanent-magnet rotor and a wound statorwound stator
BLDC (Brushless DC) motor is a permanent-magnet BLDC (Brushless DC) motor is a permanent-magnet brushless motor with trapezoidal back EMFbrushless motor with trapezoidal back EMF
PMSM (Permanent-magnet synchronous motor) is a PMSM (Permanent-magnet synchronous motor) is a permanent-magnet brushless motor with sinusoidal permanent-magnet brushless motor with sinusoidal back EMFback EMF
300 900 1500 2100 2700 3300 300 900
60000 1200 1800 2400 3000 3600 600
Phase A
Phase B
Phase C
ia
ib
ic
e
e
e
Ea
Hall A
Hall B
Hall C
Back EMF of BLDC Motor
t
ea eb ec
Back EMF of PMSM
A`
B
C`
AB`
C N
S
F
F
Synchronous Motors: BLDC and PMSMSynchronous 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 - 15 - 77
PowerSwitchingDevices
3 - phaseoutputs to motorterminals
Upper & lowerdevices can notbe turned on simultaneously(dead band)
Six PWM signalsto control Power Switches
DC - Voltage
3 – Phase Voltage Inverter 3 – Phase Voltage Inverter
15 - 15 - 88
Scalar Control Scheme ( “ V/f ” ) Scalar Control Scheme ( “ V/f ” )
* PI3-
PhaseInverter
PWMCommand
+PWM1PWM2PWM3
PWM5PWM4
PWM6
V
fV/f profile
Speed scaling
Speed calculator
+ Simple to implement: All you need is three sine waves feeding the motor
+ Position information not required (optional).
– Doesn’t deliver good dynamic performance.– Torque delivery not optimized for all speeds
15 - 15 - 99
Field Oriented Control (FOC)Field Oriented Control (FOC)
Field Oriented Control (FOC) or Vector Field Oriented Control (FOC) or Vector Control, is a control strategy for 3-phases Control, is a control strategy for 3-phases induction motors where the torque induction motors where the torque producing and magnetizing components producing and magnetizing components of the stator flux are separately of the stator flux are separately controlled.controlled.
The approach consists in imitating the The approach consists in imitating the DC motors’ operationDC motors’ operation
FOC will be possible with system FOC will be possible with system information: currents, voltages, flux and information: currents, voltages, flux and speed.speed.
15 - 15 - 1010
FOC control scheme FOC control scheme
Some key mathematical components are required!
PID
d,q
a,b,c
3-PhaseInverter
SpaceVectorPWM
Vq
Vd
VQ
VD
iaib
Iq
Id
IQ
ID
IQ
ID
+
+
+
r
qr
ic†
†: ia + ib + ic = 0
PWM1
D,Q
d,q
Park T Clarke T
qr
PWM2PWM3
PWM5PWM4
PWM6
Field Weakening Controller
Speed Calculator
Inverse Park
D,Q
d,qPID
PID
15 - 15 - 1111
PARK transform (1929):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
11
3
2
1
3
2
1
)( and .)(
1 )3
4sin( )
3
4cos(
1 )3
2sin( )
3
2cos(
1 sin cos
S
S
s
S
So
Sq
sd
so
sq
sd
S
S
S
s
So
Sq
sd
SS
SS
SS
s
s
s
v
v
v
P
v
v
v
v
v
v
P
v
v
v
v
v
v
v
v
v
1sv
3sv
2sv
sdv
sqv
0sov
tSS
15 - 15 - 1212
Park Transform key componentsPark Transform key components
1sv
3sv
2sv
sdv
sqv
0sov
tSS
(vsd, vsq, vso) are called the Park coordinates vsd: direct Park component vsq: squaring Park component vso: homo-polar Park component Vso is null for a three-phases balanced system Each pair of components is perpendicular to each other
0.
0.
0.
system) balanced phases-(tri 0321
SoSq
SoSd
SqSd
SSS
vv
vv
vv
vvv
15 - 15 - 1313
CLARKE – TransformationCLARKE – Transformation
Transform is usually split into CLARKE transform and one rotationTransform is usually split into CLARKE transform and one rotation CLARKE converts balanced three phase quantities into balanced two CLARKE converts balanced three phase quantities into balanced two
phase orthogonal quantitiesphase orthogonal quantities
tSS
v1= v
v3
v2
v
3
.2 12
1
vvv
vv
vd
vq
v
v
SS
SSqvd
v
)cos()sin(
)sin()cos(
CLARKE
+
Rotation
PARK TRANSFORM
15 - 15 - 1414
PARK Transform summaryPARK Transform summary
Clarke
v1
v2
v3
v
vPark
Vd
Vq
Three phase rotating domain
Two phase rotating domain Stationary domain
1si
3si
2si
0soi
tSS
IS
ISd
ISq
Stator phase current example: Is 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 - 1515
Texas Instruments Motor Control SolutionTexas Instruments Motor Control Solution
““C2000 - Digital Motor Control Library (DMC)” :C2000 - Digital Motor Control Library (DMC)” :
Single Phase ACI Motor Control Using Constant Single Phase ACI Motor Control Using Constant V/HzV/Hz
3-Phase ACI Motor Constant V/Hz Control 3-Phase ACI Motor Constant V/Hz Control 3-Phase ACI Motor Field Oriented Control3-Phase ACI Motor Field Oriented Control 3-Phase Sensored Field Oriented Control (PMSM)3-Phase Sensored Field Oriented Control (PMSM) 3-Phase Sensorless Field Oriented Control 3-Phase Sensorless Field Oriented Control
(PMSM)(PMSM) 3-Phase Sensored Trapezoidal Control (BLDC)3-Phase Sensored Trapezoidal Control (BLDC) 3-Phase Sensorless Trapezoidal Control (BLDC)3-Phase Sensorless Trapezoidal Control (BLDC)
15 - 15 - 1616
Digital Motor Control Library Digital Motor Control Library (DMC-Lib)(DMC-Lib)
The DMC-Library is a collection of most The DMC-Library is a collection of most commonly used algorithms and function commonly used algorithms and function blocks for motor control systemsblocks for motor control systems
For every algorithm and function:For every algorithm and function: Essential theoretical background informationEssential theoretical background information
Data types for input/output parameters with Data types for input/output parameters with numerical range and precisionnumerical range and precision
Function prototypes and calling conventionsFunction prototypes and calling conventions
code size (program and data memory)code size (program and data memory)
Build Level based code examples Build Level based code examples
15 - 15 - 1717
Digital Motor Control Library Digital Motor Control Library (DMC-Lib)(DMC-Lib)
The DMC-Lib containsThe DMC-Lib contains PID regulators,PID regulators, Clarke transformers,Clarke transformers, Park transformers,Park transformers, Ramp generators,Ramp generators, Sine generators,Sine generators, Space Vector generators,Space Vector generators, Impulse generators,Impulse generators,
and more…and more…
15 - 15 - 1818
Laboratory: FOC for PMSMLaboratory: FOC for PMSM
TMS320F28x controller
vs*
vs*
Inv. Park
SpaceVector
Gen.
PWMDriver
Ta
Tb
Tc
VoltageSource
Inverter
PMSM
ias
ibs
Ileg2_Bus
Driver
ADCIN1
ADCIN2
ADCIN3is
Park Clarke
is
QEP_ASPEEDFRQ
dir
vqs*
vds*
PIiqs
*
PI
r
vds*
PI
r
iqs
Encoder
QEP_B
QEP_inc
e
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
ids
ids*
QEPTHETA
DRV
15 - 15 - 1919
TI Library Solution “PMSM 3-1” TI Library Solution “PMSM 3-1” (sprc129)(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 - 15 - 2020
TI Library Solution “PMSM 3-1” TI Library Solution “PMSM 3-1” (sprc129)(sprc129)
eZdsp
DMC 550
PMSM 3-1
Load
24V
PC- parallel port
5V DC
RS232(optional)
15 - 15 - 2424
Build Level 1Build Level 1
TMS320F28x controller
vs*
vs*
Inv. Park
SpaceVector
Gen.
PWMDriver
Ta
Tb
Tc
Vq_testing
rmp_out
Vd_testing
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
speed_ref RampGen.
Rampcontrol
key modules under test
15 - 15 - 2525
Code Composer Studio with Code Composer Studio with Real Time ModeReal Time Mode
1.1. Load a workspace file ‘Load a workspace file ‘pmsm3_1.wkspmsm3_1.wks’’
2.2. In build.h, In build.h, #define#define BUILDLEVEL LEVEL1BUILDLEVEL LEVEL1
3.3. Rebuild allRebuild all
4.4. Load program to target Load program to target (..\(..\
pmsm3_1.out)pmsm3_1.out)
15 - 15 - 2626
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 Code Composer Studio with Real Time ModeReal Time Mode
15 - 15 - 2727
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 Code Composer Studio with Real Time ModeReal Time Mode
15 - 15 - 2828
Changing !!
watch window for build 1
Code Composer Studio Level 1Code Composer Studio Level 1
15 - 15 - 3030
Build Level 2 – Current verificationBuild Level 2 – Current verification
TMS320F28x controller
vs*
vs*
Inv. Park
SpaceVector
Gen.
PWMDriver
Ta
Tb
Tc
VoltageSource
Inverter
PMSM
ia
ib
Ileg2_Bus
Driver
ADCIN1
ADCIN2
ADCIN3is
Park Clarke
is
Vq_testing
Vd_testing
iqs
Encoder
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
ids
RampGen.
Speed_ref Rampcontrol
e
key module under test
rmp_out
15 - 15 - 3131
Instructions: Build Level 2Instructions: Build Level 2
1.1. Tune the 24V Power Supply to 10 Volts with 1 Amp limitTune the 24V Power Supply to 10 Volts with 1 Amp limit
2.2. Load a workspace file ‘Load a workspace file ‘pmsm3_1.wkspmsm3_1.wks’ ’
3.3. In build.h, In build.h, #define BUILDLEVEL LEVEL2#define BUILDLEVEL LEVEL2
4.4. Reset CPU, Compile, Load, start RTM and RunReset CPU, Compile, Load, start RTM and Run
5.5. Switch on 24V Power SupplySwitch on 24V Power Supply
6.6. Set variable “enable_flg” to 1 in watch window.Set variable “enable_flg” to 1 in watch window.
7.7. Try to change motor speed by setting “speed_ref” (p.u.) Try to change motor speed by setting “speed_ref” (p.u.) in watch window. Then, motor should change its speed in watch window. Then, motor should change its speed accordingly.accordingly.
15 - 15 - 3232
Results: Build Level 2Results: Build Level 2
1.1. PMSM should run open-loop smoothlyPMSM should run open-loop smoothly
2.2. The currents in the motor phases should be The currents in the motor phases should be sinusoidal.sinusoidal.
15 - 15 - 3333
Build Level 3 - Tuning of dq-axis current closed loopsBuild Level 3 - Tuning of dq-axis current closed loops
TMS320F28x controller
RampGen.
Speed_ref Rampcontrol
Iq_ref
key modules under test
vs*
vs*
Inv. Park
SpaceVector
Gen.
PWMDriver
Ta
Tb
Tc
VoltageSource
Inverter
PMSM
ia
ib
Ileg2_Bus
Driver
ADCIN1
ADCIN2
ADCIN3is
Park Clarke
is
ids*
PI
PI
rmp_out
iqs
Encoder
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
ids
Id_ref
vqs*
vds*
15 - 15 - 3434
Instructions: Build Level 3Instructions: Build Level 3
1.1. In build.h, In build.h, #define#define BUILDLEVEL LEVEL3 BUILDLEVEL LEVEL3
2.2. Compile, Load, start RTM and RunCompile, Load, start RTM and Run
3.3. Set “enable_flg” to 1 in watch window.Set “enable_flg” to 1 in watch window.
4.4. Tune-up the PITune-up the PI• Observe dq-axis current regulations at PI inputs (i.e., reference and feedback). For Observe dq-axis current regulations at PI inputs (i.e., reference and feedback). For
example, “pid1_iq.pid_example, “pid1_iq.pid_refref_reg3” and “pid1_iq.pid__reg3” and “pid1_iq.pid_fdbfdb_reg3”._reg3”.
• Try to change motor speed by setting “speed_ref” (p.u.) in watch window . Then, Try to change motor speed by setting “speed_ref” (p.u.) in watch window . Then, observe dq-axis current regulations.observe dq-axis current regulations.
PID
outref
fdb
15 - 15 - 3535
Build Level 4 – Encoder verificationBuild Level 4 – Encoder verification
TMS320F28x controller
vs*
vs*
Inv. Park
SpaceVector
Gen.
PWMDriver
Ta
Tb
Tc
VoltageSource
Inverter
PMSM
ia
ib
Ileg2_Bus
Driver
ADCIN1
ADCIN2
ADCIN3is
Park Clarke
is
QEP_A
dir
vqs*
vds*
PI
rmp_out
vds*
PI
Theta_elec
iqs
Encoder
QEP_B
QEP_inc
m
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
ids
QEPTHETA
DRV
RampGen.
Speed_ref Rampcontrol
Iq_ref
Id_ref
15 - 15 - 3636
Instructions: Build Level 4Instructions: Build Level 4
1.1. In build.h, In build.h, #define#define BUILDLEVEL LEVEL4 BUILDLEVEL LEVEL4
2.2. Compile, Load, start RTM and RunCompile, Load, start RTM and Run
3.3. Set the DC-bus to 24 Volts 1 AmpSet the DC-bus to 24 Volts 1 Amp
4.4. Set “enable_flg” to 1 in watch window.Set “enable_flg” to 1 in watch window.
15 - 15 - 3737
Results: Build Level 4Results: Build Level 4
Emulated angle VS sensed angleEmulated angle VS sensed angle
15 - 15 - 3838
Results: Build Level 4Results: Build Level 4
Speed reference VS real speedSpeed reference VS real speed
15 - 15 - 3939
Build Level 5 – close speed loopBuild Level 5 – close speed loop
TMS320F28x controller
vs*
vs*
Inv. Park
SpaceVector
Gen.
PWMDriver
Ta
Tb
Tc
VoltageSource
Inverter
PMSM
ias
ibs
Ileg2_Bus
Driver
ADCIN1
ADCIN2
ADCIN3is
Park Clarke
is
QEP_ASPEEDFRQ
dir
vqs*
vds*
PIiqs
*
PI
r
vds*
PI
r
iqs
Encoder
QEP_B
QEP_inc
e
PWM1
PWM2
PWM3
PWM4
PWM5
PWM6
ids
ids*
QEPTHETA
DRV
15 - 15 - 4040
Instructions: Build Level 5Instructions: Build Level 5
1.1. In build.h, In build.h, #define#define BUILDLEVEL LEVEL5 BUILDLEVEL LEVEL5
2.2. Compile, Load, start RTM and RunCompile, Load, start RTM and Run
3.3. Set the DC-bus to 24 VoltsSet the DC-bus to 24 Volts
4.4. Set “enable_flg” to 1 in watch window.Set “enable_flg” to 1 in watch window.