數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/w3news/技術專欄/2007-09-12... ·...

36
1 課程講義:【電動機】06 :【1DSP交流驅動控制器之設計與實現 交通大學 808- 電力電子實驗室 Sept. 2007 台灣 新竹交通大學電機與控制工程研究所808實驗室 電源系統與晶片、數位電源、馬達控制驅動晶片、DSP/FPGA控制 http://pemclab.cn.nctu.edu.tw/ Lab-808: Power Elec tronic Systems & Chips Lab., NCT U, Taiwan 1/215 鄒應嶼 教授 Filename: \C01 投影片:電動機控制\【 電 動機】 06 :【1 】數位AC DRIVE之 設計與實 現.p pt 數位交流驅動控制器之設計與實現 2007912國立交通大學 電機與控制工程研究所 FromP ower System Design toP ower IC Design LA B808 NC TU Lab808: 電 力 電 子系 統與 晶片 實驗室 Power Electronic Systems & Chips, NCT U, TA IWA N 台灣新竹交通大學電機與控制工程研究所 台灣新竹交通大學電機與控制工程研究所808實驗室 電源 系統與晶片 、數位電源 、馬達控制驅 動晶片、單 晶片 DSP/FPGA控制 http :// pe mcl ab.c n. nct u.e du .tw/ Lab-808: Power Electronic Systems & Chips Lab., NCTU, Taiwan 2/215 Contents Introduction Control Interface for Digital Servo Motor Control Digital AC Servo Motor Controller Requirements Evolution of DSP Motor Controllers Digital Motor Control ICs Design and Realization Issues in Digital Control 808-PowerLab Research on Digital Motor Control 3/215 Introduction 電力電子 系統與晶片設計實驗 室 Power El ectro nic Sys tems & C hips Lab. 交通大學電機與控制工程研究所 Power Electronic Systems & Chips Lab., NCTU, Taiwan 4/215 Introduction Motor Drives for Manufacturing Automation Composition of a Motion Control System State of the Art: AC Servos Block Diagram of a Typical Digital Motor Controller DSP Solution for Motor Control Characteristics of Power El ectronic Systems Journals and Conferences 5/215 Motor Drives for Manufacturing Automation Palletizer Application Winder Application Cutter Application Blender Applicatio n Catcher/Stacker Application 6/215 Embedded Motion Control System DSP-Bas ed Moti on M od ule Powe r Su ppl y Mo ti o n Fir m war e wit h Real - Tim e Ker nel (fro mParker Aut omati on) Servo Drive Motion Controller

Upload: others

Post on 06-Apr-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

1

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

1215

鄒應嶼 教 授

Fi lenam e C01 投影片電動機控制【 電 動機】 06【 1】數位 AC DRIVE之 設計與實 現ppt

數位交流驅動控制器之設計與實現

2007年9月12日

國立交通大學 電機與控制工程研究所

From Power System Design to Power IC Design

LA B808NC TU

Lab808 電力電子系統與晶片實驗室

Power Electronic Systems amp Chips N CT U TA IWA N

台灣新竹bull交通大學bull電機與控制工程研究所

台灣新竹交通大學電機與控制工程研究所808實驗室電源 系統與晶片 數位電源 馬達控制驅 動晶片單 晶片 DSPFPGA控制

http pe mcl abc n nct ue du twLab-808 Power Electronic Systems amp Chips Lab NCTU Taiwan

2215

Contents

Introduction Control Interface for Digital Servo Motor ControlDigital AC Servo Motor Controller Requirements Evolution of DSP Motor ControllersDigital Motor Control ICsDesign and Realization Issues in Digital Control808-PowerLab Research on Digital Motor Control

3215

Introduction

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

4215

Introduction

Motor Drives for Manufacturing AutomationComposition of a Motion Control SystemState of the Art AC ServosBlock Diagram of a Typical Digital Motor ControllerDSP Solution for Motor ControlCharacteristics of Power Electronic SystemsJournals and Conferences

5215

Motor Drives for Manufacturing Automation

Palletizer Application

Winder Application

Cutter Application Blender Application

CatcherStacker Application

6215

Embedded Motion Control System

DSP-Bas edMoti on M od ule

Powe r Su ppl y

Mo ti o n Firmwar ewit h

Real - Time Ker nel

(fro m Pa rker Au to ma tion)

Servo Drive

Motion Controller

2

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

7215

Motion Control (e g Electronic Gear)

Hauptantrieb

Virtue lle rMaster

Sync hronisie rteKomm unika tion

main drive

Virtualmaster

Synchronizedcommunication

8215

Real-Time Network Control of Distributed Motor Drives

SERCOS fiber optic ring

Interpolation

Synchro-niz ation

User interfaceSERCTOP

Control unitor PC SERCANS

Inte

rface f

or m

icrop

rocess

or P

C or V

ME-bu

s

NC-Program

executionDiagnostics

Synchroniz ation

Command channel

NC Service channel

Diagnostics channel

Actual value channel

Command value channel

M M I Service channel

9215

Firmware amp Software Architecture for Motion Control

DSP Device Driver

Servo Loop

PCL SICMulti-Tasks Kernel

IPO SIC

DSP System Module

PMC32-CPU

PMC32-DAC

PMC32-PWM

PMC32-SERCOS

PC Device Driver

Graphic Control SoftwarePC Software

DSP Firmware

DSP Hardware

LabVie wWi nMotion C ontr ol C Lib rar ies

Multi- Taski ng Ke rnelPos itio nVel ocity To rque PWM

8-axis co ntro lCIR P TP HOM E JOG

Encode r A DDA PWM IORS-2 32 S ERCO S 10215

AccelerationDeceleration Control

Acc Dec Interpolator

X

Y

M

MDx Dy

Servo

MotorP P

Px

Py

DigitalMotionController

馬達驅動器

馬達驅動器

擴充輸出入UNIT 1

機械輸入(4點 2) times

外部輸入(16點) 外部輸出(16點) RS-232C

電源(AC90~240V)

外部輸入(16點)

外部輸出(16點)

回授

回授

回授

回授

X 軸

Y 軸

附加機能

Servo

11215

Numerical Motion Controller

ΔS

ΔX

ΔSΔZ

nbullT

ΔS=v pat hbullT

(n+1)bullT

(n+2)bullT

Mathematical example for high speed machining vpath=30mmincong500mms cong05mm ms

CNC axes control

T[ ms] 10 2 0 5 02 5 0 1

Δs [ m m] 5 1 0 25 0 12 5 0 05

y-axisservomotor

x-axisservomotor

12215

2-axis Digital Motion Control System

G ss svx

x

x x x( ) =

+ +ω

ξ ω ω02

20 0

22

1s

+

_ K vx

ux ωx θ xexθ x

Ram pe r

and

Cont ou rInte rp ola to r

200

2

20

2)(

yyy

yvy ss

sGωωξ

ω++

=1s

+_ K vy

uy ω y θ yeyθ y

Y

X

desired contouring pathX-axis Servo Drive

Y-axis Servo Drive

X

Y

K vx

x

x

==

=

50200

0 7070

0

(sec( radsec

-1))

ω

ξ

X-axis Servo Y-axis Servo

Kvy

y

y

==

=

50200

07070

0

(sec(rad sec

-1))

ω

ξ

X-軸與 Y-軸伺服驅動器的參數值

3

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

13215

Composition of a Motion Control System

tacho-generator

encoder

servo driveposition controller

control box

The servo motor is conn ect ed to a mech anical loadThe tacho-g enerato r is usu ally not used in modern digital servo driveThe servo dri ve unit may be multiple-axis and con sist s of a motion controllerThe control unit provides man-machin e interf ace 14215

Modern Digital AC Servo Drive

encoder

servo driveposition controller

control box

AC Servo Motor

Optical network interface

Single-unit solution

15215

Typical Time and Frequency Responses

2000 rp m

-200 0 r pm

Speed

Curre nt

Gain

)( jwG

0db-3db ω

(rad s)

An example of mo tor current waveforms and Bode diagram of the whole system (a) speed response to step command and primary-phase current waveform (b) Bode diagrams of the speed-control system

dBBW 3minus

16215

Selection of Servo Drive Interface

伺服驅動器 優 點 缺 點

Pulse Servo Drive Step Drive

1 全數位化界面簡單

2 可接步進馬達

1 伺服動態響應受限

Velocity Drive Torque Drive

1 伺服動態響應佳

2 可接變頻器

1 類比界面輸出易飄移或

offset

PWM Power Amplifier

1 全數位界面

2 伺服動態響應較佳

3 功率放大器成本低

1 標準功率放大器尚未普及

2 使用者不易教育

Network Drive (SERCOS 1394

USB CAN)

1 網路介面配線容易

2 可依不同介面定義進行位置

速度電流等控制

1 網路界面驅動器尚未普及

2 各標準互不相容

17215

Evolution of Electrical Machines

Asynchro nous

Synchro nous

AC and DC Pow er Sup ply

Wound rotor

Squirrel cage

Salient poles

Var reluctance

Perm Magnet

Series

Compound

Shunt

Per Magnet

POWER CONVERSION

Universal

AC variable speed driv es

Intellige ntMoto r

AC Servo Brushless

DC Servo

Power Elect ronics

OPEN LOOP

Digital con trol

CLOSE LOOP

Smart I nte rface

EMBEDDED INTELLIGENCE

DC Brushless

Disc Mag net Steppe r

Hybrid Steppe r

VRSteppe r

DC

AC

18215

Induction Motor vs PM Synchronous Motor

ROTOR

AB

C

A

B

C

A

B

C

A

B

CSTATOR

ROTORCONDUCTOR

ROTOR

STATORSEGMENT

ROTORMAGNET

A

B

C

AC Induction Motor AC S ervo Motor

4

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

19215

What could an AC vector system do in servo applications

Speed Regulation up to 5 open loop 001 closed loop wexternal encoderFull torque at zero speedSmoothness at low speeds will be similarPositioning applications with low acceleration low response amp low bandwidth requirements (High power large inertia sy stem)

20215

AC Servo Driver with Synchronous or Induction Motors

R Lessmeie r W Schu macher and W Le onha rd Mic rop rocessor - cont rol led AC - serv o d river wit h synch rono us or inducti on m oto rs whic h is p refe rable IE E E Tra ns on Ind Ap pli vol 22 n o 5 pp 8 12-8 19 Sept Oct 1 986

AbstractmdashWith the rec ent advances of power transistors and microprocessors it has become possible to design high-dynamic-performance ac-servo drives free of moving contacts using synchronous or asynchronous motors Both schemes have their particular strengths A general control principle based on field or rotor orientation is described which has been re ali zed wi th a state-of-the-art microcomputer where all the signal processing including modulation of the inverter is performed by software Extensive tes ts have been carried out with different motors to compare the charact erist ics of the various types of drives

21215

VF Vector Induction Drive vs PM AC Servo

Heat buildup at low speedsEven though full torque at zero speed is possible the motor will run hot at low speeds because of the induction motor design The motor may need to be oversized to handle these effects or have a blower added

Very slow response times decreased bandwidth The AC Induction motor has higher rotor inertia due to its constructionHigher peak torques are required for ACCDEC

Potential for stability problemsThe overall bandwidth will be lower with the VFD system A system bandwidth lower than 40 radssec Could have stability problems in a closed loop system

There are Disadvantages of using a AC VFD for motion instead of AC Servo

22215

永磁交流伺服馬達的結構

permanentmagnetcore Armature

winding

永磁式交流馬達之剖面圖

stator winding

north pole rotor

frame stator iron core

end brackets

bearings

stationary field winding

south pole rotor

shaft

field winding holder

(a) (b)

複合式永磁式交流馬達之剖面圖

23215

Optimal Capacity Ranges of Brushless Servomotors

Output (W)Varieties

Stepping mo tor (includin g line ar mot or)

PM brus hless mot or

Vector-c ont rol inductio n m otor

Hall mot or

3 30 30010010 1000 3000

永磁式交流伺服馬達的構造

statorcoil

statorlaminatedcoil ferrite PM rotor pole

angular position andvelocity sensor

24215

Demagnetization Curves of Several Types of Permanent Magnets

14

12

10

8

6

4

2

012 10 8 6 4 2

磁通密

度[T

][1

04G

]

磁場強度 [ kOe]

Alnico

Ferrite

Rare-earthcobalt

Neodymium-iron

5

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

25215

Characteristics of AC Servo Motors

Model

Item ASM-061M AS M- 121M ASM-252MRated output ( W) 60 120 250Rated tor que ( kgmiddotcm) 1 95 390 812Rated speed ( rpm) 3000Rated voltage (V( a c) ) 37 41 103Rated curr ent (A(ac)) 1 6 27 22Maximum torque (kgmiddot cm) 9 75 195 406Maximum speed (rpm) 4000Power rate kWs 0 85 216 372Torque const ant (kgmiddotcmA) 0 95 113 288Mechanical time constant ( mmiddotsec) 143 894 724Electrical tim e constant (mmiddot sec) 1 85 233 372em f const ant ( mVrpm) 112 132 333Rotor inertia ( J) (kgmiddotcmmiddot s2) 044times 10-3 069times10-3 174times10-3

Armature res is tan ce ( Ω) 2 21 123 254

Protection s tructur e Totallyenclosed

Insulat ion type T ype BEnvir onmental co nditionst emper at ure () 0~40hum idity ( ) 90 RH or less ( no dew condensat ion)

Weight ( kg) 2 4 30 52So urc e S hib au ra En gin eer ing W ork s Co Ltd

26215

Characteristics of AC Servo Drives

Model

Item ADM-061A ADM-121A ADM-252A

Motor output (W ) 60 120 250Voltage of main circui t (V(dc)) 140 280Voltage of control circuit (A( dc)) 100200200Maximum output cur rent (A ) 6 8 8Maximum input cur rent (A ) 37 63 45Speed control range 10001

load charge (0~100 ) 01 or belowvoltage fluctuation ( 10 ) 01 or belowtemperature change (25) 0 5 or below

Control method Transis tor PWM produces a s inusoidal waveSpeed feedback Semi-absolute encoderSpeed command voltage ( V(dc)) 10rated speedCommand input impedance (k Ω) 10Environ mental conditions

temperature () 0~15

humidity ( ) 90 RH or less (no dew condensation)Weight (kg) 35

S o u rce S h ib a u ra Eng in eerin g Wo rks Co Ltd

27215

永磁交流伺服馬達的規格

GD2 (kgfcm2)

J (gfcmmiddots2)

090

時間額定連續絕緣種別F種振動階級V15取付方式直結形構造全閉自冷形塗裝色N15激磁方式希土類永久磁石周圍溫度0~+40濕度85RH以下(結露)

共通式樣

194概略重量 (kgf)

023轉子慣量

17靜止摩擦

DC24V plusmn 10額定電壓

保持

Encoder 2000PR速度位置檢出器

341概略重量 (kgf)

972GD2 (kgfcm2)

248J (gfcmmiddots2)轉子慣量

2353功率變率 (kws)

3000最大轉速 (rpm)

3000額定轉速 (rpm)

610瞬時最大 (kgfcm)

244額定 (kgfcm)

750額定出力 (w)

8CB75-2SE6馬達型號

DOSA016B-CB752伺服驅動器型號

28215

永磁交流伺服驅動器的規格

伺服馬達 型號 5CB06 -1 SE 6F 5CB12-1 SE 6F 7CB20-1 SE 6F 7CB30-2S E 6F 8CB5 0-2S E 6F 8 CB7 5-2S E6 F

額定輸出 Pr W 60 120 200 300 5000 750額定線間電壓 Vt V 318 43 1 54 5 107 7 118 5 1494額定扭矩 T kg fcm 195 39 65 9 7 16 2 24 4連續 sta ll扭矩 Ts kg fcm 21 42 71 10 7 17 8 26 8額定相電流 Ig A 18 22 28 2 0 3 0 3 4額定轉速 Ng rpm 3000 3000 3000 3000 3000 3000瞬間最大扭矩 Tp( N) kg fcm 5 85 11 7 19 5 20 2 48 7 73 1瞬間最大機子電流

Ip A 54 66 84 6 0 9 0 10 2

額定 pow er ra te Q R k wsec 5 82 11 9 939 14 1 16 7 23 5轉矩常數 K T kg fc m

A1 23 197 255 535 611 7 92

誘起電壓常數 K E Jkrp m 126 20 2 26 1 54 9 62 7 81 4轉子慣量 J g fcms 0 0 64times 012 5times 044 1times 065 8times 1 5 4times 2 4 8times

機子阻抗 Ra Ω 9 12 603 420 837 423 3 27機子感應 La mH 546 468 795 17 4 12 1 10 2機械時間常數 Tm ms ec 3 94 198 291 196 178 1032電氣時間常數 Te ms ec 0 60 078 189 205 286 3 12重量 k gf 0 71 089 155 182 259 3 41絕緣等級 F 種 F種 F種 F種 F 種 F 種機 額定電壓 V械 靜止摩擦扭力 k gfcm 3 3 12 12 24 24式 轉子慣量 kgfcm

s0 02times 10 0 02times 10 01times 10 01times 10 023times 10 0 23times 10

煞 消費電流 029A 029A 045A 045A 044A 044A

車周圍溫度 0~40

29215

State of the Art AC Servos

High Speed SpindleAC Servo Motor

High Torque Motor Spindle Motor

30215

Non-Salient Pole for AC Servo Motor

永磁馬達的轉子根據其結構可分為

Salient-pole (凸極式)氣隙分佈不均勻具有磁阻扭矩效率較高轉矩漣波較大但可經由轉子設計降低構造較複雜成本較高主要應用於高效率壓縮機

Non- salient-pole (隱極式) 氣隙均勻分佈外表呈現圓柱狀亦稱之為圓柱式(cylindrical-type)磁鐵貼覆於轉子表面或以不鏽鋼環套住轉矩漣波較小主要應用於伺服馬達

Non-salient po leSalient pole

6

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

31215

Architecture of Motor Drive

Controller

PowerAmp Motor Load

Man-Machine InterfaceSignal Processing amp PWM Control Vector Control Control Loop Control

PowerSource

Spee d

Torqu e

32215

伺服馬達驅動系統的控制架構

Power source (converter)

Semiconductor driver

Servomotor

Position speed sensor

Mechanical driver

Power control

GTO transistor MOSFET

Signal generator

IC OP amplifier semiconductor sensor

Control

Microprocessor DSP

GATE signal

Control

Controller

voltagecurrent

Gear backlash

Friction Compliance

Sensor

Microelectronics Power electronics Materials

Linearized decoupled p ower amplifier by minor curren t and speed lo ops

Level 1

Level 2

Level 3

33215

直流伺服馬達驅動器的系統方塊圖

Refere nce speed

Speed amplifie r

Curre nt amplifie r

PWM circuit

Rectifier bridg e

Tra nsisto r bridg e

DC Moto r

Tria ngula r wav e gene ratio n circ uit

Speed f eed back

Compa rat or

Curre nt f eedb ack

Filter Tach oge ner ator

Driver

Driver

Driver

Driver

DCM

TG

+minus

+minus

34215

+minus

交流伺服馬達驅動器的系統方塊圖

Reference speed

Speed amplifier

DC-SIN conversion Rectifier

bridge

Transistor bridge

Three-ph ase synchronous

motorSpeed feedback

Comparator

Speed detection

circuitRotary encoder

Driver

Driver

Driver

Driver

SM

RE

++minus

Driver

Driver

Comparator

Comparator

Triangular wave generation circuit

Sine wave generation

circuit

Rotor position detector

+

minus

minusminusminus

minus

Current amplifier

Current feedback

U

V

W

35215

Typical Motion Control System Block Diagram

Posi ti o nCo ntr oll er

Velo ci tyCo ntr oll er

Velo ci ty Fe e db ac k

Posi ti o n Fe ed b ac k

++- -

Ma ch in e Ta bl eCurre nt

Co ntr oll er

+

-Pow er

Amplifier

Curre nt Fe ed b ac k

Mo t or

Mo ti o nPlan ni n g

Comma n dInt erpr et er

Ma ch in eOp erat io n

CADCAM

Operation Command

MotionCommand

PositionCommand

Veloc ityCommand

36215

Hierarchical Control Architecture for AC Drive

ServoController

ACDCConverter

DCACConverter

VectorController

FieldController

FluxEstimator

AC MotorShaft

sensor

CurrentController

Cur re nt C on trolTo rq ue Co ntr ol

Back em f C on trol

Positio n amp V elo city C on tr ol

PWMController

Position amp Velocityestimator

PWM (Volt ag e) Co ntr ol

Cur re nt amp

volta geamp

positi onfee db ack

7

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

37215

AC Servo Drive Control

for asynchronousmachines

fiel d we ak en in g fiel d c on trol ler

sp ee dco ntr oll er

curre ntco ntr oll ers

-

_ -

- M3~

Encoder

n iq

idψ

ϕ

ψ

machinemodel

ir

vr

φjeminus

φjeminus

φjeminus

for sy nc hr on o usmac hi ne s 38215

Modeling of the Servo Motor with Connected Load Mechanical Nonlinear Dynamics

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+ Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θ L

Kv

TL

θ m

Tm

G fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

The load dynamics will couple to the motor as external disturbancesPower converter exists significant nonlinearity and voltage and current limitsControl algorithms and parameters are critical for specific applications

Controller

Power Converter amp Sensors

+Gp

+

minus

+

minusG v

minusGi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmG fi

RKs

v a

ia

ωm

fwG

fpG

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmGf i

RKs

v a

ia

ωm

fwG

fpG

21

2

22

22

mm

nnn

ss

ωωξωωξ

++++

21

2

22

22

mm

nnnss

ωωξωωξ

++++

40215

Digital AC Servo Motor Controller Design Issues

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

41215

Why Use DSP for Motor ControlTo Realize Complex Control amp Interface Algorithm

Rectifier Charger Inverter

T2

T1

110220V5060 Hz

+

_

ACload

EM

I 3-phaseload

C1

C2

M otorGenerator Flywheel

Battery

uεud

bull Power Factor Control

bull Regenerative Braking Control

bull DC-Link Voltage Regu lation

bull DC-Link Cap M inimization

bull PWM Contro lbull Vector Controlbull Current Controlbull Voltage Controlbull Power F low Controlbull Auto-Tuning

42215

Fully Digital Control Scheme for PMAC Drives

+

minusbase

drive

ADC

ADC

32

ϕϕ

_

_

ias

ibs

ics

23

ϕϕ

vcs

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

dd t

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )PM AC

servomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Feedback Signal

Processing

Servo Control FieldTorqueamp

CurrentVector

amp PW M

Control

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 2: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

2

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

7215

Motion Control (e g Electronic Gear)

Hauptantrieb

Virtue lle rMaster

Sync hronisie rteKomm unika tion

main drive

Virtualmaster

