Acdrive App Note 1104

17
Application Notes Squirrel Cage Induction Motor Control with DS1104 R&D Controller Board Document Version 2.1 June 2002

Transcript of Acdrive App Note 1104

Page 1: Acdrive App Note 1104

Application Notes

Squirrel Cage Induction Motor Control with DS1104

R&D Controller Board

Document Version 2.1 June 2002

Page 2: Acdrive App Note 1104

1

dSPACE Application Notes

1

Table of Contents

INTRODUCTION 2

INDUCTION MOTOR TEST BENCH 2

FIELD ORIENTED CONTROL 3

Controller Equations and Parameters 6

Implementation in the Flux Weaking Region 8

Pulse Width Modulation (PWM) 9

Initialization and Output of ua, ub and uc 12

CONTROLLER DESIGN WITH SIMULINK 12

The Control Layers 12

The Measurement 13

The PWM Interface 13

EXTENSION OF THE FUNCTIONALITY 14

Flux Weaking Control 14

Speed Limits 15

THE DEMO DOCUMENTS 16

Page 3: Acdrive App Note 1104

2

dSPACE Application Notes

2

Introduction

Electrical drives play an important role as electromechanical energy converters in transportation and most production processes. During the last few years the field of controlled electrical drives has experienced rapid expansion mainly caused by the advances of semiconductors in the form of power electronics as well as digital signal and analog electronics for microelectronics and microprocessors. Electronically switched solid-state power converters have renewed the controlling of AC-motor drives not subject to the limitations of the mechanical commutator of DC drives.

These application notes describe the implementation of a field-oriented control for a squirrel cage induction motor. The control structure is programmed as a Simulink graphical model and can be implemented by Real-Time Interface (RTI) on the DS1104 R&D Controller Board.

The induction motor control is implemented in three tasks containing the I/O and the two control layers. The measure task is directly triggered by the PWM interrupt of the TMS320F240. This closely connects the task cycles of the TMS320F240 and PowerPC 603e to avoid jitter. It works at a PWM frequency of 16kHz and generates a synchronous software interrupt with 8kHz. This interrupt is used to trigger the superior current control task. The subordinated speed controller works in a third task and is triggered by the timer interrupt of the PowerPC, which occurs with a frequency of 4kHz.

Induction Motor Test Bench

The control test bench is shown in Figure 1. It consists of a host computer PC, the DS1104 R&D controller board, the PWM inverter and the squirrel cage induction motor.

Figure 1: Squirrel cage induction motor control experimental setup

Host PC

DS1104 R&DController Board

FrequencyConverter

PowerSupply

3

Input VoltageInput

Frequency

PWM Signals

3

Motor Position Information

i b

i a

3~3

2

Current Information

8

Page 4: Acdrive App Note 1104

3

dSPACE Application Notes

3

Two inductive sensors are implemented to fetch the necessary current information. To avoid noise the measured voltages are filtered by two low pass chebyschev filters with a cutoff frequency of about 5kHz. For the squirrel cage motor control two 16-bit A/D converters and one incremental encoder channel of the DS1104 are needed. Furthermore, the DSP TMS320F240 is used to provide the duty cycles for the frequency converter.

Field-Oriented Control

This chapter describes the basics of the implemented control scheme. The control algorithms are derived from the block structure of an induction machine in rotor-flux frame, shown in Figure 2.

KL

1/K K / KR L R

LH / LR

3 /2 LH /LRp

KR L/1 K /KR

L H R

LH TR

J

/ T

m

mL

e

ωm

FRω

ωFSLR( )

KL

- -

εFS

uSa

uSd

uSb

uSc

SquΨRd

iSq

iSd ΨRd

p

1

ωRS

ωRS

a,b,c

d,q

-

Numerator

Denominator

1

LH / TR

The motor dynamics are described by the following space vector differential equations:

RdRSR

HSdLFSSq

SqLSqR

RdRR

HSqLFSSd

SdLSdR

LL

iKudtdi

KiK

TLL

