43
Texas Instruments Incorporated European Customer Training Centre University of Applied Sciences Zwickau (FH) Module 15 : C28x Digital Motor Control Module 15 : C28x Digital Motor Control 32-Bit-Digital Signal Controller TMS320F2812

32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 11

Texas Instruments IncorporatedEuropean 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

Page 2: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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)

Page 3: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 33

3 – Phase - Motor (PMSM)

For most three phase machines, the winding is stationery, and magnetic field is rotatingThree phase machines have three stator windings, separated 120° apart physicallyThree phase stator windings produce three magnetic fields, which are spaced 120°in time

⎪⎪

⎪⎪

=

=

=

34

32

.

.

.

πω

πω

ω

tj

Sc

tj

Sb

tjsa

eIi

eIi

eIi

⎪⎪

⎪⎪

=

=

=

−Ω

−Ω

Ω

34

32

.

.

.

π

π

tjp

c

tjp

b

tjpa

eEe

eEe

eEe

N

S a

c

b

ia

ic

ib

Page 4: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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 346ωt

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

Page 5: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 55

Rotor is carrying a constant magnetic field created either by permanent magnets or current fed coilsThe 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 exactfrequency 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

fp

fgivespω

=Ω Example: a 2 poles pair synchronous motor will run at 1500 r.pm for a 50Hz AC supply frequency

Page 6: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 66

Both (typically) have permanentBoth (typically) have permanent--magnet rotor and a magnet rotor and a wound statorwound statorBLDC (Brushless DC) motor is a permanentBLDC (Brushless DC) motor is a permanent--magnet magnet brushless motor with trapezoidal back EMFbrushless motor with trapezoidal back EMFPMSM (PermanentPMSM (Permanent--magnet synchronous motor) is a magnet synchronous motor) is a permanentpermanent--magnet brushless motor with sinusoidal 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

Page 7: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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 3 –– Phase Voltage Inverter Phase Voltage Inverter

Page 8: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 88