Synchronizedcommunication

8215

Real-Time Network Control of Distributed Motor Drives

SERCOS fiber optic ring

Interpolation

Synchro-niz ation

User interfaceSERCTOP

Control unitor PC SERCANS

Inte

rface f

or m

icrop

rocess

or P

C or V

ME-bu

s

NC-Program

executionDiagnostics

Synchroniz ation

Command channel

NC Service channel

Diagnostics channel

Actual value channel

Command value channel

M M I Service channel

9215

Firmware amp Software Architecture for Motion Control

DSP Device Driver

Servo Loop

PCL SICMulti-Tasks Kernel

IPO SIC

DSP System Module

PMC32-CPU

PMC32-DAC

PMC32-PWM

PMC32-SERCOS

PC Device Driver

Graphic Control SoftwarePC Software

DSP Firmware

DSP Hardware

LabVie wWi nMotion C ontr ol C Lib rar ies

Multi- Taski ng Ke rnelPos itio nVel ocity To rque PWM

8-axis co ntro lCIR P TP HOM E JOG

Encode r A DDA PWM IORS-2 32 S ERCO S 10215

AccelerationDeceleration Control

Acc Dec Interpolator

X

Y

M

MDx Dy

Servo

MotorP P

Px

Py

DigitalMotionController

馬達驅動器

馬達驅動器

擴充輸出入UNIT 1

機械輸入(4點 2) times

外部輸入(16點) 外部輸出(16點) RS-232C

電源(AC90~240V)

外部輸入(16點)

外部輸出(16點)

回授

回授

回授

回授

X 軸

Y 軸

附加機能

Servo

11215

Numerical Motion Controller

ΔS

ΔX

ΔSΔZ

nbullT

ΔS=v pat hbullT

(n+1)bullT

(n+2)bullT

Mathematical example for high speed machining vpath=30mmincong500mms cong05mm ms

CNC axes control

T[ ms] 10 2 0 5 02 5 0 1

Δs [ m m] 5 1 0 25 0 12 5 0 05

y-axisservomotor

x-axisservomotor

12215

2-axis Digital Motion Control System

G ss svx

x

x x x( ) =

+ +ω

ξ ω ω02

20 0

22

1s

+

_ K vx

ux ωx θ xexθ x

Ram pe r

and

Cont ou rInte rp ola to r

200

2

20

2)(

yyy

yvy ss

sGωωξ

ω++

=1s

+_ K vy

uy ω y θ yeyθ y

Y

X

desired contouring pathX-axis Servo Drive

Y-axis Servo Drive

X

Y

K vx

x

x

==

=

50200

0 7070

0

(sec( radsec

-1))

ω

ξ

X-axis Servo Y-axis Servo

Kvy

y

y

==

=

50200

07070

0

(sec(rad sec

-1))

ω

ξ

X-軸與 Y-軸伺服驅動器的參數值

3

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

13215

Composition of a Motion Control System

tacho-generator

encoder

servo driveposition controller

control box

The servo motor is conn ect ed to a mech anical loadThe tacho-g enerato r is usu ally not used in modern digital servo driveThe servo dri ve unit may be multiple-axis and con sist s of a motion controllerThe control unit provides man-machin e interf ace 14215

Modern Digital AC Servo Drive

encoder

servo driveposition controller

control box

AC Servo Motor

Optical network interface

Single-unit solution

15215

Typical Time and Frequency Responses

2000 rp m

-200 0 r pm

Speed

Curre nt

Gain

)( jwG

0db-3db ω

(rad s)

An example of mo tor current waveforms and Bode diagram of the whole system (a) speed response to step command and primary-phase current waveform (b) Bode diagrams of the speed-control system

dBBW 3minus

16215

Selection of Servo Drive Interface

伺服驅動器 優 點 缺 點

Pulse Servo Drive Step Drive

1 全數位化界面簡單

2 可接步進馬達

1 伺服動態響應受限

Velocity Drive Torque Drive

1 伺服動態響應佳

2 可接變頻器

1 類比界面輸出易飄移或

offset

PWM Power Amplifier

1 全數位界面

2 伺服動態響應較佳

3 功率放大器成本低

1 標準功率放大器尚未普及

2 使用者不易教育

Network Drive (SERCOS 1394

USB CAN)

1 網路介面配線容易

2 可依不同介面定義進行位置

速度電流等控制

1 網路界面驅動器尚未普及

2 各標準互不相容

17215

Evolution of Electrical Machines

Asynchro nous

Synchro nous

AC and DC Pow er Sup ply

Wound rotor

Squirrel cage

Salient poles

Var reluctance

Perm Magnet

Series

Compound

Shunt

Per Magnet

POWER CONVERSION

Universal

AC variable speed driv es

Intellige ntMoto r

AC Servo Brushless

DC Servo

Power Elect ronics

OPEN LOOP

Digital con trol

CLOSE LOOP

Smart I nte rface

EMBEDDED INTELLIGENCE

DC Brushless

Disc Mag net Steppe r

Hybrid Steppe r

VRSteppe r

DC

AC

18215

Induction Motor vs PM Synchronous Motor

ROTOR

AB

C

A

B

C

A

B

C

A

B

CSTATOR

ROTORCONDUCTOR

ROTOR

STATORSEGMENT

ROTORMAGNET

A

B

C

AC Induction Motor AC S ervo Motor

4

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

19215

What could an AC vector system do in servo applications

Speed Regulation up to 5 open loop 001 closed loop wexternal encoderFull torque at zero speedSmoothness at low speeds will be similarPositioning applications with low acceleration low response amp low bandwidth requirements (High power large inertia sy stem)

20215

AC Servo Driver with Synchronous or Induction Motors

R Lessmeie r W Schu macher and W Le onha rd Mic rop rocessor - cont rol led AC - serv o d river wit h synch rono us or inducti on m oto rs whic h is p refe rable IE E E Tra ns on Ind Ap pli vol 22 n o 5 pp 8 12-8 19 Sept Oct 1 986

AbstractmdashWith the rec ent advances of power transistors and microprocessors it has become possible to design high-dynamic-performance ac-servo drives free of moving contacts using synchronous or asynchronous motors Both schemes have their particular strengths A general control principle based on field or rotor orientation is described which has been re ali zed wi th a state-of-the-art microcomputer where all the signal processing including modulation of the inverter is performed by software Extensive tes ts have been carried out with different motors to compare the charact erist ics of the various types of drives

21215

VF Vector Induction Drive vs PM AC Servo

Heat buildup at low speedsEven though full torque at zero speed is possible the motor will run hot at low speeds because of the induction motor design The motor may need to be oversized to handle these effects or have a blower added

Very slow response times decreased bandwidth The AC Induction motor has higher rotor inertia due to its constructionHigher peak torques are required for ACCDEC

Potential for stability problemsThe overall bandwidth will be lower with the VFD system A system bandwidth lower than 40 radssec Could have stability problems in a closed loop system

There are Disadvantages of using a AC VFD for motion instead of AC Servo

22215

永磁交流伺服馬達的結構

permanentmagnetcore Armature

winding

永磁式交流馬達之剖面圖

stator winding

north pole rotor

frame stator iron core

end brackets

bearings

stationary field winding

south pole rotor

shaft

field winding holder

(a) (b)

複合式永磁式交流馬達之剖面圖

23215

Optimal Capacity Ranges of Brushless Servomotors

Output (W)Varieties

Stepping mo tor (includin g line ar mot or)

PM brus hless mot or

Vector-c ont rol inductio n m otor

Hall mot or

3 30 30010010 1000 3000

永磁式交流伺服馬達的構造

statorcoil

statorlaminatedcoil ferrite PM rotor pole

angular position andvelocity sensor

24215

Demagnetization Curves of Several Types of Permanent Magnets

14

12

10

8

6

4

2

012 10 8 6 4 2

磁通密

度[T

][1

04G

]

磁場強度 [ kOe]

Alnico

Ferrite

Rare-earthcobalt

Neodymium-iron

5

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

25215

Characteristics of AC Servo Motors

Model

Item ASM-061M AS M- 121M ASM-252MRated output ( W) 60 120 250Rated tor que ( kgmiddotcm) 1 95 390 812Rated speed ( rpm) 3000Rated voltage (V( a c) ) 37 41 103Rated curr ent (A(ac)) 1 6 27 22Maximum torque (kgmiddot cm) 9 75 195 406Maximum speed (rpm) 4000Power rate kWs 0 85 216 372Torque const ant (kgmiddotcmA) 0 95 113 288Mechanical time constant ( mmiddotsec) 143 894 724Electrical tim e constant (mmiddot sec) 1 85 233 372em f const ant ( mVrpm) 112 132 333Rotor inertia ( J) (kgmiddotcmmiddot s2) 044times 10-3 069times10-3 174times10-3

Armature res is tan ce ( Ω) 2 21 123 254

Protection s tructur e Totallyenclosed

Insulat ion type T ype BEnvir onmental co nditionst emper at ure () 0~40hum idity ( ) 90 RH or less ( no dew condensat ion)

Weight ( kg) 2 4 30 52So urc e S hib au ra En gin eer ing W ork s Co Ltd

26215

Characteristics of AC Servo Drives

Model

Item ADM-061A ADM-121A ADM-252A

Motor output (W ) 60 120 250Voltage of main circui t (V(dc)) 140 280Voltage of control circuit (A( dc)) 100200200Maximum output cur rent (A ) 6 8 8Maximum input cur rent (A ) 37 63 45Speed control range 10001

load charge (0~100 ) 01 or belowvoltage fluctuation ( 10 ) 01 or belowtemperature change (25) 0 5 or below

Control method Transis tor PWM produces a s inusoidal waveSpeed feedback Semi-absolute encoderSpeed command voltage ( V(dc)) 10rated speedCommand input impedance (k Ω) 10Environ mental conditions

temperature () 0~15

humidity ( ) 90 RH or less (no dew condensation)Weight (kg) 35

S o u rce S h ib a u ra Eng in eerin g Wo rks Co Ltd

27215

永磁交流伺服馬達的規格

GD2 (kgfcm2)

J (gfcmmiddots2)

090

時間額定連續絕緣種別F種振動階級V15取付方式直結形構造全閉自冷形塗裝色N15激磁方式希土類永久磁石周圍溫度0~+40濕度85RH以下(結露)

共通式樣

194概略重量 (kgf)

023轉子慣量

17靜止摩擦

DC24V plusmn 10額定電壓

保持

Encoder 2000PR速度位置檢出器

341概略重量 (kgf)

972GD2 (kgfcm2)

248J (gfcmmiddots2)轉子慣量

2353功率變率 (kws)

3000最大轉速 (rpm)

3000額定轉速 (rpm)

610瞬時最大 (kgfcm)

244額定 (kgfcm)

750額定出力 (w)

8CB75-2SE6馬達型號

DOSA016B-CB752伺服驅動器型號

28215

永磁交流伺服驅動器的規格

伺服馬達 型號 5CB06 -1 SE 6F 5CB12-1 SE 6F 7CB20-1 SE 6F 7CB30-2S E 6F 8CB5 0-2S E 6F 8 CB7 5-2S E6 F

額定輸出 Pr W 60 120 200 300 5000 750額定線間電壓 Vt V 318 43 1 54 5 107 7 118 5 1494額定扭矩 T kg fcm 195 39 65 9 7 16 2 24 4連續 sta ll扭矩 Ts kg fcm 21 42 71 10 7 17 8 26 8額定相電流 Ig A 18 22 28 2 0 3 0 3 4額定轉速 Ng rpm 3000 3000 3000 3000 3000 3000瞬間最大扭矩 Tp( N) kg fcm 5 85 11 7 19 5 20 2 48 7 73 1瞬間最大機子電流

Ip A 54 66 84 6 0 9 0 10 2

額定 pow er ra te Q R k wsec 5 82 11 9 939 14 1 16 7 23 5轉矩常數 K T kg fc m

A1 23 197 255 535 611 7 92

誘起電壓常數 K E Jkrp m 126 20 2 26 1 54 9 62 7 81 4轉子慣量 J g fcms 0 0 64times 012 5times 044 1times 065 8times 1 5 4times 2 4 8times

機子阻抗 Ra Ω 9 12 603 420 837 423 3 27機子感應 La mH 546 468 795 17 4 12 1 10 2機械時間常數 Tm ms ec 3 94 198 291 196 178 1032電氣時間常數 Te ms ec 0 60 078 189 205 286 3 12重量 k gf 0 71 089 155 182 259 3 41絕緣等級 F 種 F種 F種 F種 F 種 F 種機 額定電壓 V械 靜止摩擦扭力 k gfcm 3 3 12 12 24 24式 轉子慣量 kgfcm

s0 02times 10 0 02times 10 01times 10 01times 10 023times 10 0 23times 10

煞 消費電流 029A 029A 045A 045A 044A 044A

車周圍溫度 0~40

29215

State of the Art AC Servos

High Speed SpindleAC Servo Motor

High Torque Motor Spindle Motor

30215

Non-Salient Pole for AC Servo Motor

永磁馬達的轉子根據其結構可分為

Salient-pole (凸極式)氣隙分佈不均勻具有磁阻扭矩效率較高轉矩漣波較大但可經由轉子設計降低構造較複雜成本較高主要應用於高效率壓縮機

Non- salient-pole (隱極式) 氣隙均勻分佈外表呈現圓柱狀亦稱之為圓柱式(cylindrical-type)磁鐵貼覆於轉子表面或以不鏽鋼環套住轉矩漣波較小主要應用於伺服馬達

Non-salient po leSalient pole

6

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

31215

Architecture of Motor Drive

Controller

PowerAmp Motor Load

Man-Machine InterfaceSignal Processing amp PWM Control Vector Control Control Loop Control

PowerSource

Spee d

Torqu e

32215

伺服馬達驅動系統的控制架構

Power source (converter)

Semiconductor driver

Servomotor

Position speed sensor

Mechanical driver

Power control

GTO transistor MOSFET

Signal generator

IC OP amplifier semiconductor sensor

Control

Microprocessor DSP

GATE signal

Control

Controller

voltagecurrent

Gear backlash

Friction Compliance

Sensor

Microelectronics Power electronics Materials

Linearized decoupled p ower amplifier by minor curren t and speed lo ops

Level 1

Level 2

Level 3

33215

直流伺服馬達驅動器的系統方塊圖

Refere nce speed

Speed amplifie r

Curre nt amplifie r

PWM circuit

Rectifier bridg e

Tra nsisto r bridg e

DC Moto r

Tria ngula r wav e gene ratio n circ uit

Speed f eed back

Compa rat or

Curre nt f eedb ack

Filter Tach oge ner ator

Driver

Driver

Driver

Driver

DCM

TG

+minus

+minus

34215

+minus

交流伺服馬達驅動器的系統方塊圖

Reference speed

Speed amplifier

DC-SIN conversion Rectifier

bridge

Transistor bridge

Three-ph ase synchronous

motorSpeed feedback

Comparator

Speed detection

circuitRotary encoder

Driver

Driver

Driver

Driver

SM

RE

++minus

Driver

Driver

Comparator

Comparator

Triangular wave generation circuit

Sine wave generation

circuit

Rotor position detector

+

minus

minusminusminus

minus

Current amplifier

Current feedback

U

V

W

35215

Typical Motion Control System Block Diagram

Posi ti o nCo ntr oll er

Velo ci tyCo ntr oll er

Velo ci ty Fe e db ac k

Posi ti o n Fe ed b ac k

++- -

Ma ch in e Ta bl eCurre nt

Co ntr oll er

+

-Pow er

Amplifier

Curre nt Fe ed b ac k

Mo t or

Mo ti o nPlan ni n g

Comma n dInt erpr et er

Ma ch in eOp erat io n

CADCAM

Operation Command

MotionCommand

PositionCommand

Veloc ityCommand

36215

Hierarchical Control Architecture for AC Drive

ServoController

ACDCConverter

DCACConverter

VectorController

FieldController

FluxEstimator

AC MotorShaft

sensor

CurrentController

Cur re nt C on trolTo rq ue Co ntr ol

Back em f C on trol

Positio n amp V elo city C on tr ol

PWMController

Position amp Velocityestimator

PWM (Volt ag e) Co ntr ol

Cur re nt amp

volta geamp

positi onfee db ack

7

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

37215

AC Servo Drive Control

for asynchronousmachines

fiel d we ak en in g fiel d c on trol ler

sp ee dco ntr oll er

curre ntco ntr oll ers

-

_ -

- M3~

Encoder

n iq

idψ

ϕ

ψ

machinemodel

ir

vr

φjeminus

φjeminus

φjeminus

for sy nc hr on o usmac hi ne s 38215

Modeling of the Servo Motor with Connected Load Mechanical Nonlinear Dynamics

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+ Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θ L

Kv

TL

θ m

Tm

G fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

The load dynamics will couple to the motor as external disturbancesPower converter exists significant nonlinearity and voltage and current limitsControl algorithms and parameters are critical for specific applications

Controller

Power Converter amp Sensors

+Gp

+

minus

+

minusG v

minusGi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmG fi

RKs

v a

ia

ωm

fwG

fpG

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmGf i

RKs

v a

ia

ωm

fwG

fpG

21

2

22

22

mm

nnn

ss

ωωξωωξ

++++

21

2

22

22

mm

nnnss

ωωξωωξ

++++

40215

Digital AC Servo Motor Controller Design Issues

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

41215

Why Use DSP for Motor ControlTo Realize Complex Control amp Interface Algorithm

Rectifier Charger Inverter

T2

T1

110220V5060 Hz

+

_

ACload

EM

I 3-phaseload

C1

C2

M otorGenerator Flywheel

Battery

uεud

bull Power Factor Control

bull Regenerative Braking Control

bull DC-Link Voltage Regu lation

bull DC-Link Cap M inimization

bull PWM Contro lbull Vector Controlbull Current Controlbull Voltage Controlbull Power F low Controlbull Auto-Tuning

42215

Fully Digital Control Scheme for PMAC Drives

+

minusbase

drive

ADC

ADC

32

ϕϕ

_

_

ias

ibs

ics

23

ϕϕ

vcs

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

dd t

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )PM AC

servomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Feedback Signal

Processing

Servo Control FieldTorqueamp

CurrentVector

amp PW M

Control

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 3: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

3

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

13215

Composition of a Motion Control System

tacho-generator

encoder

servo driveposition controller

control box

The servo motor is conn ect ed to a mech anical loadThe tacho-g enerato r is usu ally not used in modern digital servo driveThe servo dri ve unit may be multiple-axis and con sist s of a motion controllerThe control unit provides man-machin e interf ace 14215

Modern Digital AC Servo Drive

encoder

servo driveposition controller

control box

AC Servo Motor

Optical network interface

Single-unit solution

15215

Typical Time and Frequency Responses

2000 rp m

-200 0 r pm

Speed

Curre nt