iKudtdi

KiK

Ψ+−=+

Ψ++=+

ωω

ω

Figure 2: Block diagram of a squirrel cage induction motor

Page 5: Acdrive App Note 1104

4

dSPACE Application Notes

4

∫=+=

Ψ=

Ψ=

−=

=

dt

TiL

iLLpm

mmdtdJ

RLT

iLdtdT

FSFS

RSFRFS

RdR

SqHFR

RdSqR

He

Lem

R

RR

SdHRd

RRd

ωε

ωωω

ω

ω

23

The torque of the motor me is proportional to the product of ΨRd and iSq, see the lower part of Figure 2. The rotor-flux ΨRd changes slowly compared to iSq and iSd, since the time constant TR is much greater than:

>>

R

L

R

L

KK

KK

RT ,

For this reason it makes sense to control the torque via iSq, with the q-current controller (q-CC), see Figure 3. Furthermore, it is required that the machine has a constant magnetic operating point, which is provided by the flux controller (FC) with a set-point.

To realize this control structure it is necessary to transform the phase currents into d- and q-currents. The block diagram of the motor (Figure 2) shows that the d- and q-currents are coupled, so it is necessary to implement a decoupling network (D) to make them independent of each other. The transformation, which calculates the d- and q-currents from the measured phase currents, is given by the following equations:

=

−−=

β

α

β

α

εεεε

S

S

FSFS

FSFS

Sq

Sd

Sc

Sb

Sa

S

S

ii

ii

iii

ii

cossinsincos

23

230

21

211

32

Page 6: Acdrive App Note 1104

5

dSPACE Application Notes

5

The controller outputs uSd* and uSq

* must be transformed to phase voltages and connected to motor inputs uSa, uSb and uSc. This transformation is given by a matrix multiplication to transform the outputs in the rotating α,β-frame and the space-vector modulation to transform the α,β-voltages to phase voltages. The space-vector modulation is used to exploit the DC-link voltage better.

( )

−=

−=

*

*

*

*

*

*

*

*

*

modulationvector space

cossinsincos

β

α

β

α

εεεε

S

S

Sc

Sb

Sa

Sq

Sd

FSFS

FSFS

S

S

uu

uuu

uu

uu

Figure 3 shows the complete control structure. The transformation blocks are marked with dashed-lined boxes.

iSd*

ΨRd

ωRS

--

-

-

-

D

q-CC

d-CC

VC

-

Flux-Model

+

RSε

RSεωFR

uSq*

uSd*

uSα*

uSβ*

iSq

εFS

ω

iSd

iSα

iSβ

α,β

a,b,c

a,b,c

α,β

iSb

i

iSc

ASM

IG

uSa*

uSc*

uSb*zazb

zcPWM

ωRS*

ωRS

iSq*d,q-frame to phase

phase to d,q-frame

ΨRd-

FC

ΨRd*

uSa

uSbuSc

UD

ejεFS

e-jεFS

Sa

To decouple both currents and compensate the induced voltage in the q-current path (see lower left part of Figure 2), the necessary compensation voltages are reconstructed using the available measurements. These voltages and the output of both current controllers are added to determine the output quantities uSd

* and uSq

*. Figure 4 shows the decoupling network and both current controllers. The decoupling and the compensation section are marked with dashed-lined boxes.

Figure 3: Control structure for the induction motor

Page 7: Acdrive App Note 1104

6

dSPACE Application Notes

6

- -

++

-

ΨRd

d-CC

q-CC

K L

LH LR/

current decoupling

compensation of induced voltage

iSd*

iSd

iSq

iSq*

uSd*

Sq*u

ωRS

ωFR ωFS

As shown above, the decoupling network needs the rotor-flux ΨRd, the slip-frequency ωFR and the electrical rotor velocity ωRS. While ωRS can be measured the other two variables are estimated using a flux-model (Figure 5), which is based on the motor model shown in Figure 2. The flux model is also used to estimate the angle εFS needed for the frame transformations (see Figure 3). Since it is based on the current measurement, Figure 5 is the current version of the flux model.