Scalar Control Scheme ( Scalar Control Scheme ( ““ V/f 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

Page 9: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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 3Control, is a control strategy for 3--phases 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 motorsDC motors’’ operationoperationFOC will be possible with system FOC will be possible with system information: currents, voltages, flux and information: currents, voltages, flux and speed.speed.

Page 10: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1010

FOC control scheme FOC control scheme

Some key mathematical components are required!

ωPID

d,q

a,b,c

3-Phase

Inverter

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

Page 11: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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

vvv

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

vvv

P

v

vv

v

vv

Pvvv

v

vv

vvv

θθ

πθπθ

πθπθ

θθ

1sv

3sv

2sv

sdv

sqv

0=sov

tSS ωθ =

Page 12: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1212

Park Transform key componentsPark Transform key components

1sv

3sv

2sv

sdv

sqv

0=sov

tSS ωθ =

(vsd, vsq, vso) are called the Park coordinatesvsd: direct Park componentvsq: squaring Park componentvso: homo-polar Park componentVso is null for a three-phases balanced systemEach pair of components is perpendicular to each other

⎪⎪

⎪⎪

==

==++

0.0.

0.system) balanced phases-(tri 0321

SoSq

SoSd

SqSd

SSS

vvvv

vvvvv

Page 13: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1313

CLARKE CLARKE –– TransformationTransformationTransform is usually split into CLARKE transform and one rotatioTransform is usually split into CLARKE transform and one rotationnCLARKE converts balanced three phase quantities into balanced twCLARKE converts balanced three phase quantities into balanced two o phase orthogonal quantitiesphase orthogonal quantities

tSS ωθ =

v1= vα

v3

v2vβ

3.2 12

1

vvv

vv+

=

=

β

αvd

vq

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥

⎢⎢⎢

⎡⋅

−=

βα

θθθθ

vv

SSSS

qvdv

)cos()sin()sin()cos(

CLARKE

+Rotation

PARK TRANSFORM

Page 14: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1414

PARK Transform summaryPARK Transform summary

Clarke

v1

v2

v3

vβPark

Vd

Vq

Three phase rotating domain

Two phase rotating domain Stationary domain

1si

3si

2si

0=soi

tSS ⋅=ωθ

IS

ISd

ISq

Stator phase current example: Is is moving at θSand its PARK coordinates are constant in (d,q) rotating frame.Can be applied on any three-phase balanced variables (flux…)

d

q

α

β

Page 15: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1515

Texas Instruments Motor Control SolutionTexas Instruments Motor Control Solution

““C2000 C2000 -- Digital Motor Control Library (DMC)Digital Motor Control Library (DMC)”” ::

Single Phase ACI Motor Control Using Constant Single Phase ACI Motor Control Using Constant V/HzV/Hz33--Phase ACI Motor Constant V/Hz Control Phase ACI Motor Constant V/Hz Control 33--Phase ACI Motor Field Oriented ControlPhase ACI Motor Field Oriented Control33--Phase Sensored Field Oriented Control (PMSM)Phase Sensored Field Oriented Control (PMSM)33--Phase Sensorless Field Oriented Control Phase Sensorless Field Oriented Control (PMSM)(PMSM)33--Phase Sensored Trapezoidal Control (BLDC)Phase Sensored Trapezoidal Control (BLDC)33--Phase Sensorless Trapezoidal Control (BLDC)Phase Sensorless Trapezoidal Control (BLDC)

Page 16: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1616

Digital Motor Control Library Digital Motor Control Library (DMC(DMC--Lib)Lib)

The DMCThe DMC--Library is a collection of most Library is a collection of most commonly used algorithms and function commonly used algorithms and function blocks for motor control systemsblocks for motor control systemsFor 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

Page 17: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1717

Digital Motor Control Library Digital Motor Control Library (DMC(DMC--Lib)Lib)

The DMCThe DMC--Lib containsLib containsPID 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 moreand more……

Page 18: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1818

Laboratory: FOC for PMSMLaboratory: FOC for PMSM

TMS320F28x controller

vαs*

vβs*

Inv. Park

SpaceVector

Gen.

PWMDriver

Ta

Tb

Tc

VoltageSource

Inverter

PMSM

ias

ibs

Ileg2_Bus

Driver

ADCIN1

ADCIN2

ADCIN3iβsPark Clarke

iαs

QEP_ASPEEDFRQ

dir

vqs*

vds*

PIiqs

*

PI

θλr

vds*

PI

ωr

iqs

Encoder

QEP_B

QEP_inc

θe

PWM1PWM2PWM3PWM4PWM5PWM6

ids

ids*

QEPTHETA

DRV

Page 19: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 1919

TI Library Solution TI Library Solution ““PMSM 3PMSM 3--11”” (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

Page 20: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 2020

TI Library Solution TI Library Solution ““PMSM 3PMSM 3--11”” (sprc129)(sprc129)

eZdsp

DMC 550

PMSM 3-1

Load

24V

PC- parallel port

5V DC

RS232(optional)

Page 21: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 2121

PMSM 3PMSM 3--1 Laboratory1 Laboratory

Student Workbench

Page 22: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 2222

Variable transformation from stationary αβ-axis to

synchronously rotating dq-axis

vαs

vβs

Inv. Park

vqs

vds

θλr

vqs

vdsPark

vαs

vβs

θλr

Variable transformation from synchronously rotating dq-axis to

stationary αβ-axis

iαs

iβsClarke

ias

ibs

Variable transformation from phase ab-axis to

stationary αβ-axis

vαs

vβs

SpaceVector

Gen.

Ta

Tb

Tc

Space-vector generator producing the duty cycle ratio of PWM signals

TI DMC Library Modules TI DMC Library Modules

Page 23: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 2323

PWM generation

PWMDriver

Ta

Tb

Tc

PWM1PWM2PWM3PWM4PWM5PWM6

ADC driver for two line currents and DC-bus voltage measurement

ias

Vdc

ibsIleg2_Bus

Driver

ADCIN1

ADCIN2

ADCIN3

PIvqs

*iqs

*

iqs

Proportional-Integral controller

SPEEDFRQdir

ωrθe

Speed estimation fromrotor position and rotor direction

QEP_A

dir

θe

QEP_B

QEP_ind

θmQEP

THETADRV

QEP driver andshaft position and rotor direction

TI DMC Library Modules TI DMC Library Modules

Page 24: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 2424

Build Level 1Build Level 1

TMS320F28x controller

vαs*

vβs*

Inv. Park

SpaceVector

Gen.

PWMDriver

Ta

Tb

Tc

Vq_testing

rmp_out

Vd_testing

PWM1PWM2PWM3PWM4PWM5PWM6

speed_ref RampGen.

Rampcontrol

key modules under test

Page 25: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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)

Page 26: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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

Page 27: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

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

Page 28: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 2828

Changing !!

watch window for build 1

Code Composer Studio Level 1Code Composer Studio Level 1

Page 29: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 2929

Results: Build Level 1Results: Build Level 1

rmp_out

Ta

Page 30: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3030

Build Level 2 Build Level 2 –– Current verificationCurrent verification

TMS320F28x controller

vαs*

vβs*

Inv. Park

SpaceVector

Gen.

PWMDriver

Ta

Tb

Tc

VoltageSource

Inverter

PMSM

ia

ib

Ileg2_Bus

Driver

ADCIN1

ADCIN2

ADCIN3iβsPark Clarke

iαs

Vq_testing

Vd_testing

iqs

Encoder

PWM1PWM2PWM3PWM4PWM5PWM6

ids

RampGen.

Speed_ref Rampcontrol

θe

key module under test

rmp_out

Page 31: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3131

Instructions: Build Level 2Instructions: Build Level 21.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 Set variable ““enable_flgenable_flg”” to 1 in watch window.to 1 in watch window.7.7. Try to change motor speed by setting Try to change motor speed by setting ““speed_refspeed_ref”” (p.u.) (p.u.)

in watch window. Then, motor should change its speed in watch window. Then, motor should change its speed accordingly.accordingly.

Page 32: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3232

Results: Build Level 2Results: Build Level 2

1.1. PMSM should run openPMSM should run open--loop smoothlyloop smoothly2.2. The currents in the motor phases should be The currents in the motor phases should be

sinusoidal.sinusoidal.

Page 33: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3333

Build Level 3 Build Level 3 -- Tuning of dqTuning of dq--axis current closed loopsaxis current closed loops

TMS320F28x controller

RampGen.

Speed_ref Rampcontrol

Iq_ref

key modules under test

vαs*

vβs*

Inv. Park

SpaceVector

Gen.

PWMDriver

Ta

Tb

Tc

VoltageSource

Inverter

PMSM

ia

ib

Ileg2_Bus

Driver

ADCIN1

ADCIN2

ADCIN3iβsPark Clarke

iαs

ids*

PI

PI

rmp_out

iqs

Encoder

PWM1PWM2PWM3PWM4PWM5PWM6

ids

Id_ref

vqs*

vds*

Page 34: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3434

Instructions: Build Level 3Instructions: Build Level 3

1.1. In build.h, In build.h, #define#define BUILDLEVEL LEVEL3BUILDLEVEL LEVEL3

2.2. Compile, Load, start RTM and RunCompile, Load, start RTM and Run

3.3. Set Set ““enable_flgenable_flg”” to 1 in watch window.to 1 in watch window.

4.4. TuneTune--up the PIup the PI•• Observe dqObserve dq--axis current regulations at PI inputs (i.e., reference and feedbaxis current regulations at PI inputs (i.e., reference and feedback). For ack). For

example, example, ““pid1_iq.pid_pid1_iq.pid_refref_reg3_reg3”” and and ““pid1_iq.pid_pid1_iq.pid_fdbfdb_reg3_reg3””..•• Try to change motor speed by setting Try to change motor speed by setting ““speed_refspeed_ref”” (p.u.) in watch window . Then, (p.u.) in watch window . Then,

observe dqobserve dq--axis current regulations.axis current regulations.

PID

outref

fdb

Page 35: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3535

Build Level 4 Build Level 4 –– Encoder verificationEncoder verification

TMS320F28x controller

vαs*

vβs*

Inv. Park

SpaceVector

Gen.

PWMDriver

Ta

Tb

Tc

VoltageSource

Inverter

PMSM

ia

ib

Ileg2_Bus

Driver

ADCIN1

ADCIN2

ADCIN3iβsPark Clarke

iαs

QEP_A

dir

vqs*

vds*

PI

rmp_out

vds*

PI

Theta_elec

iqs

Encoder

QEP_B

QEP_inc

θm

PWM1PWM2PWM3PWM4PWM5PWM6

ids

QEPTHETA

DRV

RampGen.

Speed_ref Rampcontrol

Iq_ref

Id_ref

Page 36: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3636

Instructions: Build Level 4Instructions: Build Level 4

1.1. In build.h, In build.h, #define#define BUILDLEVEL LEVEL4BUILDLEVEL LEVEL4

2.2. Compile, Load, start RTM and RunCompile, Load, start RTM and Run

3.3. Set the DCSet the DC--bus to 24 Volts 1 Ampbus to 24 Volts 1 Amp

4.4. Set Set ““enable_flgenable_flg”” to 1 in watch window.to 1 in watch window.

Page 37: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3737

Results: Build Level 4Results: Build Level 4

Emulated angle VS sensed angleEmulated angle VS sensed angle

Page 38: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3838

Results: Build Level 4Results: Build Level 4

Speed reference VS real speedSpeed reference VS real speed

Page 39: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 3939

Build Level 5 Build Level 5 –– close speed loopclose speed loop

TMS320F28x controller

vαs*

vβs*

Inv. Park

SpaceVector

Gen.

PWMDriver

Ta

Tb

Tc

VoltageSource

Inverter

PMSM

ias

ibs

Ileg2_Bus

Driver

ADCIN1

ADCIN2

ADCIN3iβsPark Clarke

iαs

QEP_ASPEEDFRQ

dir

vqs*

vds*

PIiqs

*

PI

θλr

vds*

PI

ωr

iqs

Encoder

QEP_B

QEP_inc

θe

PWM1PWM2PWM3PWM4PWM5PWM6

ids

ids*

QEPTHETA

DRV

Page 40: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 4040

Instructions: Build Level 5Instructions: Build Level 5

1.1. In build.h, In build.h, #define#define BUILDLEVEL LEVEL5BUILDLEVEL LEVEL5

2.2. Compile, Load, start RTM and RunCompile, Load, start RTM and Run

3.3. Set the DCSet the DC--bus to 24 Voltsbus to 24 Volts

4.4. Set Set ““enable_flgenable_flg”” to 1 in watch window.to 1 in watch window.

Page 41: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 4141

Results: Build Level 5Results: Build Level 5Fastest response time with Fastest response time with the closed loop!the closed loop!

Page 42: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless

15 15 -- 4242

Application of PMSM 3Application of PMSM 3--1: 1:

img GmbH Nordhausen

Page 43: 32-Bit-Digital Signal Controller TMS320F2812read.pudn.com/downloads169/sourcecode/embed/779893... · 15 - 6 Both (typically) have permanent-magnet rotor and a wound stator BLDC (Brushless