Gain

)( jwG

0db-3db ω

(rad s)

An example of mo tor current waveforms and Bode diagram of the whole system (a) speed response to step command and primary-phase current waveform (b) Bode diagrams of the speed-control system

dBBW 3minus

16215

Selection of Servo Drive Interface

伺服驅動器 優 點 缺 點

Pulse Servo Drive Step Drive

1 全數位化界面簡單

2 可接步進馬達

1 伺服動態響應受限

Velocity Drive Torque Drive

1 伺服動態響應佳

2 可接變頻器

1 類比界面輸出易飄移或

offset

PWM Power Amplifier

1 全數位界面

2 伺服動態響應較佳

3 功率放大器成本低

1 標準功率放大器尚未普及

2 使用者不易教育

Network Drive (SERCOS 1394

USB CAN)

1 網路介面配線容易

2 可依不同介面定義進行位置

速度電流等控制

1 網路界面驅動器尚未普及

2 各標準互不相容

17215

Evolution of Electrical Machines

Asynchro nous

Synchro nous

AC and DC Pow er Sup ply

Wound rotor

Squirrel cage

Salient poles

Var reluctance

Perm Magnet

Series

Compound

Shunt

Per Magnet

POWER CONVERSION

Universal

AC variable speed driv es

Intellige ntMoto r

AC Servo Brushless

DC Servo

Power Elect ronics

OPEN LOOP

Digital con trol

CLOSE LOOP

Smart I nte rface

EMBEDDED INTELLIGENCE

DC Brushless

Disc Mag net Steppe r

Hybrid Steppe r

VRSteppe r

DC

AC

18215

Induction Motor vs PM Synchronous Motor

ROTOR

AB

C

A

B

C

A

B

C

A

B

CSTATOR

ROTORCONDUCTOR

ROTOR

STATORSEGMENT

ROTORMAGNET

A

B

C

AC Induction Motor AC S ervo Motor

4

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

19215

What could an AC vector system do in servo applications

Speed Regulation up to 5 open loop 001 closed loop wexternal encoderFull torque at zero speedSmoothness at low speeds will be similarPositioning applications with low acceleration low response amp low bandwidth requirements (High power large inertia sy stem)

20215

AC Servo Driver with Synchronous or Induction Motors

R Lessmeie r W Schu macher and W Le onha rd Mic rop rocessor - cont rol led AC - serv o d river wit h synch rono us or inducti on m oto rs whic h is p refe rable IE E E Tra ns on Ind Ap pli vol 22 n o 5 pp 8 12-8 19 Sept Oct 1 986

AbstractmdashWith the rec ent advances of power transistors and microprocessors it has become possible to design high-dynamic-performance ac-servo drives free of moving contacts using synchronous or asynchronous motors Both schemes have their particular strengths A general control principle based on field or rotor orientation is described which has been re ali zed wi th a state-of-the-art microcomputer where all the signal processing including modulation of the inverter is performed by software Extensive tes ts have been carried out with different motors to compare the charact erist ics of the various types of drives

21215

VF Vector Induction Drive vs PM AC Servo

Heat buildup at low speedsEven though full torque at zero speed is possible the motor will run hot at low speeds because of the induction motor design The motor may need to be oversized to handle these effects or have a blower added

Very slow response times decreased bandwidth The AC Induction motor has higher rotor inertia due to its constructionHigher peak torques are required for ACCDEC

Potential for stability problemsThe overall bandwidth will be lower with the VFD system A system bandwidth lower than 40 radssec Could have stability problems in a closed loop system

There are Disadvantages of using a AC VFD for motion instead of AC Servo

22215

永磁交流伺服馬達的結構

permanentmagnetcore Armature

winding

永磁式交流馬達之剖面圖

stator winding

north pole rotor

frame stator iron core

end brackets

bearings

stationary field winding

south pole rotor

shaft

field winding holder

(a) (b)

複合式永磁式交流馬達之剖面圖

23215

Optimal Capacity Ranges of Brushless Servomotors

Output (W)Varieties

Stepping mo tor (includin g line ar mot or)

PM brus hless mot or

Vector-c ont rol inductio n m otor

Hall mot or

3 30 30010010 1000 3000

永磁式交流伺服馬達的構造

statorcoil

statorlaminatedcoil ferrite PM rotor pole

angular position andvelocity sensor

24215

Demagnetization Curves of Several Types of Permanent Magnets

14

12

10

8

6

4

2

012 10 8 6 4 2

磁通密

度[T

][1

04G

]

磁場強度 [ kOe]

Alnico

Ferrite

Rare-earthcobalt

Neodymium-iron

5

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

25215

Characteristics of AC Servo Motors

Model

Item ASM-061M AS M- 121M ASM-252MRated output ( W) 60 120 250Rated tor que ( kgmiddotcm) 1 95 390 812Rated speed ( rpm) 3000Rated voltage (V( a c) ) 37 41 103Rated curr ent (A(ac)) 1 6 27 22Maximum torque (kgmiddot cm) 9 75 195 406Maximum speed (rpm) 4000Power rate kWs 0 85 216 372Torque const ant (kgmiddotcmA) 0 95 113 288Mechanical time constant ( mmiddotsec) 143 894 724Electrical tim e constant (mmiddot sec) 1 85 233 372em f const ant ( mVrpm) 112 132 333Rotor inertia ( J) (kgmiddotcmmiddot s2) 044times 10-3 069times10-3 174times10-3

Armature res is tan ce ( Ω) 2 21 123 254

Protection s tructur e Totallyenclosed

Insulat ion type T ype BEnvir onmental co nditionst emper at ure () 0~40hum idity ( ) 90 RH or less ( no dew condensat ion)

Weight ( kg) 2 4 30 52So urc e S hib au ra En gin eer ing W ork s Co Ltd

26215

Characteristics of AC Servo Drives

Model

Item ADM-061A ADM-121A ADM-252A

Motor output (W ) 60 120 250Voltage of main circui t (V(dc)) 140 280Voltage of control circuit (A( dc)) 100200200Maximum output cur rent (A ) 6 8 8Maximum input cur rent (A ) 37 63 45Speed control range 10001

load charge (0~100 ) 01 or belowvoltage fluctuation ( 10 ) 01 or belowtemperature change (25) 0 5 or below

Control method Transis tor PWM produces a s inusoidal waveSpeed feedback Semi-absolute encoderSpeed command voltage ( V(dc)) 10rated speedCommand input impedance (k Ω) 10Environ mental conditions

temperature () 0~15

humidity ( ) 90 RH or less (no dew condensation)Weight (kg) 35

S o u rce S h ib a u ra Eng in eerin g Wo rks Co Ltd

27215

永磁交流伺服馬達的規格

GD2 (kgfcm2)

J (gfcmmiddots2)

090

時間額定連續絕緣種別F種振動階級V15取付方式直結形構造全閉自冷形塗裝色N15激磁方式希土類永久磁石周圍溫度0~+40濕度85RH以下(結露)

共通式樣

194概略重量 (kgf)

023轉子慣量

17靜止摩擦

DC24V plusmn 10額定電壓

保持

Encoder 2000PR速度位置檢出器

341概略重量 (kgf)

972GD2 (kgfcm2)

248J (gfcmmiddots2)轉子慣量

2353功率變率 (kws)

3000最大轉速 (rpm)

3000額定轉速 (rpm)

610瞬時最大 (kgfcm)

244額定 (kgfcm)

750額定出力 (w)

8CB75-2SE6馬達型號

DOSA016B-CB752伺服驅動器型號

28215

永磁交流伺服驅動器的規格

伺服馬達 型號 5CB06 -1 SE 6F 5CB12-1 SE 6F 7CB20-1 SE 6F 7CB30-2S E 6F 8CB5 0-2S E 6F 8 CB7 5-2S E6 F

額定輸出 Pr W 60 120 200 300 5000 750額定線間電壓 Vt V 318 43 1 54 5 107 7 118 5 1494額定扭矩 T kg fcm 195 39 65 9 7 16 2 24 4連續 sta ll扭矩 Ts kg fcm 21 42 71 10 7 17 8 26 8額定相電流 Ig A 18 22 28 2 0 3 0 3 4額定轉速 Ng rpm 3000 3000 3000 3000 3000 3000瞬間最大扭矩 Tp( N) kg fcm 5 85 11 7 19 5 20 2 48 7 73 1瞬間最大機子電流

Ip A 54 66 84 6 0 9 0 10 2

額定 pow er ra te Q R k wsec 5 82 11 9 939 14 1 16 7 23 5轉矩常數 K T kg fc m

A1 23 197 255 535 611 7 92

誘起電壓常數 K E Jkrp m 126 20 2 26 1 54 9 62 7 81 4轉子慣量 J g fcms 0 0 64times 012 5times 044 1times 065 8times 1 5 4times 2 4 8times

機子阻抗 Ra Ω 9 12 603 420 837 423 3 27機子感應 La mH 546 468 795 17 4 12 1 10 2機械時間常數 Tm ms ec 3 94 198 291 196 178 1032電氣時間常數 Te ms ec 0 60 078 189 205 286 3 12重量 k gf 0 71 089 155 182 259 3 41絕緣等級 F 種 F種 F種 F種 F 種 F 種機 額定電壓 V械 靜止摩擦扭力 k gfcm 3 3 12 12 24 24式 轉子慣量 kgfcm

s0 02times 10 0 02times 10 01times 10 01times 10 023times 10 0 23times 10

煞 消費電流 029A 029A 045A 045A 044A 044A

車周圍溫度 0~40

29215

State of the Art AC Servos

High Speed SpindleAC Servo Motor

High Torque Motor Spindle Motor

30215

Non-Salient Pole for AC Servo Motor

永磁馬達的轉子根據其結構可分為

Salient-pole (凸極式)氣隙分佈不均勻具有磁阻扭矩效率較高轉矩漣波較大但可經由轉子設計降低構造較複雜成本較高主要應用於高效率壓縮機

Non- salient-pole (隱極式) 氣隙均勻分佈外表呈現圓柱狀亦稱之為圓柱式(cylindrical-type)磁鐵貼覆於轉子表面或以不鏽鋼環套住轉矩漣波較小主要應用於伺服馬達

Non-salient po leSalient pole

6

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

31215

Architecture of Motor Drive

Controller

PowerAmp Motor Load

Man-Machine InterfaceSignal Processing amp PWM Control Vector Control Control Loop Control

PowerSource

Spee d

Torqu e

32215

伺服馬達驅動系統的控制架構

Power source (converter)

Semiconductor driver

Servomotor

Position speed sensor

Mechanical driver

Power control

GTO transistor MOSFET

Signal generator

IC OP amplifier semiconductor sensor

Control

Microprocessor DSP

GATE signal

Control

Controller

voltagecurrent

Gear backlash

Friction Compliance

Sensor

Microelectronics Power electronics Materials

Linearized decoupled p ower amplifier by minor curren t and speed lo ops

Level 1

Level 2

Level 3

33215

直流伺服馬達驅動器的系統方塊圖

Refere nce speed

Speed amplifie r

Curre nt amplifie r

PWM circuit

Rectifier bridg e

Tra nsisto r bridg e

DC Moto r

Tria ngula r wav e gene ratio n circ uit

Speed f eed back

Compa rat or

Curre nt f eedb ack

Filter Tach oge ner ator

Driver

Driver

Driver

Driver

DCM

TG

+minus

+minus

34215

+minus

交流伺服馬達驅動器的系統方塊圖

Reference speed

Speed amplifier

DC-SIN conversion Rectifier

bridge

Transistor bridge

Three-ph ase synchronous

motorSpeed feedback

Comparator

Speed detection

circuitRotary encoder

Driver

Driver

Driver

Driver

SM

RE

++minus

Driver

Driver

Comparator

Comparator

Triangular wave generation circuit

Sine wave generation

circuit

Rotor position detector

+

minus

minusminusminus

minus

Current amplifier

Current feedback

U

V

W

35215

Typical Motion Control System Block Diagram

Posi ti o nCo ntr oll er

Velo ci tyCo ntr oll er

Velo ci ty Fe e db ac k

Posi ti o n Fe ed b ac k

++- -

Ma ch in e Ta bl eCurre nt

Co ntr oll er

+

-Pow er

Amplifier

Curre nt Fe ed b ac k

Mo t or

Mo ti o nPlan ni n g

Comma n dInt erpr et er

Ma ch in eOp erat io n

CADCAM

Operation Command

MotionCommand

PositionCommand

Veloc ityCommand

36215

Hierarchical Control Architecture for AC Drive

ServoController

ACDCConverter

DCACConverter

VectorController

FieldController

FluxEstimator

AC MotorShaft

sensor

CurrentController

Cur re nt C on trolTo rq ue Co ntr ol

Back em f C on trol

Positio n amp V elo city C on tr ol

PWMController

Position amp Velocityestimator

PWM (Volt ag e) Co ntr ol

Cur re nt amp

volta geamp

positi onfee db ack

7

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

37215

AC Servo Drive Control

for asynchronousmachines

fiel d we ak en in g fiel d c on trol ler

sp ee dco ntr oll er

curre ntco ntr oll ers

-

_ -

- M3~

Encoder

n iq

idψ

ϕ

ψ

machinemodel

ir

vr

φjeminus

φjeminus

φjeminus

for sy nc hr on o usmac hi ne s 38215

Modeling of the Servo Motor with Connected Load Mechanical Nonlinear Dynamics

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+ Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θ L

Kv

TL

θ m

Tm

G fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

The load dynamics will couple to the motor as external disturbancesPower converter exists significant nonlinearity and voltage and current limitsControl algorithms and parameters are critical for specific applications

Controller

Power Converter amp Sensors

+Gp

+

minus

+

minusG v

minusGi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmG fi

RKs

v a

ia

ωm

fwG

fpG

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmGf i

RKs

v a

ia

ωm

fwG

fpG

21

2

22

22

mm

nnn

ss

ωωξωωξ

++++

21

2

22

22

mm

nnnss

ωωξωωξ

++++

40215

Digital AC Servo Motor Controller Design Issues

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

41215

Why Use DSP for Motor ControlTo Realize Complex Control amp Interface Algorithm

Rectifier Charger Inverter

T2

T1

110220V5060 Hz

+

_

ACload

EM

I 3-phaseload

C1

C2

M otorGenerator Flywheel

Battery

uεud

bull Power Factor Control

bull Regenerative Braking Control

bull DC-Link Voltage Regu lation

bull DC-Link Cap M inimization

bull PWM Contro lbull Vector Controlbull Current Controlbull Voltage Controlbull Power F low Controlbull Auto-Tuning

42215

Fully Digital Control Scheme for PMAC Drives

+

minusbase

drive

ADC

ADC

32

ϕϕ

_

_

ias

ibs

ics

23

ϕϕ

vcs

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

dd t

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )PM AC

servomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Feedback Signal

Processing

Servo Control FieldTorqueamp

CurrentVector

amp PW M

Control

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 4: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

4

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

19215

What could an AC vector system do in servo applications

Speed Regulation up to 5 open loop 001 closed loop wexternal encoderFull torque at zero speedSmoothness at low speeds will be similarPositioning applications with low acceleration low response amp low bandwidth requirements (High power large inertia sy stem)

20215

AC Servo Driver with Synchronous or Induction Motors

R Lessmeie r W Schu macher and W Le onha rd Mic rop rocessor - cont rol led AC - serv o d river wit h synch rono us or inducti on m oto rs whic h is p refe rable IE E E Tra ns on Ind Ap pli vol 22 n o 5 pp 8 12-8 19 Sept Oct 1 986

AbstractmdashWith the rec ent advances of power transistors and microprocessors it has become possible to design high-dynamic-performance ac-servo drives free of moving contacts using synchronous or asynchronous motors Both schemes have their particular strengths A general control principle based on field or rotor orientation is described which has been re ali zed wi th a state-of-the-art microcomputer where all the signal processing including modulation of the inverter is performed by software Extensive tes ts have been carried out with different motors to compare the charact erist ics of the various types of drives

21215

VF Vector Induction Drive vs PM AC Servo

Heat buildup at low speedsEven though full torque at zero speed is possible the motor will run hot at low speeds because of the induction motor design The motor may need to be oversized to handle these effects or have a blower added

Very slow response times decreased bandwidth The AC Induction motor has higher rotor inertia due to its constructionHigher peak torques are required for ACCDEC

Potential for stability problemsThe overall bandwidth will be lower with the VFD system A system bandwidth lower than 40 radssec Could have stability problems in a closed loop system

There are Disadvantages of using a AC VFD for motion instead of AC Servo

22215

永磁交流伺服馬達的結構

permanentmagnetcore Armature

winding

永磁式交流馬達之剖面圖

stator winding

north pole rotor

frame stator iron core

end brackets

bearings

stationary field winding

south pole rotor

shaft

field winding holder

(a) (b)

複合式永磁式交流馬達之剖面圖

23215

Optimal Capacity Ranges of Brushless Servomotors

Output (W)Varieties

Stepping mo tor (includin g line ar mot or)

PM brus hless mot or

Vector-c ont rol inductio n m otor

Hall mot or

3 30 30010010 1000 3000

永磁式交流伺服馬達的構造

statorcoil

statorlaminatedcoil ferrite PM rotor pole

angular position andvelocity sensor

24215

Demagnetization Curves of Several Types of Permanent Magnets

14

12

10

8

6

4

2

012 10 8 6 4 2

磁通密

度[T

][1

04G

]

磁場強度 [ kOe]

Alnico

Ferrite

Rare-earthcobalt

Neodymium-iron

5

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

25215

Characteristics of AC Servo Motors

Model

Item ASM-061M AS M- 121M ASM-252MRated output ( W) 60 120 250Rated tor que ( kgmiddotcm) 1 95 390 812Rated speed ( rpm) 3000Rated voltage (V( a c) ) 37 41 103Rated curr ent (A(ac)) 1 6 27 22Maximum torque (kgmiddot cm) 9 75 195 406Maximum speed (rpm) 4000Power rate kWs 0 85 216 372Torque const ant (kgmiddotcmA) 0 95 113 288Mechanical time constant ( mmiddotsec) 143 894 724Electrical tim e constant (mmiddot sec) 1 85 233 372em f const ant ( mVrpm) 112 132 333Rotor inertia ( J) (kgmiddotcmmiddot s2) 044times 10-3 069times10-3 174times10-3

Armature res is tan ce ( Ω) 2 21 123 254

Protection s tructur e Totallyenclosed

Insulat ion type T ype BEnvir onmental co nditionst emper at ure () 0~40hum idity ( ) 90 RH or less ( no dew condensat ion)

Weight ( kg) 2 4 30 52So urc e S hib au ra En gin eer ing W ork s Co Ltd

26215

Characteristics of AC Servo Drives

Model

Item ADM-061A ADM-121A ADM-252A

Motor output (W ) 60 120 250Voltage of main circui t (V(dc)) 140 280Voltage of control circuit (A( dc)) 100200200Maximum output cur rent (A ) 6 8 8Maximum input cur rent (A ) 37 63 45Speed control range 10001

load charge (0~100 ) 01 or belowvoltage fluctuation ( 10 ) 01 or belowtemperature change (25) 0 5 or below

Control method Transis tor PWM produces a s inusoidal waveSpeed feedback Semi-absolute encoderSpeed command voltage ( V(dc)) 10rated speedCommand input impedance (k Ω) 10Environ mental conditions

temperature () 0~15

humidity ( ) 90 RH or less (no dew condensation)Weight (kg) 35

S o u rce S h ib a u ra Eng in eerin g Wo rks Co Ltd

27215

永磁交流伺服馬達的規格

GD2 (kgfcm2)

J (gfcmmiddots2)

090

時間額定連續絕緣種別F種振動階級V15取付方式直結形構造全閉自冷形塗裝色N15激磁方式希土類永久磁石周圍溫度0~+40濕度85RH以下(結露)

共通式樣

194概略重量 (kgf)

023轉子慣量

17靜止摩擦

DC24V plusmn 10額定電壓

保持

Encoder 2000PR速度位置檢出器

341概略重量 (kgf)

972GD2 (kgfcm2)

248J (gfcmmiddots2)轉子慣量

2353功率變率 (kws)

3000最大轉速 (rpm)

3000額定轉速 (rpm)

610瞬時最大 (kgfcm)

244額定 (kgfcm)

750額定出力 (w)

8CB75-2SE6馬達型號

DOSA016B-CB752伺服驅動器型號

28215

永磁交流伺服驅動器的規格

伺服馬達 型號 5CB06 -1 SE 6F 5CB12-1 SE 6F 7CB20-1 SE 6F 7CB30-2S E 6F 8CB5 0-2S E 6F 8 CB7 5-2S E6 F

額定輸出 Pr W 60 120 200 300 5000 750額定線間電壓 Vt V 318 43 1 54 5 107 7 118 5 1494額定扭矩 T kg fcm 195 39 65 9 7 16 2 24 4連續 sta ll扭矩 Ts kg fcm 21 42 71 10 7 17 8 26 8額定相電流 Ig A 18 22 28 2 0 3 0 3 4額定轉速 Ng rpm 3000 3000 3000 3000 3000 3000瞬間最大扭矩 Tp( N) kg fcm 5 85 11 7 19 5 20 2 48 7 73 1瞬間最大機子電流

Ip A 54 66 84 6 0 9 0 10 2

額定 pow er ra te Q R k wsec 5 82 11 9 939 14 1 16 7 23 5轉矩常數 K T kg fc m

A1 23 197 255 535 611 7 92

誘起電壓常數 K E Jkrp m 126 20 2 26 1 54 9 62 7 81 4轉子慣量 J g fcms 0 0 64times 012 5times 044 1times 065 8times 1 5 4times 2 4 8times

機子阻抗 Ra Ω 9 12 603 420 837 423 3 27機子感應 La mH 546 468 795 17 4 12 1 10 2機械時間常數 Tm ms ec 3 94 198 291 196 178 1032電氣時間常數 Te ms ec 0 60 078 189 205 286 3 12重量 k gf 0 71 089 155 182 259 3 41絕緣等級 F 種 F種 F種 F種 F 種 F 種機 額定電壓 V械 靜止摩擦扭力 k gfcm 3 3 12 12 24 24式 轉子慣量 kgfcm

s0 02times 10 0 02times 10 01times 10 01times 10 023times 10 0 23times 10

煞 消費電流 029A 029A 045A 045A 044A 044A

車周圍溫度 0~40

29215

State of the Art AC Servos

High Speed SpindleAC Servo Motor

High Torque Motor Spindle Motor

30215

Non-Salient Pole for AC Servo Motor

永磁馬達的轉子根據其結構可分為

Salient-pole (凸極式)氣隙分佈不均勻具有磁阻扭矩效率較高轉矩漣波較大但可經由轉子設計降低構造較複雜成本較高主要應用於高效率壓縮機

Non- salient-pole (隱極式) 氣隙均勻分佈外表呈現圓柱狀亦稱之為圓柱式(cylindrical-type)磁鐵貼覆於轉子表面或以不鏽鋼環套住轉矩漣波較小主要應用於伺服馬達

Non-salient po leSalient pole

6

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

31215

Architecture of Motor Drive

Controller

PowerAmp Motor Load

Man-Machine InterfaceSignal Processing amp PWM Control Vector Control Control Loop Control

PowerSource

Spee d

Torqu e

32215

伺服馬達驅動系統的控制架構

Power source (converter)

Semiconductor driver

Servomotor

Position speed sensor

Mechanical driver

Power control

GTO transistor MOSFET

Signal generator

IC OP amplifier semiconductor sensor

Control

Microprocessor DSP

GATE signal

Control

Controller

voltagecurrent

Gear backlash

Friction Compliance

Sensor

Microelectronics Power electronics Materials

Linearized decoupled p ower amplifier by minor curren t and speed lo ops

Level 1

Level 2

Level 3

33215

直流伺服馬達驅動器的系統方塊圖

Refere nce speed

Speed amplifie r

Curre nt amplifie r

PWM circuit

Rectifier bridg e

Tra nsisto r bridg e

DC Moto r

Tria ngula r wav e gene ratio n circ uit

Speed f eed back

Compa rat or

Curre nt f eedb ack

Filter Tach oge ner ator

Driver

Driver

Driver

Driver

DCM

TG

+minus

+minus

34215

+minus

交流伺服馬達驅動器的系統方塊圖

Reference speed

Speed amplifier

DC-SIN conversion Rectifier

bridge

Transistor bridge

Three-ph ase synchronous

motorSpeed feedback

Comparator

Speed detection

circuitRotary encoder

Driver

Driver

Driver

Driver

SM

RE

++minus

Driver

Driver

Comparator

Comparator

Triangular wave generation circuit

Sine wave generation

circuit

Rotor position detector

+

minus

minusminusminus

minus

Current amplifier

Current feedback

U

V

W

35215

Typical Motion Control System Block Diagram

Posi ti o nCo ntr oll er

Velo ci tyCo ntr oll er

Velo ci ty Fe e db ac k

Posi ti o n Fe ed b ac k

++- -

Ma ch in e Ta bl eCurre nt

Co ntr oll er

+

-Pow er

Amplifier

Curre nt Fe ed b ac k

Mo t or

Mo ti o nPlan ni n g

Comma n dInt erpr et er

Ma ch in eOp erat io n

CADCAM

Operation Command

MotionCommand

PositionCommand

Veloc ityCommand

36215

Hierarchical Control Architecture for AC Drive

ServoController

ACDCConverter

DCACConverter

VectorController

FieldController

FluxEstimator

AC MotorShaft

sensor

CurrentController

Cur re nt C on trolTo rq ue Co ntr ol

Back em f C on trol

Positio n amp V elo city C on tr ol

PWMController

Position amp Velocityestimator

PWM (Volt ag e) Co ntr ol

Cur re nt amp

volta geamp

positi onfee db ack

7

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

37215

AC Servo Drive Control

for asynchronousmachines

fiel d we ak en in g fiel d c on trol ler

sp ee dco ntr oll er

curre ntco ntr oll ers

-

_ -

- M3~

Encoder

n iq

idψ

ϕ

ψ

machinemodel

ir

vr

φjeminus

φjeminus

φjeminus

for sy nc hr on o usmac hi ne s 38215

Modeling of the Servo Motor with Connected Load Mechanical Nonlinear Dynamics

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+ Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θ L

Kv

TL

θ m

Tm

G fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

The load dynamics will couple to the motor as external disturbancesPower converter exists significant nonlinearity and voltage and current limitsControl algorithms and parameters are critical for specific applications

Controller

Power Converter amp Sensors

+Gp

+

minus

+

minusG v

minusGi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmG fi

RKs

v a

ia

ωm

fwG

fpG

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmGf i

RKs

v a

ia

ωm

fwG

fpG

21

2

22

22

mm

nnn

ss