1

NumeratorDenominator

ωFR

iSαiSβ

iSd

iSq

LH TR

LH TR/

εFR εFS

ΨRd

εRS

ωFR

εFS

e-jεFS

Controller Equations and Parameters

To implement the current controllers only the q-current controller is used to describe the system and calculate the parameters, since iq controls the motor torque. The current control loop is shown in Figure 6. For the sake of clarity, the decoupling part is omitted.

Figure 4: Decoupling network and current controller

Figure 5: The flux model

Page 8: Acdrive App Note 1104

7

dSPACE Application Notes

7

iSq* iSq

-

KRi TRiTTi1 RS

1RS

LS

The AC drive is described in the first order lag GSi(s) with:

G s RLRs

SiS

S

S

( ) =+

1

1

The delay time TTi is determined by the delay times of the digital control and the PWM inverter:

T T TTi ctrl

PWM= +2

Hence the open loop transfer function is described by the equation:

G s K T sT s

e G soi RiRi

Ri

s TSi

Ti( ) ( )=+ −1

Both current controllers are dimensioned with the magnitude optimum method, according to a phase reserve of 63°. The controller parameters are:

T LR

K T RT

ciS

S

cici S

Ti

=

=2

Figure 7 shows the velocity control structure. This structure is based on the symmetric optimum. So a further first order lag to delay the reference input νM

∗ is necessary. In addition, the actual velocity input is FIR-filtered to avoid jitter effects of the incremental encoder. In the block structure the behavior of the FIR-filter is approximated by a first order lag.

νΜ

-

Kcν Tcν Tdν1 JKM

Gi(s)νΜ*

Tfν

1.2 Tcν1

Figure 6: Current controller structure

Figure 7: Velocity controller structure

Page 9: Acdrive App Note 1104

8

dSPACE Application Notes

8

The integrator block describes the mechanical dynamics of the motor.

( )νMM

qKJ

i t dt= ∫

The delay time Tdν is determined by the delay time of the digital velocity control: T Td ctrlν ν= . The open velocity controller loop is given by:

( )G K sTsT

G s KJe

sTo cc

ci

M s T

f

cν ν

ν

ν ν

ν=+

⋅ ⋅ ⋅+

−1 11

The transfer function Gi(s) and the exponential term can be approximated by first order lags with the time-constants T and Tdν. According to the symmetric optimum, the small time constants can be combined to Tsubν. With these simplifications the controller parameters can be determined with the following equations achieved by field-oriented control.

( )

T T

K JT T T K

c i

cd i f M

ν

νν ν

= ⋅

=⋅ + + ⋅

4

2

Implementation in the Flux-Weaking Region

At higher speed, saturation of the current controller occurs when the terminal voltages of the motor approach the ceiling voltage of the inverter. The maximal available stator voltage is determined by the DC link voltage, and can be expressed as:

U u u US Sd Sq Dmax = + = ⋅2 2 13

In the lower part of Figure 2 it can be seen that uSq has to be higher than the back EMF of the AC motor to produce a torque. The back EMF can be determined with the equation:

u LLe m f

R H

RRdR

RS. . = Ψ ω

Since the back EMF is proportional to the rotor flux and the flux ΨRd, in the rotor frame, the coordinates have to be reduced at high speed. This can be done with a look-up table. As long as the current rotor velocity ωRS is under the nominal velocity ωRSnom, the flux reference value ΨRd is the constant nominal flux ΨRdnom. And if the velocity is higher than the nominal velocity the reference flux is weak. This is done with the following equation:

Page 10: Acdrive App Note 1104

9

dSPACE Application Notes

9

Ψ ΨRd RdnomRSnom

RS

* * min( , )= ⋅ 1 ωω

For safe operational behavior the stator voltage vector US has to be limited according to the operating point of the AC motor. If the motor is in generating working order, for example, after a speed reversal, US has to be limited with q-priority and otherwise with d-priority. The modified controller structure is shown in Figure 8.

iSd*

-

-

-

D

q-CC

d-CC

VC

Squ*

uSd*

iSqiSd

*

ωRS

iSq*

ΨRd

-FC

ΨRd*

ωRS

ωRS

limitqiωRS

Pulse Width Modulation (PWM)

The generation of the three-phase sinusoidal output voltages ua through uc of the frequency converter is based on the PWM. At first the area of the rotating space vector has to be detected and the space vector has to be projected on the neighboring left and right space vectors to determine the values dleft and dright. This is shown in Figure 9.

dright

dleft1

2

3

4

5

6

With the determined values for the sectors dleft and dright, the Space Vector Modulation of the TMS320F240 can be used for PWM generation, just as it is possible to use the TMS320F240 for PWM generation with duty cycles. Then the output signals PWMa through

Figure 8: Control structure of the flux-weaking region

Figure 9: Space vector modulation

Page 11: Acdrive App Note 1104

10

dSPACE Application Notes

10

PWMc are low at the beginning and end of each sampling period and high in the middle. The order in which the signals become high depends on the duty cycles calculated by the neighboring space vectors. The duty cycles za through zc result from the values dleft and dright normalized with the maximum output voltage (UD / 3 ) and the PWM inverter period TPWM. Figure 10 shows this context for a voltage space vector in the first sector. Tpwm denotes the inverter period.

Figure 10: PWM inverter duty cycle arrangement

PWM a

PWM c

PWM b

Tpwm

Tpwm2

d 0 4

zaTPWM

zbTPWM

zcTPWM

d r2

dl2

d02

d04

dr2

dl2

Page 12: Acdrive App Note 1104

11

dSPACE Application Notes

11

The values of dl, dr and d0 can be determined with the following equations:

d dU

T

d dU

T

d T d d

l leftD

PWM

r rightD

PWM

PWM l r

=

=

= − −

3

3

0

Figure 11 shows the ceiling phase voltages ua, ub and uc generated by the duty cycle PWM of the TMS320F240. The resulting line voltages uab , ubc and uca. are shown in Figure 12.

The calculated duty cycles za through zc are in the range of 0 to 1 since the PWM calculation routine, which can also be used for the subharmonic pulse width modulation, needs input values between -1 and 1.

Figure 11: The phase voltages ua through uc

Figure 12: The line voltages uab through uca

0 0.005 0.01 0.015 0.02-150

-100

-50

0

50

100

150

t/[s]

ua/[V]

ub/[V]

uc/[V]

0 0.005 0.01 0.015 0.02-300

-200

-100

0

100

200

300

t/[s]

uab/[V]

ubc/[V]

uca/[V]

Page 13: Acdrive App Note 1104

12

dSPACE Application Notes

12

Initialization and Output of ua, ub and uc

The information is passed independently of the PWM type through the TMS320F240 DSP microcontroller. This DSP converts the duty cycles and space vector information into corresponding digital signals. The type of PWM generation is selected by the RTI block that is used. An S-function is used for the essential calculations and provides both the sector/time information as well as the duty cycles.

Controller Design with Simulink

The AC drive control introduced in the previous chapter is realized in SIMULINK, dSPACE's Real-Time Interface (RTI) and the Real-Time Workshop (RTW). The control parameters are initialized with their default values via the M-file go.m. The controller is realized as much as possible with SIMULINK and RTI standard units.

The Control Layers

The induction motor control is implemented in two control layers: a superior current control and a subordinated speed control. A software interrupt generated at the middle of each second PWM period is used to trigger the current controller. The speed controller is triggered by the timer interrupt of the PowerPC, which occurs with a frequency of 4kHz.

This is essential for the reference signal generator, which must be timer triggered to get the required absolute time reference. Now the requirement of several discrete sample rates can no longer be met by SIMULINK functions positioned in interrupt-triggered subsystems. Therefore any discrete units placed inside such systems must inherit their sample time.

Figure 13: Simulation control via interrupts