ωωξωωξ

++++

21

2

22

22

mm

nnnss

ωωξωωξ

++++

40215

Digital AC Servo Motor Controller Design Issues

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

41215

Why Use DSP for Motor ControlTo Realize Complex Control amp Interface Algorithm

Rectifier Charger Inverter

T2

T1

110220V5060 Hz

+

_

ACload

EM

I 3-phaseload

C1

C2

M otorGenerator Flywheel

Battery

uεud

bull Power Factor Control

bull Regenerative Braking Control

bull DC-Link Voltage Regu lation

bull DC-Link Cap M inimization

bull PWM Contro lbull Vector Controlbull Current Controlbull Voltage Controlbull Power F low Controlbull Auto-Tuning

42215

Fully Digital Control Scheme for PMAC Drives

+

minusbase

drive

ADC

ADC

32

ϕϕ

_

_

ias

ibs

ics

23

ϕϕ

vcs

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

dd t

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )PM AC

servomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Feedback Signal

Processing

Servo Control FieldTorqueamp

CurrentVector

amp PW M

Control

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 5: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

5

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

25215

Characteristics of AC Servo Motors

Model

Item ASM-061M AS M- 121M ASM-252MRated output ( W) 60 120 250Rated tor que ( kgmiddotcm) 1 95 390 812Rated speed ( rpm) 3000Rated voltage (V( a c) ) 37 41 103Rated curr ent (A(ac)) 1 6 27 22Maximum torque (kgmiddot cm) 9 75 195 406Maximum speed (rpm) 4000Power rate kWs 0 85 216 372Torque const ant (kgmiddotcmA) 0 95 113 288Mechanical time constant ( mmiddotsec) 143 894 724Electrical tim e constant (mmiddot sec) 1 85 233 372em f const ant ( mVrpm) 112 132 333Rotor inertia ( J) (kgmiddotcmmiddot s2) 044times 10-3 069times10-3 174times10-3

Armature res is tan ce ( Ω) 2 21 123 254

Protection s tructur e Totallyenclosed

Insulat ion type T ype BEnvir onmental co nditionst emper at ure () 0~40hum idity ( ) 90 RH or less ( no dew condensat ion)

Weight ( kg) 2 4 30 52So urc e S hib au ra En gin eer ing W ork s Co Ltd

26215

Characteristics of AC Servo Drives

Model

Item ADM-061A ADM-121A ADM-252A

Motor output (W ) 60 120 250Voltage of main circui t (V(dc)) 140 280Voltage of control circuit (A( dc)) 100200200Maximum output cur rent (A ) 6 8 8Maximum input cur rent (A ) 37 63 45Speed control range 10001

load charge (0~100 ) 01 or belowvoltage fluctuation ( 10 ) 01 or belowtemperature change (25) 0 5 or below

Control method Transis tor PWM produces a s inusoidal waveSpeed feedback Semi-absolute encoderSpeed command voltage ( V(dc)) 10rated speedCommand input impedance (k Ω) 10Environ mental conditions

temperature () 0~15

humidity ( ) 90 RH or less (no dew condensation)Weight (kg) 35

S o u rce S h ib a u ra Eng in eerin g Wo rks Co Ltd

27215

永磁交流伺服馬達的規格

GD2 (kgfcm2)

J (gfcmmiddots2)

090

時間額定連續絕緣種別F種振動階級V15取付方式直結形構造全閉自冷形塗裝色N15激磁方式希土類永久磁石周圍溫度0~+40濕度85RH以下(結露)

共通式樣

194概略重量 (kgf)

023轉子慣量

17靜止摩擦

DC24V plusmn 10額定電壓

保持

Encoder 2000PR速度位置檢出器

341概略重量 (kgf)

972GD2 (kgfcm2)

248J (gfcmmiddots2)轉子慣量

2353功率變率 (kws)

3000最大轉速 (rpm)

3000額定轉速 (rpm)

610瞬時最大 (kgfcm)

244額定 (kgfcm)

750額定出力 (w)

8CB75-2SE6馬達型號

DOSA016B-CB752伺服驅動器型號

28215

永磁交流伺服驅動器的規格

伺服馬達 型號 5CB06 -1 SE 6F 5CB12-1 SE 6F 7CB20-1 SE 6F 7CB30-2S E 6F 8CB5 0-2S E 6F 8 CB7 5-2S E6 F

額定輸出 Pr W 60 120 200 300 5000 750額定線間電壓 Vt V 318 43 1 54 5 107 7 118 5 1494額定扭矩 T kg fcm 195 39 65 9 7 16 2 24 4連續 sta ll扭矩 Ts kg fcm 21 42 71 10 7 17 8 26 8額定相電流 Ig A 18 22 28 2 0 3 0 3 4額定轉速 Ng rpm 3000 3000 3000 3000 3000 3000瞬間最大扭矩 Tp( N) kg fcm 5 85 11 7 19 5 20 2 48 7 73 1瞬間最大機子電流

Ip A 54 66 84 6 0 9 0 10 2

額定 pow er ra te Q R k wsec 5 82 11 9 939 14 1 16 7 23 5轉矩常數 K T kg fc m

A1 23 197 255 535 611 7 92

誘起電壓常數 K E Jkrp m 126 20 2 26 1 54 9 62 7 81 4轉子慣量 J g fcms 0 0 64times 012 5times 044 1times 065 8times 1 5 4times 2 4 8times

機子阻抗 Ra Ω 9 12 603 420 837 423 3 27機子感應 La mH 546 468 795 17 4 12 1 10 2機械時間常數 Tm ms ec 3 94 198 291 196 178 1032電氣時間常數 Te ms ec 0 60 078 189 205 286 3 12重量 k gf 0 71 089 155 182 259 3 41絕緣等級 F 種 F種 F種 F種 F 種 F 種機 額定電壓 V械 靜止摩擦扭力 k gfcm 3 3 12 12 24 24式 轉子慣量 kgfcm

s0 02times 10 0 02times 10 01times 10 01times 10 023times 10 0 23times 10

煞 消費電流 029A 029A 045A 045A 044A 044A

車周圍溫度 0~40

29215

State of the Art AC Servos

High Speed SpindleAC Servo Motor

High Torque Motor Spindle Motor

30215

Non-Salient Pole for AC Servo Motor

永磁馬達的轉子根據其結構可分為

Salient-pole (凸極式)氣隙分佈不均勻具有磁阻扭矩效率較高轉矩漣波較大但可經由轉子設計降低構造較複雜成本較高主要應用於高效率壓縮機

Non- salient-pole (隱極式) 氣隙均勻分佈外表呈現圓柱狀亦稱之為圓柱式(cylindrical-type)磁鐵貼覆於轉子表面或以不鏽鋼環套住轉矩漣波較小主要應用於伺服馬達

Non-salient po leSalient pole

6

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

31215

Architecture of Motor Drive

Controller

PowerAmp Motor Load

Man-Machine InterfaceSignal Processing amp PWM Control Vector Control Control Loop Control

PowerSource

Spee d

Torqu e

32215

伺服馬達驅動系統的控制架構

Power source (converter)

Semiconductor driver

Servomotor

Position speed sensor

Mechanical driver

Power control

GTO transistor MOSFET

Signal generator

IC OP amplifier semiconductor sensor

Control

Microprocessor DSP

GATE signal

Control

Controller

voltagecurrent

Gear backlash

Friction Compliance

Sensor

Microelectronics Power electronics Materials

Linearized decoupled p ower amplifier by minor curren t and speed lo ops

Level 1

Level 2

Level 3

33215

直流伺服馬達驅動器的系統方塊圖

Refere nce speed

Speed amplifie r

Curre nt amplifie r

PWM circuit

Rectifier bridg e

Tra nsisto r bridg e

DC Moto r

Tria ngula r wav e gene ratio n circ uit

Speed f eed back

Compa rat or

Curre nt f eedb ack

Filter Tach oge ner ator

Driver

Driver

Driver

Driver

DCM

TG

+minus

+minus

34215

+minus

交流伺服馬達驅動器的系統方塊圖

Reference speed

Speed amplifier

DC-SIN conversion Rectifier

bridge

Transistor bridge

Three-ph ase synchronous

motorSpeed feedback

Comparator

Speed detection

circuitRotary encoder

Driver

Driver

Driver

Driver

SM

RE

++minus

Driver

Driver

Comparator

Comparator

Triangular wave generation circuit

Sine wave generation

circuit

Rotor position detector

+

minus

minusminusminus

minus

Current amplifier

Current feedback

U

V

W

35215

Typical Motion Control System Block Diagram

Posi ti o nCo ntr oll er

Velo ci tyCo ntr oll er

Velo ci ty Fe e db ac k

Posi ti o n Fe ed b ac k

++- -

Ma ch in e Ta bl eCurre nt

Co ntr oll er

+

-Pow er

Amplifier

Curre nt Fe ed b ac k

Mo t or

Mo ti o nPlan ni n g

Comma n dInt erpr et er

Ma ch in eOp erat io n

CADCAM

Operation Command

MotionCommand

PositionCommand

Veloc ityCommand

36215

Hierarchical Control Architecture for AC Drive

ServoController

ACDCConverter

DCACConverter

VectorController

FieldController

FluxEstimator

AC MotorShaft

sensor

CurrentController

Cur re nt C on trolTo rq ue Co ntr ol

Back em f C on trol

Positio n amp V elo city C on tr ol

PWMController

Position amp Velocityestimator

PWM (Volt ag e) Co ntr ol

Cur re nt amp

volta geamp

positi onfee db ack

7

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

37215

AC Servo Drive Control

for asynchronousmachines

fiel d we ak en in g fiel d c on trol ler

sp ee dco ntr oll er

curre ntco ntr oll ers

-

_ -

- M3~

Encoder

n iq

idψ

ϕ

ψ

machinemodel

ir

vr

φjeminus

φjeminus

φjeminus

for sy nc hr on o usmac hi ne s 38215

Modeling of the Servo Motor with Connected Load Mechanical Nonlinear Dynamics

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+ Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θ L

Kv

TL

θ m

Tm

G fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

The load dynamics will couple to the motor as external disturbancesPower converter exists significant nonlinearity and voltage and current limitsControl algorithms and parameters are critical for specific applications

Controller

Power Converter amp Sensors

+Gp

+

minus

+

minusG v

minusGi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmG fi

RKs

v a

ia

ωm

fwG

fpG

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmGf i

RKs

v a

ia

ωm

fwG

fpG

21

2

22

22

mm

nnn

ss

ωωξωωξ

++++

21

2

22

22

mm

nnnss

ωωξωωξ

++++

40215

Digital AC Servo Motor Controller Design Issues

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

41215

Why Use DSP for Motor ControlTo Realize Complex Control amp Interface Algorithm

Rectifier Charger Inverter

T2

T1

110220V5060 Hz

+

_

ACload

EM

I 3-phaseload

C1

C2

M otorGenerator Flywheel

Battery

uεud

bull Power Factor Control

bull Regenerative Braking Control

bull DC-Link Voltage Regu lation

bull DC-Link Cap M inimization

bull PWM Contro lbull Vector Controlbull Current Controlbull Voltage Controlbull Power F low Controlbull Auto-Tuning

42215

Fully Digital Control Scheme for PMAC Drives

+

minusbase

drive

ADC

ADC

32

ϕϕ

_

_

ias

ibs

ics

23

ϕϕ

vcs

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

dd t

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )PM AC

servomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Feedback Signal

Processing

Servo Control FieldTorqueamp

CurrentVector

amp PW M

Control

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 6: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

6

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

31215

Architecture of Motor Drive

Controller

PowerAmp Motor Load

Man-Machine InterfaceSignal Processing amp PWM Control Vector Control Control Loop Control

PowerSource

Spee d

Torqu e

32215

伺服馬達驅動系統的控制架構

Power source (converter)

Semiconductor driver

Servomotor

Position speed sensor

Mechanical driver

Power control

GTO transistor MOSFET

Signal generator

IC OP amplifier semiconductor sensor

Control

Microprocessor DSP

GATE signal

Control

Controller

voltagecurrent

Gear backlash

Friction Compliance

Sensor

Microelectronics Power electronics Materials

Linearized decoupled p ower amplifier by minor curren t and speed lo ops

Level 1

Level 2

Level 3

33215

直流伺服馬達驅動器的系統方塊圖

Refere nce speed

Speed amplifie r

Curre nt amplifie r

PWM circuit

Rectifier bridg e

Tra nsisto r bridg e

DC Moto r

Tria ngula r wav e gene ratio n circ uit

Speed f eed back

Compa rat or

Curre nt f eedb ack

Filter Tach oge ner ator

Driver

Driver

Driver

Driver

DCM

TG

+minus

+minus

34215

+minus

交流伺服馬達驅動器的系統方塊圖

Reference speed

Speed amplifier

DC-SIN conversion Rectifier

bridge

Transistor bridge

Three-ph ase synchronous

motorSpeed feedback

Comparator

Speed detection

circuitRotary encoder

Driver

Driver

Driver

Driver

SM

RE

++minus

Driver

Driver

Comparator

Comparator

Triangular wave generation circuit

Sine wave generation

circuit

Rotor position detector

+

minus

minusminusminus

minus

Current amplifier

Current feedback

U

V

W

35215

Typical Motion Control System Block Diagram

Posi ti o nCo ntr oll er

Velo ci tyCo ntr oll er

Velo ci ty Fe e db ac k

Posi ti o n Fe ed b ac k

++- -

Ma ch in e Ta bl eCurre nt

Co ntr oll er

+

-Pow er

Amplifier

Curre nt Fe ed b ac k

Mo t or

Mo ti o nPlan ni n g

Comma n dInt erpr et er

Ma ch in eOp erat io n

CADCAM

Operation Command

MotionCommand

PositionCommand

Veloc ityCommand

36215

Hierarchical Control Architecture for AC Drive

ServoController

ACDCConverter

DCACConverter

VectorController

FieldController

FluxEstimator

AC MotorShaft

sensor

CurrentController

Cur re nt C on trolTo rq ue Co ntr ol

Back em f C on trol

Positio n amp V elo city C on tr ol

PWMController

Position amp Velocityestimator

PWM (Volt ag e) Co ntr ol

Cur re nt amp

volta geamp

positi onfee db ack

7

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

37215

AC Servo Drive Control

for asynchronousmachines

fiel d we ak en in g fiel d c on trol ler

sp ee dco ntr oll er

curre ntco ntr oll ers

-

_ -

- M3~

Encoder

n iq

idψ

ϕ

ψ

machinemodel

ir

vr

φjeminus

φjeminus

φjeminus

for sy nc hr on o usmac hi ne s 38215

Modeling of the Servo Motor with Connected Load Mechanical Nonlinear Dynamics

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+ Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θ L

Kv

TL

θ m

Tm

G fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

The load dynamics will couple to the motor as external disturbancesPower converter exists significant nonlinearity and voltage and current limitsControl algorithms and parameters are critical for specific applications

Controller

Power Converter amp Sensors

+Gp

+

minus

+

minusG v

minusGi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmG fi

RKs

v a

ia

ωm

fwG

fpG

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmGf i

RKs

v a

ia

ωm

fwG

fpG

21

2

22

22

mm

nnn

ss

ωωξωωξ

++++

21

2

22

22

mm

nnnss

ωωξωωξ

++++

40215

Digital AC Servo Motor Controller Design Issues

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

41215

Why Use DSP for Motor ControlTo Realize Complex Control amp Interface Algorithm

Rectifier Charger Inverter

T2

T1

110220V5060 Hz

+

_

ACload

EM

I 3-phaseload

C1

C2

M otorGenerator Flywheel

Battery

uεud

bull Power Factor Control

bull Regenerative Braking Control

bull DC-Link Voltage Regu lation

bull DC-Link Cap M inimization

bull PWM Contro lbull Vector Controlbull Current Controlbull Voltage Controlbull Power F low Controlbull Auto-Tuning

42215

Fully Digital Control Scheme for PMAC Drives

+

minusbase

drive

ADC

ADC

32

ϕϕ

_

_

ias

ibs

ics

23

ϕϕ

vcs

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

dd t

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )PM AC

servomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Feedback Signal

Processing

Servo Control FieldTorqueamp

CurrentVector

amp PW M

Control

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 7: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

7

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

37215

AC Servo Drive Control

for asynchronousmachines

fiel d we ak en in g fiel d c on trol ler

sp ee dco ntr oll er

curre ntco ntr oll ers

-

_ -

- M3~

Encoder

n iq

idψ

ϕ

ψ

machinemodel

ir

vr

φjeminus

φjeminus

φjeminus

for sy nc hr on o usmac hi ne s 38215

Modeling of the Servo Motor with Connected Load Mechanical Nonlinear Dynamics

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+ Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θ L

Kv

TL

θ m

Tm

G fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

The load dynamics will couple to the motor as external disturbancesPower converter exists significant nonlinearity and voltage and current limitsControl algorithms and parameters are critical for specific applications

Controller

Power Converter amp Sensors

+Gp

+

minus

+

minusG v

minusGi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmG fi

RKs

v a

ia

ωm

fwG

fpG

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt+ minus 1

J s Fm m+1s

+ +minus

1

2sJ FL +1s

θ L

Kv

TL

θ m

TmGf i

RKs

v a

ia

ωm

fwG

fpG

21

2

22

22

mm

nnn

ss

ωωξωωξ

++++

21

2

22

22

mm

nnnss

ωωξωωξ

++++

40215

Digital AC Servo Motor Controller Design Issues

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

41215

Why Use DSP for Motor ControlTo Realize Complex Control amp Interface Algorithm

Rectifier Charger Inverter

T2

T1

110220V5060 Hz

+

_

ACload

EM

I 3-phaseload

C1

C2

M otorGenerator Flywheel

Battery

uεud

bull Power Factor Control

bull Regenerative Braking Control

bull DC-Link Voltage Regu lation

bull DC-Link Cap M inimization

bull PWM Contro lbull Vector Controlbull Current Controlbull Voltage Controlbull Power F low Controlbull Auto-Tuning

42215

Fully Digital Control Scheme for PMAC Drives

+

minusbase

drive

ADC

ADC

32

ϕϕ

_

_

ias

ibs

ics

23

ϕϕ

vcs

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

dd t

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )PM AC

servomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Feedback Signal

Processing

Servo Control FieldTorqueamp

CurrentVector

amp PW M

Control

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 8: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

8

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

43215

Fully Digital Control Scheme for PMAC Drives

+

minusgatedrive

ADC

ADC

32

ϕϕ

_

_

ia s

ib s

ics

23

ϕϕ

vc s

vbs

vas

AMPLIFIER and

SENSORS IF

encoderdecoder

e je

θ

minus

+

ddt

+0e

θ

ωr

θr

θr

θr+

minus

+

minus

ω r

K K zvp vd+ minus minus( )1 1Δθr iff

0 =di

iq

current limit

G s( )

SERVO C ON TRO L CURREN T amp PW M CO NT RO L

PM ACservomotor

current loopcontroller

Current LoopController

coordinatestransformer phases

transformer

position loopcontroller

velocity loopcontroller

++

initial rotorangle detector

2p

θe

β

i

α

i

Fe ed b ac k Si gn al Pr oc es si ng

44215

Sensors and Feedback Signal Processing

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

45215

Interface Requirements for Digital Motor Control

Encoder and Quadrature Decoder CircuitCurrent Sensors and Current Sensing Circuits Voltage Sensing Circuits Multiple Channel Analog-to-Digital ConverterProgrammable PW M Generator

46215

Encoder

Phase lag between A and B is 90 degreeAdvantages

low costhigh accuracy(e g by ge ar ratio)

Disadvantageselastic effectsand back lash

A

B

shaft

rotating codewheel

stationary mask

LowHighHighLow

HighHighLowLow

S1S2S3S4

CH BCH AState I

A

B

1 2 3 4

47215

High Resolution Encoder with SPI Interface

Programmable Absolute Rotary Encoders with Synchronous Seria l Interface

The encoder is programmed on a Win dows PC with HEIDENHAIN software

48215

Mechanism of Optical Encoder and Speed Calculation

Mechanism of optical encoders

Rotary disk

LED slit

Fixed board with slits

+A

minusA

output

comparatorLight-receiving

devices

+A

minusA

Fig 6 Quadrat ure direction sensing and r esolution enhance ment (CW = clockwise CCW = counter-clockwise)

For war d ( CW) Rev erse (C CW)A

B

CW

CCW

CW

CCW

CW

CCW

1X

2X

4X

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 9: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

9

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

49215

HCTL2020 Quadrature DecoderCounter Interface ICs

D0-D7

HCT L- 20XX MP or DSP

1

2

34

5

6

78

9

10

20

19

1817

16

15

1413

12

11

Do

CLK

SEL

MC

CHB

CHA

Vss

OE

DU

RST

VD D

D1

D2

D3

CNTD C DR

CNTC AS

D4

D5

D6

D7

hp Digital filter 4X decode logic 1216 bit binary CTR

1216 bit latch

OCTAL 2 bitMUXbuffer

CLK CK

CH A

CH B

channel A

channel B

CNT

DNUP

RSTSEL

OE

CNTDNUP

CLR

Q0-Q1115

Q0-Q7Q8-Q1115

D0-D1115

CLRINH

B0-B7A0-A7

SEL

OE

CNTDCDR

DU

CNTCAS

Decode output

Cascade output

INHIBITlogic

50215

Functional Block Diagram of an Encoder Decoder

計次脈波判定電路

緣檢知

四倍解碼電路

四倍解碼電路

前處理器

指令脈波

指令脈波型態

接編碼器

CLK1

CLK1

CMDA

s3

CHA

CHB

CMDB

s1 s2GND UP DOWNCLK1 CLK2

DOWN

UP

C

D

A

B

DIR

COUNTCLK

CNT_ENABLE

GND

d11d10d9d8d7d6d5d4d3d2d1d0

RST

Vcc=+5VVcc=+5V

Vcc

12位元

計數器

倍率選擇

S

R

Q

12

GND

51215

What is Speed How to Measure Speed

ADCM TG

R1

R2

UTG

filter

Analog tacho-generator

UTG

bull

bull Ripple filtering

bull AD conversion (8 - 12) bits

Ωsdot= TGTG KU

t

52215

Incremental Position Feedback

encod er pulse

DIR

COUNTCLK

d11d10d9d8d7d6d5d4d3d2d1d0

12-bitcounter

Selection of Sampling Rate for Position FeedbackRing Counter Sign Change DetectionVelocity Calculation Based on Moving Averaging Algorithms Edge Synchronization for High- Precision Speed Control

R D Lorenz and K W Van Patten High-resolution velocity estimation for all-digital ac servo drives IEEE Trans on Ind Appl vol 27 no 4 pp 701-705 JulyAugust 1991

53215

Speed Estimation from Position Information

A Esti mation fro m encod er pulses counting