Page 14: Acdrive App Note 1104

13

dSPACE Application Notes

13

The Measurement

The actual values required for control are fetched inside a separate task. To make sure that the current is not measured at a PWM edge it is triggered by the PWM interrupt occurring at the center of each period. Beside the ADC channels used to measure the current reflecting voltage, an encoder interface is positioned inside the measure subsystem. It is used to obtain the necessary speed and position information of the drive. The encoder delta position is first scaled to encoder tics, and then to angle (rad) and velocity (rpm). The derived speed signal is filtered by a discrete PT1 block at a cut-off frequency of 1/3 fPWM.

Furthermore, the software interrupt for the current controller is generated inside the measure subsystem.

The PWM Interface

The implementation for PWM is split into two parts. The source values are rotating vectors supplied by the control layers. An S-function called svecmod_duty.c transforms them into duty cycles just as into sector and times needed for the space vector PWM of the TMS320F240. Hence it is feasible to use both kinds of PWM generation supported by RTI. The following figure shows the S-function with an RTI block.

Figure 14: Encoder Interface

Figure 15: PWM Interface to the DS1104 Slave CPU

Page 15: Acdrive App Note 1104

14

dSPACE Application Notes

14

Extension of the Functionality

Flux Weaking Control

A flux weaking region as described on page 8 is implemented. It is optional and can be activated by a switch as shown in Figure 16.

By setting switch_weakflux accordingly, either the normal control or an extended control including flux weaking is available. The flux weaking control is discretized at a sample time of 250 µs and is therefore included in the speed/flux subsystem (see Figure 17). It is comprised of a nonlinear function and a PI compensator. The nonlinear function supplies a constant reference flux of psi_ref for speeds below speed_ref and a flux decreasing at a rate of 1/n beyond (see Figure 18).

Figure 16: Flux weaking as an additional feature

Figure 17: Flux weaking control

Page 16: Acdrive App Note 1104

15

dSPACE Application Notes

15

Figure 18: Flux weaking implementation

Speed Limits

Due to the implemented flux weaking, higher speeds are now possible with the induction motor. For this reason, the speed limits included in the signal generator can optionally be ignored now (see Figure 19). Then arbitrary reference speeds can be selected, although the motor is not able to follow at any speed.

Figure 20 shows the ControlDesk layouts for standard control. The layout displays the turnaround times as it provides instruments for changes regarding the reference signal generator. Furthermore, a plotter shows the captured information on the speed, current and rotating vector. The “Real Speed” gauge displays the current speed information of the encoder. Its annular is split into two parts matching the multi-state LED colors of speed saturation. The proportional gain for the PI flux controller can be adjusted with slider controls. A second layout named “Measure” provides some measured data.

Figure 19: Selective bypassing of speed limits

Page 17: Acdrive App Note 1104

16

dSPACE Application Notes

16

Figure 20: Layouts for standard control

The Demo Documents

In addition to a Simulink model, the compressed demo contains a startup file for MATLAB, a ControlDesk experiment and all files necessary to run the demo without compiling beforehand. The following list describes the functionality of the demo files.

Model-specific files: go.m Startup file for MATLAB, initializes all variables

and opens the model. gain_1104x.M File for MATLAB, optimizes P-gain imctrl_1104.mdl Simulink model svecmod_duty.c S-function, transforms the rotating vector into

source signals for the PWM svecmod_duty.dll The S-function DLL, necessary for Simulink svtoduty.c Source file, contains the transformation

Application-specific files: imctrl_1104.map MAP file, maps symbolic names to physical

addresses imctrl_1104.trc Variable file, provides information on the

available variables imctrl_1104.ppc Real-time application for the R&D board

Experiment-specific files:

Imctrl.cdd Experiment description file Imctrl.cdc Experiment connection file Imctrl.cdx Experiment file Imctrl_1104.sdf System description file, defines which

application should be used Control.lay Main control layout Measure.lay Layout with measured data Imctrl_Stim.se Stimulus Sequence for test automation