bull simple to implement

bull reduced accuracy even at high speeds [acc] = log2(Nv)Ωmax)

601)4(linesrot1000

ms1rpm3000

maxmax

encoder

max

timesΩtimestimestimes===

vencoderV

v

hNNN

h

bits 6]accuracy[ ltrArr

tΔΔ=Ω θˆ

vbitsN=Ω

hv = fix (speed measurement sa mpli ng pe riod )

pulses50601

=

hv

Nv

encod er pulse

Ex

54215

Speed Estimation from Position Information

Low speed problems

bull minimum speed range

rots25010)10004(

1 Ex

)4(1

for

3min

encodermin

=timestimes

timestimes=Ω

minus

vhN

bit 1ˆmin =Ω

hv

Nv = 1

encod er pulse

Nv = 0 Nv = 1

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 10: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

10

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

55215

Speed Estimation from Position Information

B Esti mation fro m encod er pulses length

requires a d ivis ion operation

high acc ur acy (h igher at low s peeds)

CLKNK

=ΩNCLK

4 x (e ncod er pulse )

Possible co mmutation scheme- high speeds - pulse counting- low speeds - pulse length

Problems - give average speed- possible instability of control at low speeds

Other solutions - esti mation schemes

Tpulse

CLK

56215

Current Feedback Sensing for AC Drives

SimplestNo reconstructionMost Rel iableExpensive

Cd

110220V5060Hz

dcV

PWM I n vert er

AC Motor

Complex (3 phase combined PWM dependent)Difficu l t to reconstructAmplitude only in formationCheapest

Medium Complex (PWM dependent)Easy to reconstructRequire additional circuit (SH)Less fl exib le (d iscret e IGBT only)

57215

Current Sensing for Fault Detection

Causebull Miswiringbull Motor phase insu lation

breakdownDetectionbull Low side shunt resistorbull IGBT desaturationbull Motor phase current

sense

Causebull Motor phase insu lation

breakdownDetectionbull IGBT desaturationbull Motor phase current

sense

Line to line short

Ground fault

mot or

mot or

58215

Motor Current Sensing Techniques

inpu tvolta ge

mot or

IdcDSP

Inv ert erIa

Ib

Ic

Ia Ib Ic

Udc

~Udcout

Idcout

shunt

59215

Single Current Sensing Scheme of PMSM Drives

ωrref iqr

idr = 0

ωr

vqr

vdr

vαr

vβr

iq

id

idc

θ

DAinterface

SVPWM

PMSM

dq

αβ

dqαβ

αβdq

60215

Current Sensing Circuits

R1 = 10 KΩR2 = 100 KΩGain = 10 Vref = 2 V C1 = 120 pFC2 = 120 pF

The Resis tive Divider also forms a Low Pass Filter (LPF) to take out the diode reverse recovery current spike in the current sense signal Since this is usually in the MHz frequency range a single pole LPF is sufficient set at a couple of hundred kHz As the Operational Amplif ier circuit already has a LPF this is more important for the following comparator circuit

The Cutoff Frequency is calculated as follows

)used 0200(01250A8102

210max_2

Ω=timestimes

timesΩ=timestimes

= VkIGain

VR ref

sense

kHz256pF12052

12212

1 =timesΩtimes

=timestimes

=kCRR

fc ππ

A B C

+

minus

GNDRsense

R1

R1

R1

+VBUS

Vref

R1 C2

Vref

R2

C1

Amp To ADCANA3

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 11: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

11

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

61215

Isolated Current Sensor Using Opto Coupler

D1

180Ω1μF

820Ω1

820Ω1

A BD2

50 W

1K

+12V

2N2369

Q3

Z56V

ISOLATED STAGE

620Ω1

620Ω1

100K

100KQ1

Q2

C

100K

A1

741-

+A2

741-

+

10K

100K

1KD

+12V

D1 D2 LEDsQ1 Q2 PHOTO TRANSISTORS

680Ω

10Ω

1000PF

OUTPUT

OPTO ISOLATORS

FILTER AND GAIN ADJUST

62215

Isolated Current Sensing ICs HCPL-788J

HCPL-788J

Output Voltage Directly Compatib le with AD Converters (0 V to VRE F )Fast (3μs) Short Circuit De tec tion25kVμs Isolation Transient ImmunityTypical 30 kHz Bandwidth 25degC

Features

63215

Applications of HCPL-788J for Motor Current Sensing

Bypass capacitor for noise filtering64215

HCPL-788J for Three-Phase Motor Current Sensing

65215

High Voltage Current Sensing ICs

Featu resFloating channel up to +600VMonolithic integrationLinear current feedback through shunt resistorDirect digital PWM output for easy interfaceLow IQBS allows the boot strap power supplyIndependent fast overcurrent trip s ignalHigh common mode noise immunityInput overvoltage protection for IGBT short c ircuit conditionOpen Drain outputs

To M otor Phase

15VPWM Output

GNDOvercurrent

8 Lead SOICIR2175S

IR21 75

Timi ng wa vef or ms

PO

PO

Vin+ = minus260mVVs = 0V

Vin+ = +260mVVs = 0V

Duty = 91

Carrier frequency = 130kHz

Duty = 9

up to 600V

VCCPO

COMVSVB

V+

IR2175OC

66215

High Voltage Current Sensing ICs

High side gate driver- AD- Level shift down- It r i p protection

Low side gate driverIf dbk signal processingIt r i p fault processing

Rshunt

Motor phaseIfdbk levelshifter

Itrip downshifter

Ifdbk analog output

Fault

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 12: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

12

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

67215

International Rectifier IR2137 HV Driver IC3-PHASE BRIDGE DRIVER 33V compatible 6 PWM inverter IGBT dr iver + 1 for DB IGBT Dr ive

Featu resFloating channe l up to +600V or +1200Vldquosoftrdquo over-current shutdown turns off all six outputsIntegrated high side desaturationcircuitControlled ldquosoftrdquo turn on for EMI reductionIntegrated brake IGBT driverThree independent low side COM pinsSeparate pull-up pul l-down output drive pinsMatched delay outputs33V lo gic co mpatibleUnder voltage lockout with hysteresis band

68215

Prototype Hardware Design Concept

69215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

70215

3-Phase Space-Vector PWM Control

3-p ha seload

3-Ph as eMot or

3-PhasePowerSupply

SVPWM Ge ne rat or

71215

Space Vector PWM amp PI Loop

Debounce+SetpointController

sw

Speed( fr equency)Set point

X

+5v

I nc Fr eq

Dec Fr eq

Vejb V d Vq

b

V 4( 1 00)

V 6( 1 10)V 2( 0 10)

V 3( 0 11)

V 1( 0 01) V 5( 1 01)

int

sumsum

Ta T

b T

c

mVdmVq

3 phasePowerInverter

Va Vb Vc

Tmin=

sum1

251x

Volt s Hz Pr ofileM

ww 1 w2w

m a x

Mm in

Mm a x

M = F n ( w)

PWM1

PWM2

PWM3

Tm

Tf bω

f b

ωf b

ωsp +

_

+

+

M odulat i on I ndex cont r ol

V gener at io n amp decom po sit io n

3 phase A Cinduct i on m ot or

Box- car Aver ager

Hall effect speed sensor

Pr opor t ion al

I nt egr al

ω ωe

m

Vd V

q

PWM4

PWM5

PWM6

72215

Digital Space Vector PWM Implementation

A B C

A B C

Va Vb Vc

Switching Patterns - Vn (ABC)

Motor

n = 0 --gt 7

dy= Msin(a)

dx= Msin(60-a)

dz= 1 -d

x- d

y

V0 = (000)V7 = (111)

Zero Vectors

V4 ( 100)

V6 ( 110)V2 ( 010)

V3 ( 011)

V1 ( 001) V5 ( 101)

S1S3

S4

S5

S6

dyVy

dxVxa

b

M V m ax eja

Sect or

Vy Vx

60o

0000

FFFF0000

FFFF

w

- 1

minus 3 2

q

d

151413 1211 109 8 7 6 5 4 3 2 1 0I nt egr at or

8 bit sineTabl e looku p

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 13: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

13

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

73215

PWM Waveform Generation

Ta = ( T - dx - dy) 2

Tb = dx+ Ta

Tc = T - Ta

dx

dy

Phase Scrambler(A Function

of Sector 1--gt6)

Sector

Tc Tb Tc Ta Ta Tb

Tb Tc Ta

Phase APhase BPhase C

TaTb

Tc

Swap dxamp d

y

Timer Compare 1

Timer Compare 2

Timer Compare 3

A

B

C

Timer Module

Ta

Tb

Tc

T

d0 dx dy d7 d0 dx

Note d0= d7= dz

74215

Modulation Schemes for PWM Inverters

PWM ObjectiveMa xim um B us v olt a ge Uti liza ti o nMi nim um H armo nic s

Le ss Au di bl e A co u sti c N oi seLe ss M ot or Tem per at ure Ris e

PWM SchemesPlai n s in u soi d al PW MTh ird h armo nic s i nj ec te d PW MProgramm e d PW M

Spa ce V ec t or M o du la ti on

SVPWMTo ta l 8 Swi tc hi n g St at e2 Z ero Ve ct ors

6 Ac ti ve V ec tor s

75215

Vector Control for Torque Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

76215

Pioneer Paper on FOC Control of Induction Machines

F Bla sch ke Th e p rinci ple of fi eld ori ent ati on as a ppli ed to t he new TRA NSVEC TOR clos ed l oo p c ont ro l syste m fo r r ota tin g fi eld m achi nes Si e me ns R ev vol 3 4 pp 2 17 -2 20 1 972

AbstractmdashWhen rotating-field machines are employed as drive motors the question on of torque generation and control requires special consideration It is for instance possible touse the vector of the stator voltage or the vector of the s tatorcurrent as the manipulated variable for the torque depending on whether the static converter supplying the motor provides a variable voltage or a variable current This paper for describesthe principle of field orientation a new closed-loop control method for rotating-field machines [1-4] by way of reference to an induction motor It is shown how these manipulated variables must be influenced to provide instantaneous and well-damped adjustment of the torque independently of the inherent characteris tics of an induction motor

77215

Pioneer Paper on FOC Control of Synchronous Machines

K H Bay er H W ald m ann an d M Wei belz ahl Fi eld -O rie nte d Clos ed -L oo p C on tr ol o f a Sy nc hr ono us Mac hin e wi th the Ne w Tr ansv ect or Co nt rol Sy ste m Si em en s R ev vol 3 9 pp 22 0- 22 3 19 72

AbstractmdashSynchronous machines are being employed on an ever increasing scale in industrial drive systems fed by static converters The reasons for this lie in their straightforward robust construction the simple manner in which they can be magnetized [1] and their excellent character istics when used in conjunction with static converters [2] Since these drives are expected to offer the same high-grade dynamic characteristics as variable-speed dc drives provision must be made to control the torque instantaneously to a linear curve relationship The same applies to control of the magnetization Both control operationsmust be decoupled ie one must only influence the torque and active power and the other only the magnetization and reactive power TRANSVECTORreg control which operates on the principle of field orientation is eminently suitable for control functions of this type

78215

Principle of Field-Oriented Vector Control

N

S

N

S

λR

λ S

d-axis

q-axis

ω e

Τe

Vf

β

α

i sα

ris

is 1

ds

q s

1

2

Ψr

Ψr1

i s 2

Ψ r2

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 14: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

14

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

79215

Vector Control of Synchronous Machines

represent command valuesτ is required torque

PI+minus

τ

PI+minus

λ

Inve rs epar k

tra nsf or m

Parktra nsf or m

Inve rs eClark e

tra nsf or m

PWMinve rte r

Integ rato r

M

E

Clark etra nsf or m

rsiq

rsid

siq

sid

iuiviw

rθ rω

rsid

rsiq

sidsiq

iuiv

iw

2P mω

80215

Field-Oriented Torque Controller

i sβ

i sα

iqs

i ds

ωsl ωe+

ωr

stati on ary to syn ch ro no uscoo rdi nat e t ra nsf or me r

Ls

m

r1 + τ

λr

L m

r rτ λ

θe

eje θ

(x y)

xrsquo

yrsquo

eθx

y

81215

Current Controller

compensator

vas

vbs

vcs

v sβ

v sα

i sβ

i sα

i sβ

i sα

i as

i cs

ibs _

_

_

_

23

φφ

23

φφ

2-3 coordinatetransforme r

2-Axis Current Control in Stationary Coordinate

da(k)

db(k)

dc(k)

duty ratioconverter

darsquo(k)

dbrsquo(k)

dcrsquo(k)

82215

Torque Response Time

Test Con ditio ns 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

Test Con diti ons 8 pole moto r Kt =11 1oz -inA R= 76 L=1 25 mH to rque com mand =+ -1 8A 20 oz- in loa d

A conventional analog sinewave ac drive ha s d iffi cu lty in producing torque as quickly as nec ess ary for optimal performance especiall y when running at speed due to the back emf and lagged current response A soft ware-contro lled servo drives torque response is extreme ly fa st and virtuall y constant regardless of motor speed The desired instantaneous torque can be delivered immediately upon demand httpwwwworldservocom

83215

Current Control is not Torque Control N

S

N

S

λR

λS

d-axis

q-axis ω e

Τe

β

α

sir

i de

ds

q s

qe

d e

Ψr

iqe

ids

http w www orl dse rv oc om

Torque produced by the SSt drive(max power = 1026W 2800 RPM)

Torque produced by a competing s ine wave drive(max power = 780W 2720 RPM)

0 1000 2000 3000 4000

600

400

200

Speed (RPM)

Torq

ue (

oz-in

)

Lost to rq ue a nd p ower du e to c ur rent loop d elay in a sin e wave driv e A portio n of this los s go es int o he ating the m oto r windi ngs r edu cing t he continu ous outp ut ca pacity

84215

Field-Weakening ControlConstant torque

regionConstant power

regionEquivalent dc series

motor operation

Frequencyωω

e

b(pu)

Tem

b

max imu m to rq ue

b ase sp eedω

Tem

= co n stan t Te mω = co n stan t Tem e

ω 2 = co n stan t

Torque10

TT

e

em(pu)

10 25Sm

10

10 25Sm Frequency

ωω

e

b(pu)

Tor que

stator cur ren t

stator volta ge

slip

(a)

(b)

λ r k( )

T ke( )

i kds ( )

i kqs( )2 1

1P kr( ) ( )minus σ λ

1Lm

Fiel d W eak eni ngCont roll er

velocity-loopcontroller

ωr k ( )

$ ( )ω m k

spe ed fe ed back

Fiel d W eak eni ng P ro file

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 15: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

15

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

85215

Equivalent Block Diagram of the PM AC Motor Under FOC Decoupling Control

Te

Td

ω m1sL Ra a+ K T

+minus

1sJ Bm m+

K E

Ti

va

minus

+

v g

Ti

minus+

Current Controller

RmET KKK Ψ==

Fi RΨ

FK1

K PWM

Assumption The motor is u nder a well-deco upled current reg ulatio n contro l

86215

Equivalent Block Diagram the PM AC Motor Under Constant Field Control

When the P MS M motor is under constant field o peration the back-emf beco mes proportiona l to the rotating speed a nd the P MS M motor is behaved as a permanent-mag net DC motor

Te

Td

K T

+minus

K E

ia

ω m1sJ Bm m+

v a

minus

+

v g

K P

minus+G sv ( )

ω m

minus

+ is

1sL Rs s+

Brushless PM AC Motors

87215

Torque-Speed (Frequency) Curves of PM AC Motor Under FOC Decoupling Control

A

B

0

1

1

Fre que ncy pu b

eωω

Torq

ue

pu em

eTT

Vs

Is

Te

Iin = If

Constant-torqueregion

Constant-powerregion

88215

Mechanical Dynamics and Servo Loop Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

89215

Servo Control of Vector-Controlled AC Drive

s1)(sGP

mθ mθ

T e

Td

KT+minus

K E

i a

ω m1sJ Bm m+

va

minus

+

v g

)(sGC

minus+

G sv( )ω m

minus

+qi 1

sL Rs s+

Brushless PM AC Motors under Current-Regulated Vector Control

)(sHv

minus

+

)(sFp

Servo Loop Controller

The servo loop controller generate the desired torque The current-regulated vector controller generate three-phase PWM signalsThe servo motor is connected to a mechanical load and may be disturbed by external load torque disturbances and mechanical resonant torque disturbances

+

90215

Mechanical Resonance in Motion Control Systems

Placement of anti-resonant fi lters

Positionvelocitycontroller

Low-passand notch

filters

Currentcontroller andcommutation

M otorload(see first diagram

Right side)

Anti-reso nancefilters

Source control engineering w ith information from Kollmorgen

low-f re qu en cy r es on anc e high -f re qu ency r eso na nc e

Soft coupling store mechanical energy

Motor and load coupling models

Motor and loadRigidly coupled model Compliantly coupled model

So u rce co n tro l en g in eerin g with in fo rmatio n fro m k o llmo rg en

mo to r lo ad

Te Te

JM JMJL JL

PM = PLVM = VL

PM ne PLVM ne VL

Ks

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 16: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

16

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

91215

Stiffening the Coupling Decrease The Resonance

Effect of Stiffen Coupling

92215

Active Vibration Monitor for High Speed Machine Tools

Active v ibration monitoring (AVM) is a new approach to sensor technology for machine tool applications Ultrasonic technology allows noncontactv ibration testing monitoring and contro l The AVM can monitor v ibrations on the cutt ing tool spindle or work piece and can be easily reconfigured to change the specific position being monitored The AVM uses a f luid je t from a compact nozzle (Fig 1) to deliver the ul trasonic wave to the point of interest Upon contact with the tool the ultrasonic wave is modulated by tool v ibration and reflected back to a sensor inside the nozzle Proprietary demodulation techniques are then used to y ield a spectrum of v ibration (Fig 2)

93215

Mechanical Resonance

+Gp

+

minus

+

minusG v

minus

Gi KPWM

+

minus

1sL R+

Kt

+ minus 1J s Fm m+

1s

+ + minus1

2sJ FL +1s

θL

Kv

TL

θm

TmG fi

R Ks

v a

ia

ωm

Servo Motor Dynamics Load Dynamics

fwG

fpG

Controller

Coupling Dynamics

94215

Torque amp Servo Control of AC Drives

POSIT ION AND VEL OCI TY LO OP CON TRO L LER

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

TOR QUE

LO OP

CON TRO L LER

22

11

22

11

11

minusminus

minusminus

++

++

zazazbzb+

minus

G zv ( )

speedestimator

)( kmθ )( kTe

The torque loop controller determines the fastest torque response for per unit of controlled motor phase current The servo loop controller determines the robust position response under mechanical resonance and load disturbances

HCTL 2020Quadrature Decoder IC

95215

Digital Velocity Servo Control Algorithm

zdzdznzn

22

11

22

11

11

minusminus

minusminus

++

++

Notch Filter

PKα

+

minus

+

minus

PK)1( αminus

+Velocitycommand

Torquecommand

positionfeedback

)1024(

)1024(

4 Bz

AzK

+

minusIK

1minusz

ACC

Lead Compensator

α-IP Compensator

α -IP Controller ndash Velo city Regulation Lead Co mpen sator ndash Ph ase Co mpen sation Notch Filter ndash Mechani cal Reson ance Reduction

θTSpee dEstim ato r

96215

PDFF amp Friction Compensation Control Scheme

PI

VelocityFeedfo rwa rd

Accelerati onFeedfo rwa rd

Comman dInterprete r

RampingContro l

Quadrat ureDecoder

Positio nCounter

Encode rFeedback

_

+

VelocityFeedback

_

+

DAC Out put

To Servo Drives

Velocity or Torque command

Frict ionCompensato r

+N

S

S

N

+

MotionInterpolat ion

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 17: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

17

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

97215

Servo Controller Position and Velocity Loop Control

Kp

K TZ

I ss

11minus minus

ω r

K v

θ r

Tss

T ke( )u k( )

anti-windup control

cmd limit

K K zvp vd+ minus minus( )1 1

+

θr k( ) θr t( )

$ ( )ωm k

speedestimator

Δθr k( ) + + + ++

98215

PID Position Loop with Feed-Forward Control

Control System Design Guide George Ellis Academic P ress 3rd Ed February 17 2004 Chapter 16 Posit ion Loops

S2

S

APC

VPC

KPI

KPP

KPDs

Curren tloops and

commu tatio n

PEPC IC IF AF PF

IKPI-SAT

PF

VE

+ ++ + +

+minus

KFA

KFV

s1

+

JKT

21s

99215

Feed-Forward Control Scheme

KFFv

KFFa

KFFj

S

S

S

Kp G(s)Pcmd +

_Saturation

+ Pfeedback

s

1Vcmdrsquo

Vcmdrsquo = Kp Perr + KFFv SPcmd + KFFv S2Pcmd + KFFj S3Pcmd

+

100215

Analysis of the Feed-Forward Controller

fdfp KTzK

11 minusminus+

K p p

θ

vcffω

+ ω+minus

Encoder FeedbackCounter

FOVAC Drive Torque

Controller

+

eT

θ

mT

+1

Js

1

s

θωdT

Position Loo p Controll er

minus

T

M otionController

AB

VelocityLoop

Controller

T

In a practical servo system for machine tools a feedforward controller is usually employed to improve transient response of specific motion commands

101215

Steady-State Error for Step Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=

+

++minus=

minus=Δ

ssGK

ssGsKK

su

ssGK

ssGsKK

ssGK

susu

sysusx

Ap

Afdfp

Ap

AfdfpAp

1)(1

1)()(1

)(

1)(1

1)()(

1)(

)()(

)()()(

p

fp

Ap

Afdfp

ssss K

KU

ssGK

ssGsKK

sU

ssxstxminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr 1)(1

1)()(1

lim)(lim)(00

If the input is a step of U

there there will have a steady-state error therefore the Kfp should be set as zero

102215

Steady-State Error for Ramp Input

fdfp KTzK

11 minusminus+

pKθ

vcffω

+ ω+minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

Command

T

0A

0A)( ωω+= ssG A

Δ x

p

fdfp

Ap

Afdfp

ssss K

Ks

KU

ssGK

ssGsKK

sU

ssxstxminusminus

=⎟⎟⎟⎟

⎜⎜⎜⎜

+

+minus=Δ=Δ

rarrrarr

11

1)(1

1)()(1

lim)(lim)( 200

If the input is a ramp with a feedrate of U

then when Kfp=0 and Kfd=1 there will be no steady-state errorFrom the above analysis we can see there is no effect of Kfp for an inherent type-1 servo system

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 18: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

18

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

103215

Feed-Forward with Ramp and Parabolic Input

fdKTz 11 minusminus

pKθ

vcffω

+ ω+

minus

+

θ

1

s

θω

Position Loo p Controll er

T

RampPosition

CommandT

0A

0A)( ωω+= ssG A

Δ x

faKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

+

+

Based on the same principle we can also employ a double differentiator in the feedforward loop to eliminate steady-state error due to a parabolic input

104215

Advanced PIV Control Scheme

http w www orl dse rv oc om

Σ

int

Kp KvΣ Σ

Ki

Kfv

ddt Kfa

RAS

Ada p tiv e

iner tia ma tc hi ng

tec h n ol og y ( IM T )

Kvn

Knp

Measured to rque

digital command(steps in)

torquefilter torque

command

Measured position

imbeddedvelocity loop

veloci tyesti mat or

main gains

feed-forward gains

adaptive gains

minus minus

VP

integrator

105215

Regressive Auto Spline (RAS) for Digital Motion Cmd

250

200

150

100

50

-5 0 5 10 15 20 25 30 35 40 45 50 55 60Time (milliseconds)

input command After RAS processing

Ve

loc

ity (

Kilo

-co

unts

se

c)

106215

Digital Controller for Position Servo System

Torquecommand

PPKθ + ω +

minusminus

+

eT

θ θ

Posi ti o n C on tro ller

T

Mo ti o nCo ntr oll er

PIK

Feed-Forward Compensator

PVKTz 11 minus

minus

vcffω

PAKTz 211

⎟⎟⎠

⎞⎜⎜⎝

⎛ minus minus

++

ωˆ

PKα

+

minus

PK)1( αminus

+

IK

1minusz

ACC zdzdznzn

22

11

22

11

11

minusminus

minusminus

++++

Notch Filter

)1024(

)1024(

4 Bz

AzK

+

minus

Lead Compensator

positionfeedback

Weighted IP Controller

1 1minus minuszT

107215

Vector Closed-Loop Torque Control

out put vol ta ge ar e a dju ste d simul ta ne ousl y to loc k ma gn etic fiel d to r oto r

ma gn etic fiel d a ngl e rela tive to r oto r

ma gn etic fiel d a mpli tu de rela tive to r oto r

tor qu e com m an d rot or an gle

refere n ce fram eco nv ert er

(d e-r ot ati o n)

refere n ce fram eco nv ert er

(re-r ot ati o n)

sensor

Σ

Σ

int

Kip

Σ

Kip

Kip

intKip

Σ

Σ

rot or

stat or

φ90

I

108215

Hierarchical Software Servo Control Structure

PWMAmplifier

Motor LoadCurrent

LoopController

+

_

VelocityLoop

Controller+_

PositionLoop

Controller+_

CurrentVoltageFeedbackPosition Feedback

TorqueLoop

Controller

Torqueestimator

+_

M otion FunctionGenerator

N1 N2

VelocityFeedback

θ

1 1minus minuszT

Servo

Inter

face U

nit

Servo M ax

Easy T u neS erv oT u ner

Aut o T un er

Win M oti o n

Aut o M ot or

WinDSPDSP Pro grammi n g L ev el De vel o pme nt So ft ware

PLC M oti o n C o ntr oll er

Servo C on tro llerMo ti o n C on tro ller Tor q ue Co ntr oll er BIOS

Servo M as terServo M o tor Co ntr ol S ys tem L ev el D ev el opm e nt S o ftw are

Application Level Userrsquos Software

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 19: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

19

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

109215

Realization Issues for Digital Servo Motor Controller

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

110215

Basic Functions for Motor Control Solutions

Servo Controller

Tmax

PLC+

minusTorquecmdlimiter

)( zGp

)(kmθ)(ˆ kmω

FIELDORIENTEDVECTOR

CONTR OL

22

11

22

11

11

minusminus

minusminus

++++

zazazbzb+

minus

G zv( )

speedestimator

)( kmθ )( kTe

HCTL 2020Quadrature Decoder IC

High-SideGate Drive IC

PWMCONTR OL

12-bit ADC

IGBT M odule

Computing of Control and Signal Processing

Algorithms

Feedback Signal Sensing and Conditioning

All These Functions Can Be Semiconductorized

Integration means Siliconlization

111215

Integrated Power Conversion Components

ActiveGate dr ive AGD AGD

ActiveGate dr ive AGD AGD

112215

Integration of Power and Control Electronics

DSPDSP Inside an IGBT Module

113215

Device Impact on Motor Drives (CPES)

114215

Device Impact on Distributed Power Systems (CPES)

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 20: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

20

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

115215

Mac Integrated Servo Motors

The MAC Integrated Servo Moto r - the complete motion solution a brushless servo motor with integrated controller giving all necessary components in one servo motor unit

httpwwwjvluk com116215

Modern Control System Components

Plant Physical system actuation sensingController Microprocessor plus conversion hardware (single chip)Feedback Interconnection between plant output controller input

Actua to rs Sens orsSyste m

noise external disturbances noise

out put

Inte rf aceamp

Com pu teamp

Cont rol ADDA

Plant

Controller

Operator input

SOPCFPGA

SpecificMotor

Control IC

CAPPWM Specific8-Bit mP

MotorController

117215

Block Diagram of a Typical Digital AC Motor Controller

PFCCircuitry Three-phase inverter Motor

Power stage

+

minus

On-boardPS

gate

VCCFault

Protection

PDPINT

VoltageCurrentConditioning

Circuits

ADC module

Driver Circuits

PWM Generator

SpeedPositionSensor IF

CaptureQEP

SCISPICAN

Comm IFSerial

Peripherals Digital IOs

Control Logic

Digital Motor Controller

Other Logic or I F

118215

DSP Solution for Motor Control

Selection of DSP Cont roller fo r Digital Motor Control Can eli minate g ears amp belts th rough variable sp eed direct d riveSupports use of inexp ensive AC induction motorCan greatl y impro ve low-sp eed effici ency

TM S320C2407ADSP

Controller

InputFilter Rectifier

AuxiliarySupply

Inp utVolta ge

Inverter

Mot or

communi ca tio n

Application

Enc o der

119215

Development of Integrated Motor Drive Module

bull 600V and 1200V Gate Driverbull Switching Power Supply Controllerbull SPI Communication and Isolator

bull 600V and 1200V Current Sensorbull Soft Start Converter Controllerbull CPUDSP IO PWM ADC

Discrete Inpu t

Discrete Outpu t

Analog I npu t

RS232C

Ma n Mac hin e Inte rf ace

I R1110 Sof t St ar t

I C

Discrete IOrsquos

Analog IOrsquos

Serial Comm

AC Drive M otion Profile Processing

M icro controller or

DSP

High Speed Serial Communication

O PTO s

uP DS P PWM

AD D A DI O

IR2137 IR2237 Gate Drive and Protection

I R2171 I R2271

CU RR ENT FDB KI C

5V15V

Power Supply

Power Conversion Processor

AC M OTOR

45V15V

120215

IR Programmable Integrated Motor Drive Module

PIIPM 50 12B 00 4 E c on oP ack 2 o ut li ne com p ati bl e

FEATURESDSP ( TMS 32 0 LF 24 06A ) Em be d de d

NPT I GB Ts 5 0A 12 00V

10 us S h ort Circ uit c ap a bili ty

Squ are RBSO A

Lo w V ce (o n) (215Vtyp 50A 25 degC)

Posi ti ve V ce (o n) t emp erat ure co ef fic ie nt

Ge n II I H ex Fre d Te ch n ol og y

Lo w di o de V F ( 178Vtyp 50A 25 degC)

Sof t re vers e re co ver y

2mΩ se ns in g r esi st ors o n all p ha se ou t pu ts a nd DC b us m in us rail

TC lt 50 p pmdeg C

Embe d de d fl yb ac k smp s f or flo at in g st a ge s ( si ng le 15V d c 300m A i n pu t re q uire d)

TM S320LF2406A

40M IPS

DC Link Input

Power Module

Current sensecircuit

IR 2213 based gate driver

EncoderHall interface

JTAG interface

PI-IPM50P12B004

RS

422

in

terfa

ce

ACDC motor

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 21: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

21

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

121215

Evolution of DSP Motor Controllers

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

122215

What is DSP

Digital Signal Processing ndash the processing or manipulation of signals using digital techniques

Digital Signal

Processor

In pu t Sig nal

Ou tp u t Sig nal

DACADC

)(ty)(ty)(nTy)(~ tx )(nTx)(tx

TM S320C6xxx

TEXASINSTRUM ENTS

123215

FIR Filtering A Motivating Problem

Two data fetchesMultiplyAccumulateMemory write-back to update delay line

Each tap (M+1 taps total) nominally requires

D D

x[ ]0h

x[ ]1h

+

[ ]nx [ ]1minusnxD

x[ ]1minusMh

x

+

( )[ ]1minusminus Mnx [ ]1minusnx

+

[ ]Mh

[ ]nh

bull bull bull

bull bull bull

a ldquotaprdquo

124215

DSP for FIR Filter Calculation

summinus

=

minus=1

0

][ ][ ][N

m

mkxmaky

Multiply and Addition In FIR filtering each sample in the output signal y[n] is found by multip lying samp les fro m the input signal x[n] x[n-1] x[n-2] by the fi lter kernel coefficients a[0] a[1] a[2] a[3] and su mming the products

Real-Time Processing In addit ion to perform mathematical calcu lations very rapidly DSPs must also have a predictable execution time

Continuously Processing In co mparison most DSPs are used in app lications where the processing is continu ous not having a defined start or end For instance consider an engineer designin g a DSP system for an audio signa l such as a hearin g aid

+

Input Signal x[ ][ ]3minusnx

[ ]2minusnx

[ ]1minusnx

[ ]nxhellip

Output Signal y[ ]

[ ]ny

a7 a5 a3 a1

a6 a4 a2 a0

125215

Digital Signal Processor A SISC Computer

AD DA

xi(t) xi[n] y i[n] y i(t)

Special Instruction Set Single Chip (SISC)

sum sdot 21 OpOp

sum minus 21 OpOp

( )2

21sum minus OpOp

4321 OpOpOpOp sdotminus

ΘplusmnΘplusmn sincos 21 OpOp

126215

Basic DSP Architecture

AD

xi(t) xi[n]

DA

y i[n] y i(t)

InstructionCache

Progr amMem ory

Data Memory

Special Instruction Set Single Chip (SISC)

DSP Processor Core

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 22: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

22

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

127215

Pipeline Operation of Instruction Cycles

Note Most instructions but NOT all can be executed within one clock cycleExternal readwrite of external devices need to insert wait-states this also adds extra cycles to the execution timeTo allow these longer steps without losing pipeline consistency wait cycles where the CPU does nothing are inserted in the pipeline

128215

DSP Controller

A DSP Core Based Single-Chip ControllerTarget on Specific Applications such as Motor or Power Control High efficiency interrupt controller (event manager) is a must High-Speed SPI is essential Control Interface is important Especially for on-chip multi-channel ADC converter Programmable timercapture for multi-phase multi-mode PW M generation and synchronizationHigh noise immunity capabilit y for industrial applications

129215

TMS320C14 ndash The First DSP Controller

160-ns instruction cycle100 object code co mpatible with TMS320C154 16-bit timers

-2 general-pur pose timers-1 watchdog timer-1 baud-rate generator

16 individual bit-selectable IO pinsSerial p ort - UARTEvent manager with 6-channel PW M DN capabilityCMOS technology68-pin PLCC and CLCC packages

Me mory

Da ta RAM2 56 X 16 Bi ts

Progra m ROMEPROM4K X 1 6 Bits

Wa tch do g

Seri al Po rt

Bi tIO

WDT

TXDRXD

IO P0IOP1 5

CAP0CAP1CMP5CAP3CMP4CAP2

CMP0CMP1CMP2CMP3

TCKL 1

TCKL 2

T im er 1Cou nte r 1T ime r 2Cou nter 1

Eve ntMa na ge r

Ca ptu reCo mp arePW M

Ba ud -Rate Ge ne rato r

Periphe ralsCPU

1 6-Bi tsBa rrel Sh if ter

3 2-Bi t AL U

3 2-Bi t ACC

16 -Bit T-Re g

1 6iexclNtilde16 -BitMu lt i pl i er

0- 1- 4-Bit Shi f te r 3 2-Bit T -Re g

2 Aux il ia ry Reg is ters

4-Le ve l HW Stac k

Status Re gi ster

Featu res

130215

TMS320C240 ndash A Revised Version

Program R OM Flash

Data RAM544w x 16 16Kw x 16

D (15-0)

A (15-0)

PA (64K-0 )(A 15- 0 D 1 5-0 )

16-bit T-register16 x 16 Mul tiply32-bit P-regis ter

16-bit Barrel

Shifter (L)

32-bit ALU32-bit Acc umulator

ShiftL (0 -7)

8 Auxiliary Regs8 Level HW Stack2 Status Regis ters

C25LP CORE

ShiftL (0 14-6 )

Repeat Cou nt

IO PortsThree 8- bit

4 Input Capt12 Compare

outputs

9 PWMoutputs

3 Timers amp1 Watchdog

QuadraturePulse control

2 10-bit ADCs

16 input ch

SCIamp SPI

50 ns In str uc ti on c ycl e t ime

192 Kw ex ter nal a d dres s28- bi t sel ec ta bl e I O pi nsWat ch d o g tim er amp GP timer sSPPWM m o du le wit h sy n c an d as yn c m o deEve nt m a na gerEnc o der I n terf ac e

Hig h sp ee d U AR T132 - pi n PQ FPFla s hR OM ver si on s

Features

131215

TMS320LF2407A (16-Bit) Single-Chip DSP Controller

Features25- n se c i ns tru cti o n cyc le tim e ( 40 MH z)Dua l 1 0- bi t A D c o nv ert ers w it h 37 5- ns (min imum c o nver si on tim e) c on ver si on timeUp to f o ur 16 - bit g e neral p ur po se tim ersWat ch d o g tim er m od ul eUp to 1 6 PW M c h an n elsUp to 4 1 GP IO pi nsFiv e ex ter nal in terr up tsDea d ba n d l og icUp to t wo ev e nt m a na gersUp to 3 2K wor ds o n- c hip s ec tor ed Fl as hCo ntr oll er Are a Ne tw ork (C AN) in ter fa ce mod ul eSerial c ommu ni ca ti on s i n terf ac e (S CI)Serial p er ip h eral i n terf ac e (SP I)Up to si x ca pt ure u ni ts (f o ur wi t h QEP )Bo ot RO M (L F2 40 x an d L F2 40 xA de vic es )Co de se c urity f or on -c hi p Fl as hR OM (L x2 40 xA de vic es )

32KSectored

Flash35KRAM

BootROM

JTAGEmulationControl

ProgramDataIO Buses (16-Bit)

Pe

rip

he

ral

Bu

s

2 EventManagers

SCI

SPI

CAN

Watchdo g Timer

GPIO

10-Bit16-Chann el

ADC

TMS320LF2407A DSP

ALURegisters

Barrel Shifter

Hardware Stack

Accumulator

C2xLP 16-Bit DSP Core

Emulation

132215

TMS320F2812 (32-Bit) Single-Chip DSP Controller

667-nsec instruction cycle time (150 MHz) 12-Bit AD converters with 167 MSPS128K On-chip Flash (16-bit word)18K Word Sing le-access RAM (SARAM)Up to four 32-bit general purpose timersWatchdog timer moduleUp to 16 PWM channelsFive external interruptsDeadband logicUp to two event managersController Area Network (CAN) interface moduleSerial co mmunications interface (SCI)Serial per ipheral interface (SPI)Up to six capture un its (four with Q EP)

150-MIPS C28xTM 32-bit DSP

32times 32-bitmultiplier

32-bitTimers (3)

Real-timeJTAG

R-M-WAtomic

ALU

32-bitRegister

file

Interrupt managementInterrupt management

128 kWSectored

flash

128 kWSectored

flash18 kWRAM

18 kWRAM

4kWBootROM

4kWBootROM

McBSPMcBSP

CAN20BCAN20B

SCI(UART) ASCI(UART) A

SPISPI

SCI(UART) BSCI(UART) B

EventManager A

EventManager A

EventManager B

EventManager B

12-bit ADC12-bit ADC

GPIOGPIO

watchd ogwatchd og

Memory bus

Code security

XINTF

Per

iphe

ral b

us

Features

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 23: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

23

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

133215

TMS320C2000TM DSP Platform Roadmap

134215

TMS320LFTMS320LFC2401A Worldrsquos Smallest DSP

135215

Microchip dsPIC33 Digital Signal Controller

40 MIPS deterministic core16x16 register fileBarrel shifter1 cycle 16x16 multiplyMultiply Accumulate (MAC)Address Generation Unit

33V operation 64 to 256 Kbytes Flash 8 to 30 Kbytes RAM Non-intrusive DMA 11 Msps 1-bit AD converters with four simultaneous sa mple and ho ld8 sample and hold on some Up to two each SP I I2C UART and CAN 64- to 100-Pin TQFP packages Codec interface on some Quadrature Encoder Interface on so me

dsPIC33F fami ly block diagra m

64-256kBflash

64-256kBflash

8-30kBRAM

8-30kBRAM DMADMA

Memory bus

40 MIPS 16-bit c ore

16-bit ALU

16 times 16 M PY

JTAG amp Emuinterface

DSPengine

Register file16 times 16

Addressgeneration

Barrel shifter

AccumulatorA amp B

16-bit timers

watchdog

AD 12 bit 16 ch

AD 12 bit 16 ch

UART-2

I2CTM-2

SPITM-2

CAN 1-2

CODE C IF

Motor controlP

eripheral bus

Micr oc hip

Interruptcontrol

Features

136215

Single-Chip DSP amp mP Controller for Motor Control

ZiLOG FMC16100TI TMS320F2407A amp TMS3320F2812 Microchip dsPIC33 Digital Signal ControllerIR IRMCK203 AC Motor Sensorless ControllerMotorola MC68HC908MR32

137215

ZiLOG FMC16100 A 8-Bit Single-Chip Microcontroller for Low-

Cost Vector-Controlled Induction Driv e

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

138215

2006-11-30ZiLOG推出首例具備向量控制性能8位元MCU

ZiLOG推出首例支援向量控制( vector control)性能的8位元MCU Z8 Encore MCtrade (FMC16 100系列)這項創新大大降低了製造商的材料清單 (BOM bill of materials)成本以及在家用電器如洗碗機和洗衣機等所使用的能源消耗和用水

量這些因素不僅為消費者和環境帶來好處也有助於延長產品自身的使用壽命

先前 有人 主張 向量 控制 只 屬於 數位 信號 處理 器 ( DSP digital signal processor s)數位信號控制器( DSC digital signal controllers)和16位或32位微控制

器的領域隨著ZiLOG的工程師開發出為他們贏得榮譽的具有向量控制能力的Z8Encore FMC161 00系列晶片只有高端MCU或DSC能使用向量控制演算法的

神話終被打破ZiLOG將高速CPU-(高達 1 0mips)高速模數轉換器 (ADC Analog to Digital Converter)集成運算放大器和優化的C語言編譯程序結合起來

可以提供與DSP向量控制同樣的功能ZiL OG估計與高端MCU解決方案相比ZiLOG的解決方案可節約全部BOM的 50

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 24: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

24

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

139215

ZiLOG 8-Bit Microcontroller for Motor Control

Torque

Speed

Position

Direction

FeedbackSensors

ZiLOGFMC16100

or Z8 EncoreXPregSeries

Input

MO

SFE

T o

r

IGB

T d

rive

r

Motor

140215

ZiLOG FMC16100 Flash mP for Digital Motor Control

FEATURES20 MHz ZiLOG eZ8 CPU coreUp to 16 KB Flash program memory512 B register SRAM6-channels of 12-bit PWM with dead-band generation and Fast Shutdown8-channel 25μs 10-bit ADC wInternal ReferenceOne 16-bit timer with capturecomparePWM capabilityOne analog comparator for current limiting or over current shutdownOne OP-AMP provides current level-shifting and amplification for ADC current samplingI2C in master slave and multimaster modes SPI controller UART with LIN interface

141215

ZiLOG FMC16100

FEATURES20 MHz Z iL OG e Z8 CPU core

Up to 1 6 KB Fl as h pr ogr am mem ory512 B re gi st er SRA M

Fa st 8- ch a nn el 1 0- bi t a na lo g -t o- di gi tal co nv ert er f or curre n t s am pli n g a n d b ack -E MF de te cti o n 12- bi t PW M mo du le w it h t hree com pl eme nt ary pa irs or si x i n de pe n de nt PWM o ut p ut s wi th de ad - ba nd ge ner ati o n a nd fa ult tr i p i n pu t

On e 1 6- bi t t imer wit h ca pt ure c om pareP WM ca pa bil it y

On e a n al og c om para t or f or c urre nt limi ti n g or ov er c urre nt sh u td o wn

On e O pera ti on al Am pli fier prov id es c urre nt lev el- s hif ti ng an d am pl ifi ca ti on for ADC curre nt s amp lin gI2C i n m as ter sl av e an d m ul ti-m as ter m o de s SPI c on tro ller

UART wi t h LIN i n terf ac eInt ern al Pr eci si on O sci lla tor (IP O)

142215

Z8FMC16100 Series Part Selection Guide

143215

ZiLOG FMC16100 for AC Induction Motor Control

Ref Zilog Vector Control of a 3-Phase AC Induction Motor Using FMC16100 MCU (AN0247)

(a) washing machine (b) induction motor with tachogenerator

Rated Power 500 WRPM max 15000 rp mMax current 28 ArmsContinuous current 15 ArmsDC Bus Voltage 350 Vdc

AC power

Power stage

HV main board

FMC16controlmodule

HVpowermodule

HVdrive

module

wash ingmachine

interfacemodule

DACmodule

XPcommand

module

3 phase ACinduction

motor

user interface

FM C1 61 00 ser i es m icr oc on tro ller

PC

UART

Speedregulator

Currentregulator

Inversepark

transform

InverseClarke

transformSpace vectormodulat i on

PWM

Sli pupdate

Fie ldweake nin g Tachometer

update

Parktransform

Clarketransform

Currentsample amp

reconstruct ion

Bus ripp lecompensati on

Bus voltag esample

ACinduction

motor

Three-phaseinverter

144215

VF Air-Conditioner Outdoor Unit Block Diagram Based on TMS320LFC24xx (Texas Instruments)

Car eabouts r eliability cost per for mance effic iency noise

Single DSP for Digital-PFC and VF compressor controlImproved compressor control techniquesNo position speed sensors Sensorless control methods for BLDCPMSMField Orient Control for PMSMEfficient use of supply voltage

AC input

EMI FilterRectifier

PFC

Invertershunt resistorsresistor dividers

12V33V PSPWM (UC3 842TLV43 1)LDO (TLV2217) SVS(TPS3 7809)

Signal conditioning(LM324TLV227 OPA340)

PWM driver

Comms interface (M AX232 SN75LBC179)

Fan relay

Expansionvalue

IF bu

ffer(U

LN

200

3) Tempperssure

sensing andconditioning

ADCSCICANIO

PWM

ADCPWMIO

TMS320LC240xA

ACIBLDCPMSM

indoorunit

pressure Temp

Pressuretemp Fan

coiltemp Coil pressure

From indoorunit

Outdoor airtemperature

To indoor unit

Expansionvalue

M

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 25: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

25

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

145215

MC68HC908MR32

146215

MC68HC908MR32 for Digiotal Motor Control

147215

IR iMotiontrade Solution for Sen sorless Control of W ashershttpwwwirfcomproduct-infoimotion

Sensorless Motor Control for WashersDrive -dr i ve mo tor c on tro l wi t ho u t H all se ns ors

Com ple te a pp lia n ce c on trol s ys tem o n a si n gl e IC

Embe d de d mo tor c o ntr ol al g orit hms wit h i nd e pe nd e n t ap pli ca ti on la yer pr oc ess or

Mo ti o n C o ntr ol E n gi neTM el imi na te s a lg ori thm s of tw are co di n g

Lo w no is e se ns orle ss c on tro l u si n g d c li n k c urre n t se ns or on ly

Ap pli an ce -s pe ci fic HVIC s a n d i n tel lig e nt p ow er mo d ul es

AC input

communication300V bus

system IO DC bus

powersupply

PWM

AD

RAM

MCU 8 bit

MCU 16 bit

Digital co ntrol IC

Isolation

HVICgate drive

PMmot or

Intelligent power module

EMIFilter

148215

DSP (TMS2407A) Realization of Digital AC Servo Control Algorithm

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

149215

DSP Solution for Induction Motor Drives

DSP CON TR O LLER

TMS 320 F 24 0

TEX AS

I NSTRUMENTS

INTELLIGENTPOWER MODULE

SQUIRREL-CAGEINDUCTION MOTOR

150215

240xA Device Architecture

P Bus I F

SPI SCI CAN WDADC

cont rolInte rr up tRese t e tc

IOregi ste rs

ADC

EventMa na ge rs

(EVA a nd EVB )

P bus

Flas hR O M(up to 3 2K times 16 )

Synth esiz ed ASIC gat es

C2xx CPU+ JTA G+ 5 44 times1 6DARA M

SARAM(up to 2K times1 6)

SARAM(up to 2K times1 6)

Me m I F

Logi cIF

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 26: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

26

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

151215

Event Manager Block Diagram

Each EV mo dule in the 240xA device contains the following functional blocksTwo general-purpose (GP) timersThree compare un its

Pulse-width modulation (PWM) circuits that include space vector PWMcircuits dead-band generation units and output lo gic

Three capture unitsQuadrature encoder pulse (QEP) circuit

Interrupt log ic

152215

Asymmetric Waveform Generation

GP Timer Co mparePWM Output in Up-Counting Mode

Active

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Inac tive

New c o mpvalu e g re at er

tha n p eri odTxPWMTxCMPactive low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ ++

+

153215

Symmetric Waveform Generation

GP Timer Comp arePWM Output in Up-Down- Counting Modes

Active

Tim er(PWM )peri od 1

Tim er(PWM )peri od 2

Com pa remat ch

Relo ad edCom p v alu e

gre at ertha n p eri odTxPWMTxCMP

active low

Timer value

TxPWMTxCMPactive high

+ Comp ar e ma tch es

+ +

++ +

+

Inac tive

154215

PWM Circuits Block Diagram

MUXDea dBandunits

Out putlogic

Sym asy mwave fo rmgen er at or

SVPWMsate

mac hin eDBTC ONAdea d- ba ndtine r c ont rol

regi ste r

ACTRAFull co mp ar eactio n c on tr ol

regi ste r

ACTRA[ 12 -1 5]

COM CONA [1 2]

COM CONA [1 1- 13]

PWM1PWM6

COM CONA [9]

Com pa remat ch es

GPT 1 fl ags

PHzX=1 23

DTPHxDTPHx _

155215

Analog-to-Digital Converter

FeaturesADC OverviewADC Clock PrescalerCalibrationRegister Bit DescriptionsADC Conversion Clock Cycles

156215

Autosequenced ADC in Cascaded Mod e

Your p ro gr am ca n b e hig hly simpli fie d a nd ex ecu te d e fficie ntly by u sin g t he aut o- se qu enc er

Th e st ar tin g of th e A D conv er sio n c an be tri gg er ed by the E ve nt Ma na ge r

Th e r es ults ar e st or ed in a pre -d efi ne d se qu en tial regi ste rs

MUXSelect

ResultSelect

Analog MUX Result MUXADCIN0ADCIN1ADCIN2

ADCIN15

10

SOC EOC

10-bit 375-nstSH + ADconverter

RESULT0

RESULT1RESULT2RESULT15

10

4 4

Statepointer

MAX CONV1

Ch Sel (state0)Ch Sel (state1)Ch Sel (state2)Ch Sel (state3)Ch Sel (state15)

Autosequencerstate machine

Note Possible value areChannel select = 0 to 15

MAXCONV = 0 to 15

State-of-sequence t riggerSoftware

EVAEVB

External pin (ADSCOS)

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 27: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

27

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

157215

Autosequenced ADC in Dual Sequencer

Th e re s ult s ar e s t ore d i n a pre- d efi n ed se p arat el y se qu e nti al re gi st ers

Not e SEQ 1 a n d SEQ 2 are tr ig ger ed by EV A a n d EVB res p ec tiv ely

MUXSelect

Analog MUXADCIN0ADCIN1ADCIN2

ADCIN15SOC EOC

10-bit 375-nstSH + ADconverter

10

ResultSelect

Result MUXRESULT0RESULT1

RESULT15

10

ResultSelect

Result MUXRESULT8RESULT9

RESULT1510

Statepointer

MAX CONV1

Ch Sel(state0)Ch Sel(state1)Ch Sel(state2)Ch Sel(state3)

Ch Sel(state7)

Statepointer

MAX CONV2

Ch Sel(state8)Ch Sel(state9)Ch Sel(state10)Ch Sel(state11)

Ch Sel(state15)

SOC1 EOC1 SOC2 EOC2

Sequencerarbiter

MUX

10

10

4 4

4

4

SEQ1 SEQ2Note Possible valuesChannel select = 0 to 15MAX CONV = 0 to 7MAX CONV2 = 8 to 15

SoftwareEVA

External pin (ADSCOS)

State-of-sequencetrigger Software

EVB

State-of-sequencetrigger

158215

DSP-Based DMC on AC Induction Motor

IM A C Mo t or

N

S

S 1

S 2

S 3

S 4

S 5

S 6

3-PhasePower

Supply

oV dc

DSPCo ntr oll er

JTAGPWM1PWM2PWM3PWM4PWM5PWM6

AB

CAP1

XDS510 PP

ADC1ADC2

+5v

Speedset point

Inc Freq

Dec Freq

IOPA0IOPA1

encoder

159215

Development Environment for DSP Motor Control

220V60Hz

ProtectionCircu it

BaseDriver

IPM

CurrentSensor

Phase Current

DSP-Based Motor Controller (DMCK-240)

PWM Power Converter

PM AC Servo Motor

dual-portRAM

320F240

PC-DSP La bSwitching

PowerSupply

TM S320F240

TEXASINSTRUMENTS

320C32

RS-2 32

160215

Hardware Implementation for DSP Servo Control

DSP Co n trol ler

SerialLi nk

In pu t E MI Fil ter

Aux ili ary S u ppl y

Pow er St ag e

Sen sor+ 1 5 V

+ 1 5 V

+ 1 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V

+ 5 V+ 5 V

+ 5 V

R 2 23 3 R

R 2 33 3 R

R 2 43 3 R

Q 3C O P AK

Q 2C O P AK

Q 1C O P AK

R 1 13 3 R

R 1 2

3 3 R

R 1 3

3 3 R

D 1 1

1 0 B F 4 0

U 4

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4 S D3

I N2 V C C1

U 5

I R 2 10 4

V B8

H O7

V S6

L O5

C O M4

S D3 I N2 V C C1

Q 6

C O P AK

R 3 3

1 K 2

R 3 1

1 K 2

C 1 92 0 p F

G 14 9M Hz R 2 0

1 0 K

R 1 8

1 0 K

R 1 71 0 K

R 2 61 2 K

D 1 0

1 0 B F 4 0

D 1 3

1 0 B F 4 0

U 3

I R 2 10 4

V B8

H O7

V S6

L O 5C O M4S D

3 I N2

V C C1

R 3 23 3 0 R

C 2 02 0 p F

R 31 M

C 22 5 nF

C 72 5 nF

C 51 0 0 n F

C 44 7 0 n F

V 1

F 12 A

C 1 1

1 0 0 n F

D 1

D 7

D 31 5 V

+C 32 2 0 u F

C 11 0 0 n F

Q 5

C O P AK

Q 4

C O P AK

R 9

1 0 K

C 1 3

1 0 0 n F

R 3 6

7 5 K

C 2 2

1 0 0 n F

R 3 71 5 K

+

C 1 42 2 u F

R 1 0

1 0 K

2 2 0 1 5 V 1 V A

T R A N S FO RM E R

C 1 21 0 0 n F

L 1

2 4 00 u H

D 1 41 N 4 1 4 8

R 3 4

R 1

R 1

2 2 0 R 0 5W

D 2

C 1 0

1 0 0 n F

R 41 2 0 R 1 5W

C 1 61 0 0 n F

C 1 71 0 0 n F

C 1 81 0 0 n F

D 6

D 8

D 5D 4

D 9

+ C 6

2 2 0 u F

+

-U 6 AT L E 2 1 41

3

2

1

84

N T C 1

C 2 1

1 0 u F

R 2 8

1 0 K

R 1 5

1 0 K

R 2 51 0 K

R 2 15 M

R 2 7

1 0 K

R 2 9

1 0 K

R 3 0

1 0 K

R 8

1 0 K

R 1 4

1 0 K

U 1

L M 78 0 5 A

1

2

3

R 1 91 0 K

D 1 5L L 4 1 48

TMS 32 0C 24 2

C M P 17

C M P 26

C M P 35

C M P 4 4

C M P 53

C M P 62

IO P C 25 6

AD

CI

N00

32

AD

CI

N01

31

AD

CI

N02

30

AD

CI

N03

29

AD

CI

N04

28

AD

CI

N05

26

AD

CI

N06

25

AD

CI

N07

22

IOP

C3

57

IOP

C4

58

IOP

C5

59

IOP

C6

11

IOP

C7

10

TC

K3

6

TD

I3

7

TD

O3

8

TM

S3

9

TR

ST

4

0

EM

U0

48

EM

U1

49

PM

T6

0

RS

3

5

V s s d d14 4

V s s d d29

V s s d d36 1

V s s d d44 3

V s s dc 15 1

V s s dc 21 7

V s s dc 34 1

Vc

cd

d14

5

Vc

cd

d2

8

Vc

cd

d36

2

Vc

cd

d44

2

Vc

cdc

15

2

Vc

cdc

21

6

WD

DIS

63

Te

st

pin3

3V

ss

o3

4

GN

DA

20

Vc

ca

21

VR

EF

HI

23

VR

EF

LO2

4

X T A L 14 6

X T A L 24 7

IOP

A3

15

IOP

A4

14

IOP

A5

13

IO P B 41 9 IO P B 51 8 IO P B 66 7

IO P B 76 8

SC

IT

XD

54

SC

IR

XD

55

XF

IOP

C0

50

BIO

IOP

C1

53

CL

KOU

TIO

PD0

12

NM

I6

4IO

PA

26

6X

IN

T26

5

P D P I N T1

C 9

2 2 n F

C 82 2 n F

R 71 0 K

R 1 61 0 0 K

C 1 5

1 n F

U 7

T L P 7 3 1

12

6

45

R 63 3 0 R

R 51 K

P H

N

E A R T H

U

V

W

C o m G ro u nd

T X

I S E N S

161215

DSP Tasks in Digital Motor Control Systems

Digital

Controller

Drive Command

PWMGeneration

Gate Drivers

Power-Converter

(Power Transistors)

Mo t or+

Lo a d

Sensors( I V Flux

Temp PosVel Acc)

SignalConditioning

amp Filtering

(1) (2) (3) (4) (5)

(7)(9)

(6)

DSP Controller

Reference Generation

Digital Con troller Drive Command PWM GenerationSignal Conversio n amp Conditi onin g

Diagnost ic amp Supervisory

- Polynomial- Lookup tableamp interpolation

- Control a lgorithms PID- Parameterstate estimation- FOC transformations- Sensorless Algo( Flux Acc

Speed Position Cal )- Adaptive control Algo

- A D control- Data filtering- Notch Filter

- PWM generation methods- Commutation control for AC motors- Power factor correction (PFC)- Compensation for line ripple ( DC Link Cap)- Field weakening High Speed Operation

Communication Netw orking- Current Voltage Temp control- Safety routines - Host and peripheral communication and

interface

Noise Control- Acoustic noise reduction- Electrical noise reduction

Reference Generation

AC DC Conversionamp Input Filter

(11)

ACInputAC

Input

Signal Conversion

( AD )Signal

Conversion( AD )

(8)

Communi-cation

NetworkingCommuni-

cationNetworking

(10)

162215

TMS320X240 AC Motor Control Program Structure

Start

Initialization Routines- DSP se t up- e ve n t ma na g er i nit ial iza ti on- e n ab le in terru p ts- s tar t ba ck gro u nd

Run RoutinesBackground- v is ua l ou tp u t- RS -2 32 c ommu ni ca ti on

Timer - ISR- PW M si gn al ge n erat io n- c urre nt c on tro l

XINT - ISR- v ec t or c on tro l- v el oc it y c o ntr ol- po si ti on c on tro l

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 28: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

28

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

163215

Flowchart for the DSP Initialization

DSP reset

disable i nterrupts

enable i nterrupts

initialize programcontrol c oun ters amp

flags

initialize c ontrolalgorithm parameters

initialize ev entmanager

DSP setup

start backgro und

create sine ta ble

bullSETC INTM

bull 20MHz CPUCLK bull 10MHz crystalbull 2X PLL multi-ratiobull low-power mode 0bull ACLK enablebull SYSCLK=CPUCLK2bull WDCLK outputbull enable WD timer

bull Clear pending interruptsbull enable INT3 amp INT6bull enable timer 3 interruptbull disable capture interruptbull set XINT1 low prioritybull reset XINT1bull global interrupt enable

bull initialize timer 3bull initialize timer 1bull setup compare unitsbull setup shared IO pinsbull setup AD converterbull setup QEP circuit

bull create 400 pts sine tablebull using Q12 format

164215

Flowchart for the Current Control Loop

32 phasetransformation

current controller

speedloop

RET

PWM modulationPWM signal gen eration

23 phasetransformation

interrupt vel ocity l oopyes

no

Timer-ISR

dead-t imecompensati on

bull parameters adjustmentbull AD current feedbac kbull encoder fe edba ck

IO subrou tine

165215

Flowchart for the Servo Control Loop

RET

XINT - ISR

subrouti ne

communicationinterface

positi onloop

anti-wi ndu pfuncti on

velocity c ontroll er

positi on c ontrolleryes

no

RSTransformation

outp ut c urrentcommand

positi oncommand

pos_ref=p os_ref + feed rate

reach thetarget po sitio n

feed ratecalculati on

positi on c ontroller

yes

outp ut s peedcommand

Kv

feed rate = 0

Err

Kv

RETtunin g rule

no

back EMFcalculati on

functi on

166215

PWM Generation and ADC Conversion for Dual ACDC Converters for 3-Phase PFC AC Motor Drive

Cd

to switches

Inputconverter

Outputconverter

ud

to switches

ursquo1ursquo2ursquo3

N S

SEQ1EVA

Res ul tMUX

ADCIN0ADCIN1ADCIN2ADCIN3ADCIN4ADCIN5ADCIN6ADCIN7

MUXsel ec t

RESULT0RESULT1RESULT2RESULT3RESULT4RESULT5RESULT6RESULT7

CON TRO L IO IN TER FACE

SEQ2EVB

Res ul tMUX

ADCIN8ADCIN9ADCIN10ADCIN11ADCIN12ADCIN13ADCIN14ADCIN15

MUXsel ec t

RESULT8RESULT9RESULT10RESULT11RESULT12RESULT13RESULT14RESULT15

167215

TMS320C24xx Event Manager Block Diagram

NOTE N um be r o f Tim er s PW M c ha nn els Co mp ar es QEPs a nd Ca ptu res va ry on 2 4x d evic es eg lsquo2 40 7 has 2 Ev en t- ma na ge rs li ke this

GP Timer Compare 2

GP Timer Compare 1

CM P1PWM 1CM P2PWM 2CM P3PWM 3CM P4PWM 4CM P5PWM 5CM P6PWM 6

GP Timer1

GP Timer compare 1

Memory(ROM RAM Flas h)

Output LogicCircuit

Output LogicCircuit

Output LogicCircuit

ProgramDeadbandProgramDeadbandProgramDeadband

Compare Unit 2

Compare Unit 3

Compare Unit 1 PPG

PPG

PPG

OutputLogicUnit

OutputLogicUnit

GP Timer2GP Timer compare 2

M UX

ADC 8 ADC 1 InputsMUX

QEP 1

QEP2

Capture Unit 1

Capture Unit 2

Capture Unit 3

CAP1QEP1

CAP2QEP2

CAP3

DSP Core

168215

Realization of PWM Signal Generator

T1CNTCPT1

count er

Comparelogic

CMPRxfull compare

register

ACTRfull compare

action c ontrol reg ister

Outpu tlogic

Outpu tlogic

PWMcircuits

MUX

PWMx

CMPx

iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiodT1CON = 0x9040

CMPR1 = 0x0CMPR2 = 0x0CMPR3 = 0x0

ACTR = 0x0111 Initialize action on output pins

Timer CounterValue (0-gtFFFF)

CompareValue

Timer (PWM ) period

Active High

Active low

DBTCON = 0x0 disable deadband COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 29: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

29

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

169215

Realization of Encoder Signal Feedback

GPT 2

ENDecoder

logicMUX

TMRDIR

dir

MUX

CLK

DIR

clock

T2CON

CAPCON

CAP1QEP1CAP2QEP2

Other clock s ource

2

2

2

2

T2CNT = 0x0000T2PER = 0xffff

CAPCON = 0xe4f0

T2CON = 0x9870

PulseOld = T2CNTPN = (long int)(PulseNew - PulseOld)PulseOld = PulseNewif ( ( abs(PN) - 1000 ) lt= 0 ) No Overflow

PulseNumber = (int)PNelse

if ( PN lt 0 )PulseNumber = (int)( PN + 65536 )

elsePulseNumber = (int)( PN - 65536 )

Speed

170215

Realization of 2φ3φ Function

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=⎥⎦

⎤⎢⎣

c

b

a

y

x

iii

ii

0222

0023

Ix=Ia108Iy=(int)(((long int)Ia+2(long int)Ib)1116

0 05 1 15 2 25 3 35 4 45 5-100

-80-60-40

-200

2040

60

80100

ai

bi

0 1 2 3 4 5-150

-100

-50

0

50

100

150

)(dspxi xi

yi)( dspyi

DSP real iza ti o n)(

)(

dspy

dspx

i

iba ii ba ii yx ii

Simul ati o n re aliz at io n

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

011plusmn=Δθ

0 20 40 60 80 100 120 140010

203040

50

6070

011plusmn=Δθ

θ

171215

Realization of 3φ2φ Function

0 1 2 3 4 5-100-80

-60

-40

-200

20

40

60

80

100

0 1 2 3 4 5-100

-80-60

-40

-20

020

40

6080

100

⎥⎦

⎤⎢⎣

⎥⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢⎢

minusminus

minus=

⎥⎥⎥

⎢⎢⎢

y

x

c

b

a

vv

vvv

21

61

21

61

032

DSP real iza ti o n

yx vv cba vvv

Simul ati o n re aliz at io n

Va=(int)((long int)Vxc2632)Vb=(int)((long int)(-Vxc)1332+(long int)Vyc2332)Vc=(int)((long int)(-Vxc)1332-(long int)Vyc2332)

080plusmn=Δθ

xcvycv

Th e p ha se de vi ati o n be tw ee nsimu la ti on a nd DSP re ali zat io n

Va

Vc

Vb

080plusmn=Δθ

θ

172215

Realization of Rotating to Stationary Transformation Function

0 50 100 150 200 250 300 350 400-2500-2000-1500-1000-500

0500

10001500

20002500

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡ minus=⎥⎦

⎤⎢⎣

qs

ds

ee

ee

s

s

ff

ff

θθθθ

β

α

cossinsincos

void sin_table()int ifor(i=0ilt400i++)

SinTable[i]=(int)2048sin(6283185307i400)

Creat e 40 0 Pt s Si ne T a ble

void R_to_S()Ixc = (int)((long int)IdcSin(Theta_e-300)2048-((long int)IqcSin(Theta_e)2048))Iyc = (int)((long int)IdcSin(Theta_e)2048+((long int)IqcSin(Theta_e-300)2048))

DSP real iza ti o n

int Sin(int theta)while(theta gt=400)

theta = theta - 400while(theta lt 0)

theta = theta + 400return SinTable[theta]

173215

Realization of Slip Estimation Function

+

+

Lm

τ r

imr

iq s

iq s

divide

times

int

ids1

1s rτ +

PLL

m

r2

ωsl ω e

ωr

θe

Te

λr

ds

qs

r

rqs

r

r

ds

r

r

sl iisi

LR

i

sRL

ττω +

=

+

=1

1

r

rr R

L=τ

ds

qs

rsl i

ω 1=

wh ere

In st ea dy st at e

Psl = 9Iqc32 932 = Rad2Pulse(TrIdc)

DSP real iza ti o n

Wsl = Iqc(TrIdc) Tr = 002833

Rs = 54 (Ohm)Rr = 48 (Ohm)Ls = 0136 (H)Lr = 0136 (H)Lm = 0100 (H)Idc = 08 (A)

Psl = Rad2PulseIqc(TrIdc) Rad2Pulse = 063661977

Slip E st ima ti on F u nc ti on

The rotor flux model of induction motor

174215

Realization of Current Loop

K Vbus

500

-500

500PWM

1

1000

VDuty

+

Loop Gain

Curre nt Co n trol Al gori t hm Win di n gDyn ami cs

Ls + RR i

Feedback Gain

0

1023V

0125 VA

_

Current feedback

Currentcommand

10235

AD C o nv erter

4+

2048

WORD read_a2d(int a2d_chan)WORD invalif( a2d_chan == 1)

inval = (ADCFIFO1 gtgt 6) amp 0x03ffelse if (a2d_chan == 2)

inval = (ADCFIFO2 gtgt 6) amp 0x03ffreturn inval

DSP real iza ti o nerr_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_IyVxc = cKp err_IxVyc = cKp err_Iy

DSP real iza ti o nADCTRL1 = 0xfc25 ADCTRL2 = 0x0406

DSP in iti ali za tio n

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 30: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

30

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

175215

Calculation Time of Various Data Type Using C

int

Addition 01(us)

Subtraction 01(us)

Multip lication 08(us)

Division 08(us)

long

Addition 02(us)

Subtraction 02(us)

Multip lication 25(us)

Division 25(us)

float

Addition 22(us)

Subtraction 22(us)

Multip lication 17(us)

Division 7(us)176215

Timing Analysis of TMS320X240 for Vector Control of an Induction Drive

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM sig nal ge neration

vector con trol amp veloci ty co ntrol amp po sitio n co ntrol

visual o utp ut amp RS-232 commutati on

100us

1ms

timer 3 period interrupts

177215

Computation Analysis of Software Modules for a DSP-Based (TMS320F240) Induction Drive

SW block module execution freq execution timevisual output background 1 kHz 30 usRS -232 commutation background 1 kHz 670 uscurrent control timer ISR 10 kHz 40 us32 transformation timer ISR 10 kHz 90 us23 transformation timer ISR 10 kHz 230 usPWM signal output timer ISR 10 kHz 70 usAD current feedback timer ISR 10 kHz 140 usveloci ty control X INT IS R 1 kHz 280 usRS transformation X INT IS R 1 kHz 400 usslip estimation X INT IS R 1 kHz 50 usfield control X INT IS R 1 kHz 170 usveloci ty estimation X INT IS R 1 kHz 50 usposition control X INT IS R 1 kHz 400 usC context swi tch RTSLIB 10 kHz 60 us

Processor loading = = 851000 us850 us

178215

Example of Vector Table Using Assembler

length 58

option T

option X

text

def _int_0

_int_0 B _int_0 ILLEGAL INTERRUPT SPIN

sect VECTOR

ref _c_int0

ref _c_int3

ref _c_int6B _c_int0 RESET

B _int_0 INT1B _int_0 INT2B _c_int3 INT3 lt---- Timer ISR B _int_0 INT4B _int_0 INT5B _c_int6 INT6 lt---- XINT ISRB _int_0

B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0 B _int_0

B _int_0 B _int_0 B _int_0 TRAPB _int_0 NMIend

179215

Example of Initializing Event Manager Peripherals Using C

void eventmgr_init()WORD iperiod

-------------------------------------------------------- Initialize GP timer3 to provide desired CPU interrupt --------------------------------------------------------iperiod = (SYSCLK_FREQCPU_INT_FREQ)-1GPTCON = 0x1055 setup general purpose control reg T3PER = iperiod Load timer 3 period register T3CON = 0x9040 Initialize timer 3 control register

-------------------------------------------------------- Initialize GP timer1 to provide a 20kHz time base for fixed frequency PWM generation --------------------------------------------------------iperiod = (SYSCLK_FREQPWM_FREQ)-1T1PER = iperiod Load timer 1 period register T1CON = 0x9040 Initialize timer 2 control register

-------------------------------------------------------- Setup Compare units for PWM outputs --------------------------------------------------------ACTR = 0x0111 Initialize action on output pins DBTCON = 0x0 disable deadband CMPR1 = 0x0 clear period registers CMPR2 = 0x0CMPR3 = 0x0COMCON = 0x0207 setup COMCON wo enable COMCON = 0x8207 setup COMCON and enable 180215

Example of Initializing Event Manager Peripherals Using C (Contrsquod)

-------------------------------------------------------- Setup Shared Pins --------------------------------------------------------OCRA = 0x03 IOPA2 ~ IOPA3 IOPB0-7 OCRB = 0xf1 ADCSOC XF BIO CAP1-CAP4 PADATDIR = 0x0c00 IOPA2 IOPA3 Low PBDATDIR = 0xf0f0 input IOPB0-3 output IOPB4-7 -------------------------------------------------------- Setup AD Converter --------------------------------------------------------ADCTRL1 = 0xfc25 Initialize AD control register ADCTRL2 = 0x0406 Clear FIFOs pre-scaler = 20 -------------------------------------------------------- Setup QEP Circuit --------------------------------------------------------CAPCON = 0xe4f0 1110 0100 ffff 0000 T2CNT = 0x0000T2PER = 0xffffT2CON = 0x9870 1001 1000 0111 0000

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 31: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

31

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

181215

Example of Timer ISR for Current Loop Using C

void c_int3()

IFR_REG = 0x0004 clear interrupt flags IFRB = 0x00ff

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2

count = count + 1interrupt1 = interrupt1 + 1

cur_Ia = read_a2d(1)-4 A2D input channel 3 Offset 4 cur_Ib = read_a2d(2)-11 A2D input channel 11 Offset 11

cur_Ia = cur_Ia4-2048 change to 1A = 1024 cur_Ib = cur_Ib4-2048

========================================= [IxIy] = [IaIbIc] --gt 32 =========================================

cur_Ix =cur_Ia 108 Q3 cur_Iy =(int)(((long)cur_Ia + 2(long)cur_Ib)1116) Q4

err_Ix = cur_Ixc - cur_Ixerr_Iy = cur_Iyc - cur_Iy

==+======================================= Current Controller ====+=====================================

Vxc = cKp err_IxVyc = cKp err_Iy

182215

Example of Timer ISR for Current Loop Using C (Contrsquod)

============================================== [VaVbVc] = [VxcVyc] --gt 23 Va = Vxc sqrt(23) Vb = [-Vxc + Vycsqrt(3) ] 05sqrt(23) Vc = [-Vxc - Vycsqrt(3) ] 05sqrt(23) ==============================================Va = (int)((long)Vxc 2632) + 500Vb = (int)((long)(-Vxc) 1332 + (long)Vyc2332) + 500 Vc = (int)((long)(-Vxc) 1332 - (long)Vyc2332) + 500 ========================================= PWM Limit =========================================PWM_Limit() out_PWM()

if( count == ONE_HALF_SECOND)

Toggle_LED = 1 set flag for toggling the count = 0 DMCK-240 LED

if(interrupt1 == 10) enable XINT 1 PADATDIR = 0x0800 IOPA3 output HIGH interrupt1 = 0

else

PADATDIR = 0x0808 IOPA3 output LOW

183215

Example of XINT ISR for Servo Loop Using C

void c_int6()

IFR_REG = 0x0020 clear interrupt flags asm( CLRC INTM) global interrupt enable

WDTKEY = GOOD_WDT_KEY1 kick watchdog timer WDTKEY = GOOD_WDT_KEY2 PulseNew = T2CNT read encoder feedback pulse =========================== Servo Loop ===========================if ( ServoMode == 0 ) initial Mode

ServoMode = 1PulseOld = T2CNT read encoder feedback pulse else if( ServoMode == 1 )Pulse_Tss()Position_Controller() PulseError = PulseCommand - PulseNumberSpeed_Controller()Slip_Estimation()PulseIndex = PulseIndex + PulseNumber + Psl PulseLimiter()Pulse_to_Angle()AngleLimiter()R_to_S()

184215

Experimental Results of the Digital Band-Band Current Controller

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -18db (124)

(a) (b)

Stopped 19971027 12184850msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 00V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1Delay 00nsHold Off MINIMUM

Stopped 19971027 12113150msdiv(50msdiv)NORM20kSs

CH1=200mVDC 101

=Fileter= =Offset= =Record Length= =Trigger=Smoothing ONBW 20MHz

CH1 0000VCH2 0000VCH3 000VCH4 00V

Main 10KZoom 10K

Mode NORMALType EDGE CH1Delay 00nsHold Off MINIMUM

(a) ste p re sp ons e a nd ( b) ste ady -st at e re sp ons e of t he ph ase cur re nt (c) cu rre nt v ect or t raj ect ory i n stea dy -st ate a nd (d ) ha rm onic s s pec tr um

185215

Experimental Results of the Auto-Tuning Current Vector Controller

Stopped 19971027 13371850msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode SGL(S)Type EDGE CH1 Delay 00nsHold Off MINIMUM

Stopped 19971027 13251050msdiv(50msdiv)

NORM20kSsCH1=200mVDC 101

=Fileter=Smoothing ONBW 20MHz

=Offset=CH1 0000VCH2 0000VCH3 000VCH4 0000V

=Record Length=Main 10KZoom 10K

=Trigger=Mode NORMALType EDGE CH1 Delay 00nsHold Off MINIMUM

(a) (b)

(c) (d)0 200 400 600 800 1000-90

-80

-70

-60

-50

-40

-30

-20THD= -27db (473)

-04 -03 -02 -01 0 01 02 03 04-04

-03

-02

-01

0

01

02

03

04

(a) st ep r esp ons e an d (b) st ea dy- sta te re sp ons e of t he p has e c ur re nt (c ) c ur re nt vect or traj ect ory in ste ady -st at e and ( d) ha r moni cs s pe ctr um 186215

Various Velocity Step Responses of a PMAC Drive

0 002 004 006 008 01 012 0140

50

100

150

0 002 004 006 008 01 012 0140

2

4

6

8

10

12

(PulseNumberms)

(A)

(sec)

(sec)

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 32: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

32

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

187215

Experimental Results for Field-Weakening Control

Rotor Speed

4500

0 1000 2000 3000 4000

3000

(a)

[rpm]

3500

4000

2000

2500

5000

0 1000 2000 3000 4000 [msec]0

05

1

15Field Current id

(b)

[Amp]

[msec]

188215

Typical Positioning Response with Specified Motion Profile

0 05 1 15 2 25 3 35 4 45 5-5

-4

-3

-2

-1

0

1x 104

0 05 1 15 2 25 3 35 4 45 5-200

-150

-100

-50

0

50

100

150

200

(PulseNumber)

(sec)

(sec)

(PulseNumberms)

189215

Positioning Response with a Constant Feed Rate of 80kPPS

37 372 374 376 378 38 382 384 3860200400600800

100012001400160018002000

37 372 374 376 378 38 382 384 386-35

-3

-25

-2

-15

-1

-05

x 104

)(1786 rPulseNumbex =Δ

)(sec8441786

1080

1

3

minus

minus

=

=

Δ=

xvK s

vposition loop gain

Feed Rate=80 (kPPS)

(PulseNumber)

(sec)

(sec)

(PulseNumber)

190215

Digital Motor Control ICs

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

191215

IRMCK201 Digital Motor amp Motion Controller (IR)

M ulti-axisHost

Or

other hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

ejθ

+ +

+minus

minus

+ +

SpaceVectorPWM

Deadtime

Dc bus dynamicbreak control

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

Ks intdt

ejθ 23

1T counterSpeed

measurementQuadratedecoding

Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

encoder

AC power

IGBTmodule

AC Motor

IRAMX16UP60A

IR2

136

IRMCK201

iMOTIONTM chip set

192215

IRMCK203 Functional Block Diagram

Hostcontroller

EEPROM

RE232Cor

RS42

SPIinterface

Parallelinterface

Hostregisterinterface

currentejθ

current

+ +

+minus

minus

SpaceVector

PW (lossminimization)

ADinterface ADMUX

ConfigurationregistersMonitoringregisters

ejθ 23Perioddutycounters

Perioddutycounters

fault

brake

select

Analog speedreference

Dc bus feedback

IR2175

IR2175

AC power

IGBTmodule

mot or

IRAMY20UP60A

IR2

136

IRMCK203Dc bus dynamicbreak control

Plug-N-driveTM

IGBT module

4Channel

DA

Analogmonitor

speedSpeedramp

Flux currentreference

Torque currentreference

Rotor angleSpeed

estimator

Start-stopSequencer

And Fault

detector

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 33: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

33

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

193215

IRMCK203 Typical Application Connections

IRMCK203Digital Motion

Control IC

33MHzcrystal

MAx232A

8051up

AT24C01A

Gate driveamp

IGBTs

ADS7818

OSC1CLKOSC2CLK

SPICLKSPIMISOSIMOSISPICSN

TXRX

Systemclock

SPI interface

To PC

Optionalmicrocontroller

DiscreteIO

switches

LED

Serial EEPROM

BAUDSEL [10]

HPD []0-7HPOEN HPWEN

HPCSN HPASTARTSOP

DIRESTOP

FLTCLRSYNG

FAULTSCASCL

REDLEDGREENLED

DAC0DAC1DAC2DAC3Analog output

Bi-colorLED

isolatorIFB0 5VPo IR2175

Motor phaseshunt

isolatorIFB15V

Po IR2175Motor phase

shunt

Motor currentsensing

4051

Analog speedreference

Dc bus voltage

2-leg shuntCurrentSensing(optional)

ADCLKAOUT

ADCONVST

ADMUX0ADMUX1ADMUX2RESSAMPLECHGO

PLL low pasfilter

BYPASSCLKBYPASSMODEPLLTESTLPVSS

PWMUNPWMULPWMVHPWMVLPWMWHPWMWLBRAKE

GATEKILLFAULTCLR

194215

OptionalCurrent sense

IRMCK203 Detailed Block Diagram (IR)

RE232CRS422

interface

SPIslave

interface

Paralle linterface

Hostregisterinterface

Configurationregisters

Monitoringregisters

+minus PI PI

PI

+minus

+

++

minus

+ +

ejθ

IQ

ID

ID scale 4096

IQ scale 40960

4096Slip gain

StartStop

DirFLTCLR

SYNGFault

PWM active

RCVSNDRTSCTS

SCKSDOSDICS

DataAddress

control

17

Sequencecontrol

INT_REFReference

select

Accel rateDecelrate

IQLIM-IQLIM+

SPDKISPDKP

INT_VQVelo cityControlenabl e

IDREF

IQREF

REF scale4096

-VQLIMVQLIM

CURKICURKP

VQ

VD VDS

VQS

INT_VDVD enable-VDLIMVDLIM

FeedforwardPath enable

Slip gainenable

ejθ 23

IV

IW

+-16383=+-4X of rated current for IQ+-4095=+-rated ID for IM field flux

INT_DAC1INT_DAC2INT_DAC3INT_DAC4

DAC_PWM1DAC_PWM2DAC_PWM3DAC_PWM4

3

3

6

2Closed loop current controlUpdate rate = PWM carrier frequency x1 or x2

Closed loop velocity control sequencing controlUpdate rate = PWM carrier frequency 2

RAMP

+-16383=+-max_speedEXT_REF

2

Dtime2PenPWMmodePWMen

Angl e scale maxEnc CountSpd Sca le Init zval

BRAKE

Gatesignals

Fault

EncoderABZEncoder

Hall ABC

8 channelSerialAD

interface

MUX

DATACLK

CNVST

M otorPhase

Current VM otor

PhaseCurrent W

ZpolinitZEnc type

CurrentOffset W

CurrentOffset V

OptionalCurrent sense

ADS7818AD

Interface

DC bus dynamicBrake control

Space VectorPWM

Deadtime

Quadraturedecoding

IR2175interface

IR2175interface

4chDAC module

intdt

DCV_FDBK

GSerseUGSerseL

modscl

01312

1113

1211times

111312

013

1211 times

11013

1211 times

12 13

11013

1211 times

1213

195215

IR Digital Motor Control Chip ArchitectureMicro Co mputer Unit (M CU) amp Moto r Control Engine (M CE)

196215

MCU Interface with PWM Power Converters

197215

IRMCF311 Dual Chann el Senso rless Moto r Control IC fo r Appliances

AC input(100-230V)

IRMCF311

DC bus

communicationto indoor unit

motor PWM +PFC+GF

IRS2630D

Temp sensemotor PWM

IRS2631D

IPM

SPM

60-100WFan motor

Compressormotor

IGBT inverter

FREDFET inverter

multiplepowersupply

passiveEMIfilter

Galvanicisolation

fieldservice

Galvanicisolation

EEPROM

EEPROM

Analog inputAnalog output

Digital IO

temperatur e feedback

analog actuators

relay valves switches15V33V18V

fault

fault

serial comm

198215

Design and Realization Issues in Digital Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 34: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

34

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

199215

Problems in Digital Control Systems

Quantization Error

Micr oprocessorDSPASIC

FPGA SOPC

DelayTime

Sampl ingTime

SensorResolution

FiniteWord Length

Delay Timedue to

Detection

200215

Problems in Digital Control Systems

High Sampling Rate Lower senso r signal resolutionIncrease quantiz ation errorBring in system st ability problems

Low Sampling Rate

It is recommended to use simulation techniques to determine the optimal sampling rate for a specific application

Cau se ti me del ayResult poor syst em stability

201215

Task States of a Real-Time Operating System

WAITING

ISRRUNNINGREADYDORMANT

202215

Motor Control Running Tasks and RTOS

REVERSEM OTGEN

POWER89

REVERSEM OTGEN

TORQ UE45 SHUT

DOWN10

FORWAR DM OTGEN

POWER67

FORWAR DM OTGEN

TORQ UE23

STARTNEURAL

1

F 8

S8

F 9

S9

F 6 S6

F 7S7

F 1

S1 F 3

S3

F 2

S2

F 5 S5

F 4 S4Tas k 1

Rese t RTOS Shut dow n

Tas k 2 Tas k 3 Tas k 4

Idle tim e

Powe r u p T1clock PB

T1 T2 T3 T4

RTOS Real-Time Operating System

203215

Timing Analysis of a Digital Motor Controller

10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8Timer ISRProcessing

XINT ISRProcessing

BackgroundProcessing

TotalProcessing

current control amp PWM signal generation

vector control amp veloci ty control amp position control

visual output amp RS-232 commutation

100us

1ms

timer 3 period interrupts

204215

808-PowerLab Research on Digital Motor Control

電力電子系統與晶片設計實驗室

Power El ectro nic Sys tems amp C hips Lab交通大學 bull電機與控制工程研究所

Power Electronic Systems amp Chips Lab NCTU Taiwan

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 35: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

35

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

205215

Experimental Platform for the DSP Induction DriveA Single-Chip DSP (320C14) Based Digital Induction Drive

206215

Experimental Platform for a General Purpose DSP Drive

207215

TMS320F240全數位式伺服驅動器交通大學電力電子實驗室 (PEMCLAB)

208215

Adaptive Control of an Induction Motor

Load TorqueEstimation

RSTransform

ModelEstimation

ControllerParameterAdaptation

SpeedController

u v w

+ InductionMotor

Encoder

InterfaceProcess

ADConverter

PulseCounterRS-232C

θe

220V60Hz

Converter

PC Host

PWM InverterPower Stage

SPWM SignalGeneration

CurrentControllers

iqs

Dual-DSP-based adaptive speed controller

Rotor FluxCalculation

Filtering

iqs

$ $a a1 2

$ $b b1 2

r s s s t t t 0 1 2 0 1 2

$TL

ids

iqs

FeedforwardCompensation 32

Transform

SpeedDetectionamp Filtering

vα v β

ias ics

CurrentsDetection

Prefilters

i iα β

θm

ω m

ω m ω m

TMS 320C52 TMS 320C14

209215

Speed Performance as Load Inertia Sudden Change

06 08 1 12 14 16 18-10

0

10

20

Rads

06 08 1 12 14 16 18-10

0

10

20

Rads

Time sec

without adaptationwith adaptat ion

06 08 1 12 14 16 18-1

-05

0

05

1

Time sec

$a 1

$a 2

$b1

$b 2

ωm

200640 mKgJ sdot= suddenly added

210215

Adaptive of Speed Regulation under Load Variations

No loadJ L = sdot0 00 3 6 2 K g m

J L = sdot0 0 06 4 2 Kg m

without adaptation

12 14 16 18-10

0

10

20

30

40Rads

Time sec

ωm

Time sec12 14 16 18

-5

0

5

10

15

20

25

30

35Rads ω m

with adaptation

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習

Page 36: 數位交流驅動控制器之設計與實現pemclab.cn.nctu.edu.tw/W3news/技術專欄/2007-09-12... · 2007-09-26 · Block Diagram of a Typical Digital Motor Controller DSP Solution

36

課程講義【電動機】06【1】DSP交流驅動控制器之設計與實現

交通大學 808-電力電子實驗室 Sept 2007

台灣新竹交通大學電機與控制工程研究所808實驗室

電源系統與晶片數位電源馬達控制驅動晶片D SPF PGA控制

httppemclabcnnctuedutwLab-808 Power Elec tronic Systems amp Chips Lab NCT U Taiwan

211215

技術名稱全數位永磁交流伺服馬達控制驅動技術技術名稱(英文)Digital AC Servo Drive Control amp Drive Technique

技術簡介國內AC伺服驅動技術仍以類比或半數位為主

國內馬達驅動器普遍尚未採用ASIC本技術利用單晶片DSP(TMS320F2407A)及ASIC完成永磁弦波型AC伺服馬達之控制驅動技術採數位電流控制模式以ASIC產生數位式SVPWM脈寬調變使電流迴路頻寬提高至1k Hz以上

技術規格DSP-Based全數位式驅動控制軔體

以ASIC將數位電路縮裝

電流迴路取樣時間50μs速度迴路取樣時間為1ms可輸入類比之轉速轉矩命令

可輸入脈衝式之位置命令(包括CCW CWPULSE DIRΦAΦB)

212215

技術說明

技術特色採用全數位架構內部信號處理時無漂移之虞

系統調整或參數修改較容易毋需更換零件

容易搭配不同的馬達或編碼器

因使用ASIC減少控制板的元件數目提高系統可靠度

技術競爭力國產自動化產業機械需求量大國產品可提供迅速之技術服務

全數位化之設計可降低量產成本

技術發展與突破之重點使用DSP以向量控制達到轉矩快速響應之目的

全數位化之設計並配合ASIC可提供產品規劃彈性及保密性

213215

技術說明

應用範圍CNC工具機

自動化產業機械(放電加工機電子設備機械包裝機械木工機械)高效率家電

高性能電動載具

214215

技術說明

接受技術者具備基礎建議(設備)Dynometer for servo system testDSP development systemOscilloscope with DC current probes and isolation probesAC and DC Power supplies

接受技術者具備基礎建議(專業)familiar with principle of AC electric machinesfamiliar with classic control theoryfamiliar with DSP hardware and softwarefamiliar with digital and analog circuit design

215215

訓練課程 DSP數位馬達控制

馬達驅動技術的發展現況與趨勢

伺服系統設計基礎

永磁交流伺服馬達

磁場導向控制

數位控制理論

PWM換流器數位電流控制器之設計

數位式伺服控制器之設計

DSP (TMS320F2407A) 硬體設計

DSP (TMS320F2407A) 韌體設計

DMCK-2407A DSP數位伺服馬達控制實習