Garching Control Presentation

90

Click here to load reader

description

Summary of Control System

Transcript of Garching Control Presentation

Page 1: Garching Control Presentation

Control Theory Workshop

Student Manual

Texas Instruments

v12

Page 2: Garching Control Presentation

Texas Instruments

Page 3: Garching Control Presentation

1

Control Theory Workshop

ver. 12

2

Agenda

1. Fundamental ConceptsLinear systemsTransient response classificationFrequency domain descriptions

2. Feedback ControlEffects of feedbackSteady state errorStability & bandwidth

3. Controller DesignPhase compensationRoot locus analysisTransient tuning

4. Discrete Time SystemsSampled systemsThe z-transformz plane mapping

5. Digital Control DesignPole-zero matchingNumerical approximationInvariant methodsDirect digital design

6. Digital Control Systems ImplementationSample rate selectionSample to output delayReconstructionControl law implementationAliasing

Tutorial 1.1: Linear systemsTutorial 1.2: Second order response

Tutorial 3.1: Phase lead compensator designTutorial 3.2: Buck control exampleTutorial 3.3: Root locus design exerciseTutorial 3.4: PID controller tuning

Tutorial 5.1: Matched pole-zero exampleTutorial 5.2: Discrete conversion comparison Tutorial 5.3: Direct digital design exercise

Page 4: Garching Control Presentation

3

1. Fundamental Concepts

• Linear systems

• Transient response classification

• Frequency domain descriptions

4

Linearity

)()( ufkukf • This is the homogenous property of a linear system

• For a linear system, if a scale factor is applied to the input, the output is scaled by the same amount.

)()()( 2121 ufufuuf • The additive property of a linear system is

Page 5: Garching Control Presentation

5

Terminology of Linear Systems

• A system is causal if its present output depends only on past and present values of its input

• Homogenous and additive properties combine to form the principle of superposition, which all linear systems obey

ubdt

dub

dt

udb

dt

udbya

dt

dya

dt

yda

dt

yda

m

m

mm

m

mn

n

nn

n

n 011

1

1011

1

1 ......

• The ordinary differential equation with constants a0, a1,...,an and b0, b1,...,bm ...

• If none of the coefficients depend explicitly on time, the equation is said to be time invariant. This type of equation can be used to describe the dynamic behaviour of a linear time-invariant (LTI) system

...is termed a constant coefficient differential equation

)()()( 22112211 ufkufkukukf

6

Convolution

0

)()()( dtguty

• If the impulse response g(t) of a system is known, it’s output y(t) arising from any input u(t) can be computed using a convolution integral

• The impulse response of an LTI system is it’s output when subjected to an impulse function, (t)

m

ii

i

i

n

ii

i

i dt

udb

dt

yda

00

Page 6: Garching Control Presentation

7

The Laplace Transform

...where s is an arbitrary complex variable

If f(t) is a real function of time defined for all t > 0, the Laplace transform is defined as...

dtetftfsF st

0

)()()( L

)()()()( 22112211 sFksFktfktfk L• Linearity

)()()()( 210 21 sFsFdtfft

L• Convolution

)(lim)(lim0

sFstfst

• Final value theorem

• Shifting theorem )()( sFeTtf sTL

• The Laplace transform is a convenient method for solving differential equations

8

Poles & Zeros

ubdt

dub

dt

udbya

dt

dya

dt

yda

m

m

mn

n

n 0101 ......

012

21

1 ...)( asasasasasA nn

nn

nn

The dynamic behaviour of the system is characterised by the two polynomials

012

21

1 ...)( bsbsbsbsbsB mm

mm

mm

)()(...)()()(...)( 0101 sUbssUbsUsbsYassYasYsa mm

nn

For zero initial conditions, the CCDE can be written in Laplace form...

)(...)(... 0101 sUbsbsbsYasasa mm

nn

• The roots of B(s) are called the zeros of the system

• The roots of A(s) are called the poles of the system

Page 7: Garching Control Presentation

9

The Transfer Function

))...()((

))...()(()(

21

21

n

m

pspsps

zszszsksG

012

21

1

012

21

1

...

...)(

asasasasa

bsbsbsbsbsG

nn

nn

nn

mm

mm

mm

Numerator & denominator can be factorised to express the transfer function in terms of poles & zeros

Tutorial 1.1

)(

)(

sA

sBThe ratio is called the transfer function of the system

• The quantity n – m is called the pole excess of the system

• For a system to be physically realizable it must satisfy the constraint m ≤ n

10

Classical First & Second Order Systems

n

n

pspspssY

...)(

2

2

1

1

tpn

tptp neeety ...)( 2121

)(...

...)(

011

1

011

1 sUasasasa

bsbsbsbsY

nn

nn

mm

mm

The nth order transfer function gives rise to n roots through partial fraction expansion.

Roots may be either real or appear as complex conjugate pairs. Hence both first and second order terms can be present. This motivates the study of “classical” systems of first and second order.

The time response will be dominated by those roots with the smallest absolute real part.

Page 8: Garching Control Presentation

11

First Order Systems

)()()( tutyty

1

1

)(

)(

ssU

sY

)()()( sUsYsYs

The dynamics of a classical first order system are given by the differential equation

Taking Laplace transforms and re-arranging to find the transfer function

The output y(t) for any input u(t) can be found using the method of Laplace transforms

1

1)()( 1

ssUty L

...where is the time constant of the system

The response following a unit step input is t

ety

1)(

12

First Order Unit Step Response

• The output reaches ~63% of the final value after seconds

• The output y(t) is within 2% of the final value for t > 4

• A tangent to the y(t) curve at time t = 0 always meets the final value line seconds later

• The output reaches 50% of the final value after ~0.7 seconds

0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

t

y(t)

0.63

0.98

0.7

y(t) = 1 – e-t

Page 9: Garching Control Presentation

13

Time Constant

• The time taken to reach a given output is t = -ln (1 – y(t) )

• The 10% to 90% rise time is given by tr = t2 – t1

• The rise time for any first order system is approximately 2.2

14

Second Order Systems

)()()(

2)( 22

2

2

tutydt

tdy

dt

tydnnn

• Linear constant coefficient second-order differential equations of the form

are important because they can often be used to approximate high order systems

02 22 nnss

...from which we get the characteristic equation...

is called the damping ratio

n is called the un-damped natural frequency

• Performance is defined by two quantities:

22

2

2)(

)(

nn

n

sssU

sY

• The Laplace transform of this second order system is

Page 10: Garching Control Presentation

15

Damping Ratio

t

y(t)

1

0

Unit step response of second order system with varying damping ratio

• The second order step response can exhibit simple exponential decay, or over-shoot and oscillation, depending on value of the damping ratio

• The ability to represent both types of response means higher order systems can sometimes be approximated using a second order model based on the dominant poles

21.875 1.751.625 1.51.375 1.251.125 10.875 0.750.625 0.50.375 0.25

16

Second Order Systems

• The poles of the second-order linear system are the solutions of the characteristic equation

12 nns

02 22 nnss

• Four cases of practical interest can be identified, according to the value of

1. ( > 1 ) two real, un-equal negative roots at

2. ( = 1 ) two real, equal negative roots at

3. ( 0 < < 1 ) a pair of complex conjugate roots at

12 nns

ns

21 nn js

4. ( = 0 ) two imaginary roots at njs

Page 11: Garching Control Presentation

17

Classification of Second Order Systems

21 nn js

over-damped

10

1

1

0

ns

12 nns

njs

under-damped

critically damped

un-damped

1

2

3

4

Damping ratio Roots Classification

18

The Under-Damped Response

• In the under-damped case (0 < < 1) we have two complex conjugate roots at

21 nn js

21 nd

1

d is the damped natural frequency of the system:

is the time constant of the system:

djs • Real and imaginary parts are denoted

• The under-damped step response will be of the form

)sin(1

1)(2

te

ty d

t

1cos...where

Page 12: Garching Control Presentation

19

Transient Response Decay Envelope

The unit step response of an under-damped second order system is shown below. The transient part consists of a phase shifted sinusoid constrained within an exponential decay envelope.

• Decay rate is determined by the time constant of the system ()

• Settling time is determined by the time taken by the envelope to decay to a given error band ()

20

Under-Damped Unit Step Response

)sin(1

1)(2

te

ty d

t

nrt

5.28.0

21ln st

The unit step response for the second order case with 0 < < 1 is

• An approximation for rise time is

• Settling time is given by

d

d2

d3

Page 13: Garching Control Presentation

21

Transient Response Peaks

)sin(1

1)(2

te

ty d

t

The unit step response of the classical second order system is given by

To find the peaks and troughs, differentiate with respect to time and equate the result to zero.

0)(cos1

)(sin1

)(22

te

te

ty dd

t

d

t

)(cos1)(sin 2 tt dd

21)(tan

td

211 1

tantan d

)tan()(tan td

The RHS of this equation is recognisable from

ntd d

nt

orSo the peaks & troughs occur when ...for integer n > 0

22

Second Order Step Response

)sin(1

1)(2

te

ty d

t

Tutorial 1.2

t

y(t)

1

0

21.875 1.751.625 1.51.375 1.251.125 10.875 0.750.625 0.50.375 0.25

Mp

2d

e t

d1+e

tp

Peak overshoot

Decay envelope

Damped frequency

Overshoot delay

d

Page 14: Garching Control Presentation

23

djs

Second Order Pole Interpretation

22

2

2)(

nn

n

sssG

02 22 nnss

21 nn js

For the classical second order system

...we have the characteristic equation

For 0 < < 1, we have two roots at

or

...where the parameters are:

These have physical meaning in terms of the unit step response

)sin(1

1)(2

te

ty d

t

n decay rate:

21 nddamped natural frequency:

24

Second Order Pole Interpretation

• Decay rate and damped natural frequency are the real and imaginary components of the poles

• Un-damped natural frequency and phase delay are the modulus and argument of the poles

= cos-1

j d

j d

n

n

n

21 n

Page 15: Garching Control Presentation

25

Constant Parameter Loci

• Concentric circles about the origin indicate constant un-damped natural frequency (n)

For the second order case, poles are located at

n8

1

2

3

4

5

67

n9

n10

n11

n12

n13

n8

n9

n10

n11

n12

n13

1

2

3

4

5

67

• Radial lines from the origin indicate constant damping ratio ()

21 js n

These are the usual grid lines drawn on a pole-zero map to aid in identifying transient response based on dominant pole location.

26

Pole Location vs. Step Response

Upper left quadrant of complex plane shown

Page 16: Garching Control Presentation

27

Constant Parameter Loci

• Horizontal lines indicate constant damped natural frequency (d )

For the second order case, poles are located at

• Vertical lines indicate constant decay rate ()

21 nn js

djs

• Poles located further to the left have faster decay rate

• Poles with larger imaginary component are more oscillatory

28

Example Pole Specifications

Shaded regions excluded from design because system will not meet transient requirements

Poles positioned far to the left have fast response but require large control effort

Line of constant d

Line of constant defines region of acceptable overshoot

Line of constant defined by maximum acceptable settling time

Page 17: Garching Control Presentation

29

Root Locus for Varying Damping

22

2

2)(

nn

n

sssG

Root locus for the system with fixed n as varies from 0 to infinity.

• For 0 < < 1 the locus is a semi-circle with radius n

• For = 0 both roots are imaginary

• For = 1 the roots are equal and real

• For > 1 both roots lie on the negative real axis

As →∞ one root approaches the origin while the other moves to the left along the negative real axis

These cases correspond to the transient response classifications given earlier.

30

Effect of LHP Zero

)(1

)()( tyz

tyty

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10

0.5

1

1.5

2

time (s)

)(1

)(1

)( sYsz

sYs

sY

)(1)( sGz

ssG

For a unit step input, )(1

)( sGs

sY

• The effect of adding a LHP zero is to add a scaled version of the derivative of the step response of the original system

Adding a LHP zero at s = -z to the original transfer function:

Taking inverse Laplace transforms

• Rise time is decreased and overshoot increases

Page 18: Garching Control Presentation

31

Effect of RHP Zero

1

1

stfus e

yy

RHP zeros imply inverse response behaviour in the time domain. The step response of a stable plant with n real RHP zeros will cross zero (it’s original value) at least n times

yf = final valuets = settling time = error bound = Re(z)

• For a single RHP zero, peak undershoot is bounded by the inequality

• The effect of adding an RHP zero is to increase rise time (make the response slower) and induce undershoot

32

Frequency Response

• The output y(t) is phase shifted with respect to u(t) by =

)(0

0 jGu

y

)sin()( 0 tyty

0

0

u

y

• If the steady state sinusoid u(t) = u0 sin(t + ) is applied to the linear system G(s), then the output is

• Amplitude and phase change from input to output are determined by G(s):

• The amplitude of output y(t) is modified by

)( jG

Page 19: Garching Control Presentation

33

Polar Plots

1

1)(

ssG

221

1)(

jG

)(tan)( 1 jG

01)( jG

For the simple lag system

20)(

jG

The polar plot for a first order simple lag system stays in the fourth quadrant of the s-plane

When = 0:

As

We can plot the evolution of magnitude and phase of G(j) over frequency as a vector in the complex plane. This is known as a polar plot.

34

Second Order System Polar Plot

nn

jjG

21

1)(

2

2

01)( jG

22

1)(

jGn

When = 0

When

0)( jGAs

2

1222 21

1)(

vv

jvG

21

1

2tan)(

v

vjvG

n

v

Defining ...

The polar plot of a second order system ( n-m = 2 ) enters the third quadrant of the s-plane

2

1j

For the classical second order system

Page 20: Garching Control Presentation

35

The Bode Plot

For simple transfer functions the gain and phase curves are related by a derivative

-40

-20

0

20

40

Mag

nitu

de (

dB)

10-2

10-1

100

101

102

-90

-45

0

45

90

Pha

se (

deg)

Frequency (rad/sec)

s

1

1

1

s

s

Bode plots show gain and phase on separate graphs against a common logarithmic frequency axis

36

Minimum Phase Systems

• A linear system is called minimum phase if all its poles and zeros lie in the left half of the s-plane and its response exhibits no time delay

• For minimum phase systems the phase curve is related to the rate of change of the gain curve and vice-versa.

)log(

)(log

2)(

d

jGdjG

• Non-minimum phase systems exhibit more phase lag and are therefore harder to control

2

n• If the gain curve has a constant slope n, the phase curve has constant value

Page 21: Garching Control Presentation

37

Bode Asymptotes – First Order

Bode asymptotes for the first order case

2

1

4

38

Bode Asymptotes – Second Order

Bode asymptotes for the second order case – plots shown for varying damping ratio

2

Page 22: Garching Control Presentation

39

Resonant Peak

| Y(j ) |

0

log

n

r

2

10:21 2 nr• The resonant peak occurs at frequency

212

1

rM• Resonant peak magnitude is given by

r → n as → 0The resonant peak r approaches n as damping ratio approaches zero:

40

Second Order Resonant Peak

For the classical second order system nn

n

jjG

2)(

22

2

Resonant frequency can be found by differentiating with respect to normalised frequencyn

v

0)(

dv

jvGdThe resonant peak occurs at normalised frequency

221 nr...which is at

212

1

rM

The peak value Mr can be found by substituting the normalised frequency r into the magnitude equation

...for2

10

Page 23: Garching Control Presentation

41

2. Feedback Control

• Effects of feedback

• Steady state error

• Stability & bandwidth

42

Effects of Feedback

The objective of control is to make the output of a plant precisely follow a reference input

• Change the gain or phase of the system over some desired frequency range

• Cause an unstable system to become stable

• Reduce the effects of load disturbance and noise on system performance

• Reduce the sensitivity of the system to parameter changes

When properly applied, feedback can...

• Reduce or eliminate steady state error

• Linearise a non-linear component

Page 24: Garching Control Presentation

43

Feedback System Notation

e / r = error ratio

ym / r = primary feedback ratio

r = reference input

e = error signal

u = control effort

y = output

ym = feedback

FG = forward path

H = feedback path

L = FGH = open loop

y / r = closed loop

F = controller

G = plant

44

The Loop Transfer Function

)()()( 000 rjLym

• The loop transfer function is obtained by breaking the loop at the summing point

• If a sinusoid of frequency 0 is applied at r, in the steady state the signal ym will also be a sinusoid of the same frequency 0 but it’s amplitude and phase will be modified by L(j)

• The condition necessary to sustain oscillation inside the loop is | L(j) | ≥ -1 where is the frequency at which phase lag is

L = FGH

y

r

H

GFu

ym

Page 25: Garching Control Presentation

45

Negative Feedback

Combining error and output equations gives y = FG(r – Hy)

direct

1 + loopFGH

FG

r

y

1• The closed loop transfer function is

• The open loop transfer function is L = FGH

Error equation is: e = r - Hy Output equation is: y = FGe

46

The Closed Loop Transfer Function

1

1

GDefine the transfer functions of the forward and feedback elements as F = k, 2

2

Hand

2

2

1

1

1

1

1

k

k

r

y

2121

21

k

k

r

y

The closed loop transfer function is

2

2

1

1

Page 26: Garching Control Presentation

47

Closed Loop Poles & Zeros

• Closed loop zeros comprise the zeros of the forward path and the poles of the feedback path

2121

21

k

k

r

y

• Zeros in the feedback path affect the poles of the closed loop system

021 k

• Closed loop poles are the roots of the characteristic equation 02121 k

• If any (s) have positive real parts the open loop will be unstable, but the closed loop can be stable

• Closed loop zeros are the roots of

• Poles in the feedback path appear as zeros in the closed loop system

48

Classification by Type

)(

)(

)(

)(1

1

11

ss

sk

pss

zskFGH

ln

ii

l

m

ii

A canonical feedback system with open-loop transfer function

...where l ≥ 0 and –zi and –pi are non-zero finite zeros and poles of FGH, is called a type l system.

• The type number reflects the number of integrators in the open-loop transfer function

• The steady state error will be either zero, finite or infinite, depending on the integer l

Page 27: Garching Control Presentation

49

The Steady State Condition

10

1

1

2

nlif

nlifk

nlif

ess

)(lim

11

0sLs

en

s

ss

)(1

11lim

0 sLsse

nsssns

sr1

)( The steady state error following an input is given by

If L represents a type-l system: )(

)()( 1

s

s

s

ksL

l

21

0lim

1

kse

ln

s

ss

)0(

)0(12

kk ...where

• Steady state error is zero if L contains at least n-1 integrators:

50

Error Ratio

LFGHr

e

1

1

1

1The error ratio is

• The error ratio determines loop sensitivity to disturbance and is called the sensitivity function

Two ratios play an important role in closed loop performance:

LS

1

1

Page 28: Garching Control Presentation

51

Feedback Ratio

The feedback ratio isL

L

FGH

FGH

r

ym

11

• The feedback ratio determines the reference tracking accuracy of the loop and is called the complementary sensitivity function.

L

LT

1

• Closed loop transfer function is related to T by:H

T

r

y

52

Plant Model Sensitivity

G

TS

FG

F

dG

dT

2)1(

2)1(

)1(

FG

FGFFGF

dG

dT

SGdG

TdT

/

/

For the unity feedback system, the sensitivity function can viewed in a different way.

• S is the relative sensitivity of the closed loop to relative plant model error.

If we differentiate T with respect to the plant, G...

Page 29: Garching Control Presentation

53

S + T = 1

L

LT

1LS

1

1

11

1

L

LTS

Sensitivity function is: Complementary sensitivity function is:

• The shape of L(j) means we cannot maintain a desired S or T over the entire frequency range

10-3

10-2

10-1

100

101

102

0

0.2

0.4

0.6

0.8

1

1.2

1.4

Mag

nitu

de (

abs)

Frequency (rad/sec)

|S||T|

54

Feedback with Control Disturbance

FGrGdFGHy 1

rH

TdGSy

HyrFdGy

Superposition allows the effects of output disturbance to be included in y...

Substituting S and T gives

++

+

_ yr

H

GF

d

ue

Page 30: Garching Control Presentation

55

Closed Loop Performance

H

ry

rH

TdGSy

For good disturbance rejection we want S = 0

For good reference tracking we want T = 1 )( jL

• As |L(j)| rolls off both tracking performance and disturbance rejection will deteriorate

If loop gain can be kept very high, then

• Controller design involves shaping the open loop plot L(j) to achieve the best compromise between reference tracking and disturbance rejection

++

+

_ yr

H

GF

d

ue

56

Basic Feedback Equations

y = G ( d + u )

ym = H ( n + y )

u = F ( r - ym )

x1 = r – H x3

x2 = d + F x1

x3 = n + G x2

r = x1 + H x3

d = x2 – F x1

n = x3 – G x2

The equations for the exogenous signals in terms of internal signals are:

Page 31: Garching Control Presentation

57

Basic Feedback Equations

3

2

1

10

01

01

x

x

x

G

F

H

n

d

r

nL

Hd

L

GHr

Lx

111

11

The loop equations can be written in matrix form as:

n

d

r

GFG

FHF

HGH

FGHx

x

x

1

1

1

1

1

3

2

1

If the 3x3 matrix is non-singular, the loop equation can be re-arranged to find the three internal signals

nL

FHd

Lr

L

Fx

11

1

12

nL

dL

Gr

L

FGx

1

1

113

58

Internal Stability

HSGSFSS

L

H

L

G

L

F

L 1111

1

L

FG

L

FH

L

GH

111

• External stability is a pre-requisite for internal stability

• Internal stability requires that x1, x2 & x3 do not grow without bound, so the following seven transfer functions must all be stable:

H

T

G

T

F

T

These can be written in terms of S and T :

Page 32: Garching Control Presentation

59

The Nyquist D Contour

• The Nyquist D contour encloses the RHP with small indentations to avoid any poles of L(s) on the imaginary axis and an arc at infinity

• The Nyquist D contour encloses the RHP with small indentations to avoid any poles of L(s) on the imaginary axis and an arc at infinity

60

The Nyquist Plot

• The Nyquist plot is the image of the loop transfer function L(s) when s traverses D in the clockwise direction

• If L(s)→0 as s→∞ then the portion of the D contour at infinity maps to the origin

Page 33: Garching Control Presentation

61

Closed Loop Stability

Closed loop stability can be defined in terms of either pole location or frequency response.

• The poles of the characteristic equation are determined by solving 1 + L(s) = 0

• For stability, all the system poles must lie in the open left half plane

• The root locus diagram provides an effective means of determining optimum loop gain

1) Pole location

2) Frequency response

• Plot the gain and phase of the open loop L(j) vs. frequency

• Time delays must first be approximated by rational transfer functions

• Evaluate gain and phase margins graphically to determine relative stability

• Information clearly presented on Bode or Nyquist plots

• Can represent non-minimum phase systems (but Bode relations do not apply)

62

Phase Margin

Phase margin is the angular difference between the point on the frequency response at the unit circle crossing and -180º. For a robust control system we want large positive m.

)( cjLPM• Phase Margin (PM) is defined as: ... where c is the gain crossover frequency

Page 34: Garching Control Presentation

63

Gain Margin

Gain margin is the amount of extra loop gain we would have to add for the L(j) line to reach the [-1,0] point. For a robust control system we want large positive GM.

GM

11

)(

1

jLGM • Gain Margin (GM) is defined as: ... where is the phase crossover frequency

64

Gain & Phase Margins on Bode Plot

)( cjLPM• Phase Margin (PM) is defined as: ... where c is the gain crossover frequency

)(

1

jLGM • Gain Margin (GM) is defined as: ... where is the phase crossover frequency

| L( ) |

log

L( )

c

c

1

0

0

Phase Margin

Gain Margin

1

log

Page 35: Garching Control Presentation

65

Loop Sensitivity from the Nyquist Plot

-1

L(j )

| L(j 0) |

| 1+L(j 0) |

• Estimation of S & T curves is straightforward from the Nyquist diagram

• The vectors |L(j)| and |1+L(j)| can readily be obtained from the Nyquist plot for any frequency 0

66

Conditional Stability

2

2

)1(

)6(3)(

ss

ssLBode diagram for the system with open loop transfer function

• Open loop phase lag exceeds 180 degrees at frequencies below cross-over but closed loop is stable

-10

0

10

20

30

100.1

100.3

100.5

100.7

100.9

-180

-170

-160

-150

Bode DiagramGM = -13.1 dB (at 3 rad/sec) , PM = 18.4 deg (at 5.92 rad/sec)

Frequency (rad/sec)

GM

PM

Page 36: Garching Control Presentation

67

Conditional Stability

2

2

)1(

)6(3)(

ss

ssLNyquist diagram for the system with open loop transfer function

• The plot of L(s) as s traverses the Nyquist contour does not make a clockwise encirclement of the critical point, hence the closed loop system will be stable

-1

L(j ) L(j )

• In this case, reducing the loop gain will cause instability

68

Stability Margins - Example

)5.006.0()1(

)55.01.0(38.0)(

2

2

ssss

sssL

-100

-50

0

50

Mag

nitu

de (

dB)

10-2

10-1

100

101

102

-180

-135

-90

Pha

se (

deg)

Frequency (rad/sec)

PM

• In general, the Nyquist plot provides more complete stability information than the Bode plot

Although gain and phase margins are adequate (GM infinite, PM = 70 deg.), the system has two lightly

damped modes (1 = 0.81, 2 = 0.014) causing a highly oscillatory step response.

Page 37: Garching Control Presentation

69

Stability Index

-1

L(j )

sn

SjLjLsn )(1

1max

)(1min

11

• A large value of || S ||∞ indicates L(j) comes close to the critical point and the feedback system is nearly unstable

• A better measure of relative stability is to gauge the closest L(j) passes to the critical point [-1,0]. This is called the stability index

• The reciprocal of the sensitivity index sn is the infinity norm of the sensitivity function

)(1min

jLsn

70

Sensitivity Norm - Example

10-2

10-1

100

101

0

0.5

1

1.5

2

2.5

3

3.5

4

Mag

nitu

de (

abs)

Frequency (rad/sec)

|| S ||∞

| S |

• The infinity norm of the sensitivity function shows considerable peaking, | S | >> 1, indicating that

L(j) passes close to the critical point and possible robustness issues

• Although the S infinity norm is a good measure of relative stability and robustness, is does not indicate stability in the binary sense: for example, a Nyquist plot which encloses the critical point might have a similar S response to that shown above

Page 38: Garching Control Presentation

71

Maximum Peak Criteria

)(max

jSM S )(max

jTMT

• The maximum peaks of sensitivity and complementary sensitivity are

Typical design requirements are: MS < 2 (6dB) and MT < 1.25 (2dB)

0

0.5

1

1.5

10-3

10-2

10-1

100

101

102

-360

-270

-180

-90

0

90

Frequency (rad/sec)

| S(j ) || T(j ) |

Ms

72

Bandwidth

Bandwidth is defined as the frequency range [ 2] over which control is effective: B = 1 – 2

Normally we require steady state performance, so = 0 and B = 2

• Closed loop bandwidth is defined as the frequency at which | S(j) | first crosses -3dB from below

• Gain crossover frequency c is defined as the frequency at which | L(j) | first crosses 0dB from above

10-2

10-1

100

101

102

103

0

0.2

0.4

0.6

0.8

1

1.2

1.4

Frequency (rad/sec)

cB

0.707

|S(j )|

|L(j )|

Page 39: Garching Control Presentation

73

Regions of Control Effectiveness

Bandwidth can be defined in terms of the |S(j)| crossing of -3dB from below.

• Below performance is improved by control

• Between and BT control affects response but does not improve performance

• Above BT control has no significant effect

Mag

nitu

de (

abs)

74

Nyquist Diagram: Sensitivity Function

-1

L(j )

1

Sensitivity bandwidth reached when L(j ) first

crosses this circle

Sensitivity peaking when L(j ) lies inside this circle

1

j

-j

L(j )

√2

2

1

LS

1

1

• Peaking & bandwidth properties of the sensitivity function can be inferred from the Nyquist diagram

212

1 LS• Sensitivity bandwidth reached when first crosses

11 L

from below:

• Sensitivity peaking occurs when

Page 40: Garching Control Presentation

75

Nyquist Diagram: Tracking Performance

2

1

L

LT

1LLT 21

2

1• Tracking bandwidth reached when first crosses from above:

• Tracking peaking occurs when Re{ L(j) } < -0.5

• Peaking & bandwidth of the tracking response can be inferred from the Nyquist diagram

12

1

76

Nyquist Diagram Grid Lines

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8

-1.5

-1

-0.5

0.5

1

1.50 dB

-20 dB

-10 dB

-6 dB

-4 dB

-2 dB

20 dB

10 dB

6 dB

4 dB

2 dB

• Conventional Nyquist diagram grid displays peaking of tracking response in dB

• -3 dB line corresponds to tracking bandwidth locus

Page 41: Garching Control Presentation

77

Effect of Time Delay

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

42.1174

36.1664

30.2154

24.2643

18.3133

12.3623

6.4113

0.460286

-5.49073

-11.4417

PM

)25.4()2(

6)(

2

sssesL s

Nyquist plot shows progressively larger time delay added to a stable third order system

• Time delay is equivalent to a frequency dependent phase lag which erodes phase margin.

78

RHP Zero: Additional Phase Lag

1

1)(1

ssL

1

1

1

1)(2

s

s

ssLThe above example shows Nyquist plots for the systems:

Both systems are strictly proper with pole excess of 1, but L2(j) has significantly higher phase lag due to its’ RHP zero, causing it to enter the unit circle centred at [-1,0].

L1(j )

L2(j )

1

-1

Page 42: Garching Control Presentation

79

Loopshaping Limitations

N

iipdjS

10

)Re()(ln

• If L(s) is rational and has a pole excess of at least 2, then for closed-loop stability

...where there are N RHP poles at locations pi

• For a stable loop... 0)(ln0

djS

• For a given system, any increase in bandwidth (|S| < 1 over larger frequency range) must come at the expense of a larger sensitivity peak. This is termed the waterbed effect.

Equal areas

| S(j ) |

log

Mag

nitu

de (

abs)

80

3. Controller Design

• Phase compensation

• Root locus analysis

• Transient tuning

Page 43: Garching Control Presentation

81

Loop Shaping Requirements

• |L| cannot be maintained large over the entire frequency range so compromises must be made

• Design of L(j) is most critical in the region between c and .:

– For fast response, we want large c and .

– For stability, we need | L(j) | < 1

– Phase at crossover L(jc) should be small

• For low frequency performance, L(s) must contain at least one integrator for each integrator in r

• Loop shaping means designing the shape of the L(j) gain & phase curves

• Requirements for good control are S ≈ 0 and T ≈ 1, so |L| must be large

82

Phase Compensation

• Start with gain k1 and introduce phase lead at high frequencies to achieve specified PM, GM, Mp, ...etc.

• Start with gain k2 and introduce phase lag at low frequencies to meet steady-state requirements

• Start with gain between k1 and k2 and introduce phase lag at low frequencies and lead at high frequencies (lag-lead compensation)

Three types of compensation are commonly used:

Page 44: Garching Control Presentation

83

Phase Lead Compensation

• The first order phase lead compensator has one pole and one zero, with the zero frequency lower than the pole

• The simple lead compensator transfer function is ...where (z < p )p

z

s

ssF

)(

log

log

| F(j ) |

m

F(j )

m

z p

0

0

c

84

Lead Compensator Design

cm

1

1

1sin

m

m

m

sin1

sin1

Define

• If m is known, choose c to fix p, then calculate using

...where > 1

Maximum phase occurs at frequency

cs

cssF

1

11)(

Maximum phase is

Tutorials 3.1 & 3.2

Page 45: Garching Control Presentation

85

Phase Lag Compensation

• The first order phase lag compensator has one pole and one zero, with the pole frequency lower than the zero

• The simple lag compensator transfer function is ...where (p < z )p

z

s

ssF

)(

86

Lag-Lead Compensation

))((

))(()(

21

21

pp

zz

ss

sssF

• The lag-lead compensator has two poles and two zeros arranged to induce phase lag and phase lead over different frequency ranges

• The lag-lead compensator transfer function is

• For unity gain: p1p2 = z1 z2

Page 46: Garching Control Presentation

87

2DOF Controller

rH

TFSdy r

The 2 degrees-of-freedom structure permits disturbance rejection and tracking performance to be designed independently.

The output equation is

In practice, tuning is a two stage procedure:

• First, loop shaping is performed to design S for disturbance rejection

• Then the input filter Fr is designed to achieve desired tracking response

88

Two Degrees of Freedom Controllers

+_ yr

H

GF

Fr

+

+

FGH

FFG

r

y r

1

HFFG

GF

r

y

12

1

1

FGH

FGF

r

y r

1

Parallel Feedback Compensation

Feed-Forward Control

Feed-Forward Compensation

y+_r

H

G

F2

+_F1

Page 47: Garching Control Presentation

89

Internal Model Principle

rGGy 1~ Then the output is

and setThe basis of the Internal Model Principle is to determine G~ 1~ GF

Suppose we have a model of G denoted G~

i.e. if the model if accurate, perfect control is achieved without feedback!

• Information about the plant may be inaccurate or incomplete

• The plant model may not be invertible or realisable

• Control is not robust, since any change in the process results in output error

In practice the approach has limited use, since...

90

Internal Model Control (IMC)

QH

QGF

11

• RHP zeros give rise to RHP poles – i.e. the controller will be unstable

FGH

FGQ

1

• An alternative to open loop shaping is to directly synthesize the closed loop transfer function

• time delay becomes time advance – i.e. the controller will be non-causal

• The approach is to specify a desirable closed-loop T.F. then find the corresponding controller

• In principle, any closed-loop response can be achieved providing knowledge of the plant is accurate and it is invertible

• if the plant is strictly proper, the inverse controller will be improper

• The plant G might be difficult to invert because...

• This method is known as Internal Model Control, or Q-parameterisation

Page 48: Garching Control Presentation

91

IMC – Non-Minimum Phase Plant

nm GGG

HGf

GfGGF

n

nnm

111

• Step 1: factorise G into invertible and non-invertible (i.e. non-minimum phase) parts:

q

i i

isn zs

zseG

1

...where the non-invertible part Gn is given by

• Step 2: specify the desired closed loop T.F. to include Gn: Q = f Gn

• Step 3: substitute into the controller equation:

HGf

fGF

nm

11

This is an all-pass filter with delay. Any new LHP poles in Gn can be cancelled by LHP zeros in Gm

This equation does not require inversion of Gn

92

• A root locus plot is a diagram of the closed loop pole paths in the complex plane as loop gain k is varied from 0 to infinity

Root Locus Analysis

0)()()()( 2121 sskss

• Every locus begins at a pole when k = 0, and ends either at a zero or infinity (i.e. follows an asymptote)

k → ∞

k = 0

k → ∞

k → ∞

k = ∞

• The number of asymptotes is given by the pole excess, n - m

Page 49: Garching Control Presentation

93

Angle & Magnitude Criteria

(n odd)

1FGH

kL

1

nL

Points on the root locus are given by 02121 k

i.e. all points on the root locus must satisfy the magnitude criterion:

2121 k

121

21

k

...and the angle criterion:

• When k = 0, the roots are at 12 = 0 ...i.e. at the poles of the open loop system.

• As k → ∞, the roots are at 12 = 0 ...i.e. at the zeros of the open loop system.

• For 0 < k < ∞, the roots can be found as follows...

94

• Complex conjugate poles lead to a step response which is under-damped

• If all closed loop poles are real, the step response will be over-damped

• Closed loop zeros may induce overshoot even in an over-damped system

• The response is dominated by s-plane poles closest to the imaginary axis

• When a pole and zero nearly cancel each other, the pole has little effect on overall response

Root Locus Interpretation

• Adding a pole to the forward path pushes the root loci towards the right

• Adding a LHP zero generally moves & bends the root loci towards the left

– rise time and bandwidth are inversely proportional– larger PM, GM and lower Mp improve damping

• Time domain and frequency domain specifications are loosely related:

• The further left the dominant system poles are...

– the faster the response– the greater the bandwidth

Tutorial 3.3

Page 50: Garching Control Presentation

95

Intersection of Loci Asymptotes

mn

ii

12• For large k, the root loci are asymptotes with angles given by

• Asymptotes intersect at a point on the real axis given by

real parts of the poles of L(s) - real parts of the zeros of L(s) =n - m

Typical root locus for third order system with no zeros

3

3

96

Root Loci Asymptotes by Pole Excess

3

5

1

4

2

6

Page 51: Garching Control Presentation

97

RHP Zero: High Gain InstabilityAs open loop gain increases, each root locus tend towards either an infinite asymptote or an open loop zero. i.e. for proper systems, each zero accommodates a closed loop pole at infinite gain.

• For each RHP zero one locus crosses into the RHP, so at sufficiently high gain the closed loop will become unstable

• Maximum achievable control gain (kcrit) occurs where the first closed loop pole crosses into the RHP

k → ∞

k = 0

Maximum value of kwhich gives stable response

k → ∞

k → ∞

98

PID Controllers

dt

dedttektu d

i

)(1

1)(

• PID (Proportional, Integral, Derivative) controllers enable intuitive loop tuning in the time domain, normally against a step response. Typical objectives are delay, overshoot, & settling time.

• Most common “parallel” form is

• General notes:– The proportional term k directly controls loop gain.– Integral action increases low frequency gain and reduces/eliminates steady state errors,

however this can have a de-stabilizing effect due to increased phase shift.– Derivative action introduces phase lead which improves stability and increases bandwidth. This

tends to stabilize the loop but can lead to large control movements.

• Many refinements and tuning methods exist (Ziegler-Nichols, Cohen-Coon, etc.)

dttei

)(1

dt

ded

Page 52: Garching Control Presentation

99

Transient Response Tuning

A

BD

• Overshoot (A) - typically 20%• Decay ratio (D) - typically <0.3.

• Error bound () - typically 2% of step size• Settling time (ts) - small• Rise time (tr) – small• Steady state offset - small

Transient response specifications

Tutorial 3.4

100

Quality of ResponseA performance index can be used to assess transient response quality against variation of a key parameter.

For second order systems, a damping ratio of ~0.7 gives a minimum value for IAE & ITAE, and ~0.5 for IES.

dtte

0

2)(

IES = Integral of the Error Squared

dtte

0

|)(|

IAE = Integral of the Absolute Error

ITAE = Integral of Time x Absolute Error

dttet

0

|)(|

Page 53: Garching Control Presentation

101

4. Discrete Time Systems

• Sampled systems

• The z-transform

• z plane mapping

102

The Digital Control System

+_ y(t)r(k)

H(s)

G(s)F(z)e(k) u(k)

DACu(t)

ADCb(t)b(k)

Continuous timeDiscrete time

+_

r(k)

F(z)e(k) u(k)

DAC u(t)ADCb(t)b(k)

t

b(t)

k

b(k)

k

u(k)

t

u(t)

Page 54: Garching Control Presentation

103

Sampled Systems

Tfs

1

• The sampler converts a continuous function of time y(t) into a discrete time function y(kT)

• Almost all samplers operate at a fixed rate

• The dynamic properties of the signal are changed as it passes through the sampler

• The T is implicit in notation, so for example y(k) is equivalent to y(kT)

y(t) y(k)

t

y(t)

k

y(k)

Sampler

T

1 2 3 4 5 6 700

104

Discrete Convolution

Once the impulse response f (nT) is known, the controller output u(nT) arising from any arbitrary input e(nT) can be computed using the summation

n

k

TknfkTenTu0

)]([)()(

The impulse response of a discrete system is its’ response to a single input pulse of unit amplitude at time t = 0.

• The design task is to find the f (nT) coefficients which deliver a desired output u(nT) for some e(nT)

Page 55: Garching Control Presentation

105

Discrete Convolution

T = 0: u(0) = f (0)e(0)

T = 1: u(1) = f (0)e(1) + f (1)e(0)

T = 2: u(2) = f (0)e(2) + f (1)e(1) + f (2)e(0)

T = 3: u(3) = f (0)e(3) + f (1)e(2) + f (2)e(1) + f (3)e(0)

T = n: u(3) = f (0)e(n) + f (1)e(n-1) + ... + f (n)e(0)

• Discrete convolution consists of sequence reversal, cross-multiplication, & summation

• The digital controller implements this n-term sum-of-products at each sample instant, T

k

e(k) u(k)

k

f (k)

k0 1 2 3 4 5 6 7 8 9 10 11 0 1 2 3 40 1 2 3 ... ...

Input e(k) Unit pulse response f (k) Output u(k)

F(z)e(k) u(k)

106

The Delta Function

)()()( afdttfat

ta

(t - a)

0

f (t)

• If a delta impulse is combined with a continuous signal the result is given by the screening property

• The delta function, denoted (t), represents an impulse of infinite amplitude, zero width, and unit area.

Page 56: Garching Control Presentation

107

Impulse Modulation

0

)()()(*n

nTttftf

0

)()(n

T nTtt

108

The z Transform

Applying the screening property of the delta function at each sample instant, we find

)()()(*0

nTtnTftfn

0

)()(n

nznTfzF

...)2()2()()()()0()(* TtTfTtTftfsF L

The shifting theorem allows us to take the Laplace transform of this series term-by-term...

0

)()(*n

snTenTfsF

The z transform of f(t) is found from the above series after making the substitution z = esT

Page 57: Garching Control Presentation

109

z Transforms

)(t nz

)(0

nTtn

1z

z

)(1 t 1z

z

nT 2)1( z

Tz

(unit step)

(unit ramp)

2)(nT 3

2

)1(2

)1(

z

zzT

anTe aTez

z

anTenT 2)( aT

aT

ez

Tze

nTa1 ))(1()1(

azzaz

ate1 ))(1(

)1(aT

aT

ezz

ez

nTsin 1cos2

sin2 Tzz

Tz

nTe anT sin aTaT

aT

eTezzTez

22 cos2sin

nTcos 1cos2

)cos(2

Tzz

Tzz

nTe anT cos aTaT

aT

eTezzTezz

22

2

cos2cos

f (nT) F (z) f (nT) F (z)

110

z Transform Theorems

)()()]()([ 22112211 zFazFanTfanTfa Z• Linearity:

)()()]([)( 2120

1 zFzFTknfkTfn

k

Z• Convolution of time sequences:

)()1(lim)(lim1

zFznTfzn

• Final value theorem:

)()( zFzknf kZ• Time shift:

Page 58: Garching Control Presentation

111

z Plane Poles & Zeros

))...()((

))...()(()(

21

21

n

m

pspsps

zszszsksF

The z-transform of an equivalent sampled data system can be found using a discrete transformation, which yields a transfer function in the complex variable z:

Assume we have a continuous system with the Laplace transfer function:

))...()((

))...()(()(

21

21

n

m

pzpzpz

zzzzzzkzF

• Poles & zeros in the discrete domain are in different positions compared with those in the Laplace domain

• The pole excess of the continuous and discrete representations may not be the same

• Time and frequency domain performance of the two systems will be different

112

Stability

j

-j

-1 1

a

1

az

b

ze

zu

)(

)(

1

1

)(n

i

i ineab

k u(k)

1

2 be(1)

be(2) + abe(1)3

be(3) + abe(2) + a2be(1)

be(4) + abe(3) + a2be(2) + a3be(1)

4

5

• For stability we have the constraint on the pole: | a | ≤ 1

The first order discrete time transfer function

...corresponds to the difference equation u(k + 1) = be(k) + au(k)

The evolution of the time sequence is:

n

0

Page 59: Garching Control Presentation

113

Simple z Plane Poles

Recall for continuous-time systems:

If p = + j, u(t) = et ejt, and for stability we want et to remain finite.

i.e. the pole at (s = p) must have a negative real part, and

• stable poles must lie in the left half of the s-plane

G(s) = 1

s – phas an impulse response of the form y(t) = ept

Now, in discrete systems:

Therefore, for stability |p| must be less than 1, and

• stable poles must lie within the unit circle in the z-plane

G(z) = z

z – p has a unit pulse response y(nT) involving the term pn

114

Complex z Plane Poles

))(()(

2

jj pezpez

zzG

As for continuous time systems, discrete time complex poles always exist as conjugate pairs.

The impulse response is given by

• complex poles give rise to an oscillatory response and have the same stability constraints as simple poles

njnj peApeAnTy *11)(

)()()(

*11

jj pez

A

pez

Azy

...where the residual A1 has the form aej

npnTy n cos2)(The time sequence can be written

Page 60: Garching Control Presentation

115

z Transforms of Common Signals

2)1( z

z

az

z

)1)((

)1(

zaz

azna1

na

nT

1z

z1

1][T

Waveform f (nT) z-planeF(z)

116

z Transforms of Common Signals

Waveform f (nT) z-planeF(z)

1cos2

)cos(2

aTzz

aTzz

anTsin

anTcos

1cos2

sin2 aTzz

aTz

bnTan sin 22 cos2

sin

abTazz

bTaz

Page 61: Garching Control Presentation

117

Frequency Response

*))(()(

azaz

bzzG

For the first order system magnitude and phase are found from

*00

0

0 )(aeae

beeG

TjTj

TjTj

321*)( 0000 aeaebeeG TjTjTjTj

j

-j

-1 1

0

3

1

1

b

a

a*

• The response of G(j) at frequency = 0 is evaluated by TjezzG 0)(

118

z Plane Mapping

Equivalent regions shown cross-hatched

-j

j

AB C

DE F

A

BC

DE

F

2sj

2sj

s plane z plane

Page 62: Garching Control Presentation

119

Complex Plane Mapping

1 = T

2 = ’T

r1 = e-T

r2 = eT

r3 = e-T

z = esT = e(a+jb)T = eaTejbT = rej• Points in the s-plane are mapped according to

120

The Nyquist Frequency

• The Nyquist frequency represents the highest unique frequency in the discrete time system

• Uniqueness is lost for higher continuous time frequencies after sampling

z-planes-plane

2sj

2sj

Page 63: Garching Control Presentation

121

Aliasing

• Loss of uniqueness means an infinite number of congruent strips are mapped into the unit circle

122

Pole Location vs. Step Response

Page 64: Garching Control Presentation

123

Complex Plane Grid

Lines of constant decay rate ( ) and damped natural frequency (d )

d8

123456

d9

d10

d11

d12

d13

d8

d9

d10

d11

d12

d13

d

s plane z plane

0.1 /T

0.2 /T

0.3 /T

0.4 /T0.5 /T

0.6 /T

0.7 /T

0.8 /T

0.9 /T

/T

-0.1 /T

-0.2 /T

-0.3 /T

-0.4 /T-0.5 /T

-0.6 /T

-0.7 /T

-0.8 /T

-0.9 /T

0- /T

124

Complex Plane Grid

Lines of constant damping ratio ( ) and un-damped natural frequency (n)

Page 65: Garching Control Presentation

125

Root Locus Design Constraints

• Equivalent second order loci allow regions of the complex plane to be marked out which correspond to closed loop root locations yielding acceptable transient response

126

5. Digital Control Design

• Pole-zero matching

• Numerical approximation

• Invariant methods

• Direct digital design

Page 66: Garching Control Presentation

127

Pole – Zero Matching

))()((

)()(

221

1

pspsps

zsAsF

))()((

)()1()(

321

1

1 TpTpTp

Tz

ezezez

ezzAzF

1. Transform the poles & zeros of the transfer function using z = esT

2. Map any infinite zeros to z = -1 (but maintain a pole excess of 1)

3. Match the gain of the transformed system at z = 1 to that of the original at s = 0

Tutorials 5.1 & 5.2

128

Numerical Approximation

)()()( taetautu as

asF

)(Starting with the simple controller we get the differential equation

t

dttuteatu0

)()()(The solution to the continuous equation is

An equivalent discrete time controller performs this integration in discrete time:

t

k k+1

e(t)-u(t)

1

)()()()1(k

k

dttuteakuku

Page 67: Garching Control Presentation

129

Forward Approximation Method

tk k+1

)()()()1( kukeaTkuku

aT

za

ze

zuzF

1)(

)()(

T

zs

1

The forward approximation method implies we can find the z-transform directly from the Laplace transform by making the substitution:

Approximating the unknown area using a rectangle of height a{e(k) - u(k)}...

Application of the shifting theorem and simple algebra leads to...

The forward approximation rule maps the ROC of the s plane into the region shown. The unit circle is a subset of the mapped region, so stability is not necessarily preserved under this mapping.

130

Backward Approximation Method

)1()1()()1( kukeaTkuku

aTz

za

zF

1

)(

Tz

zs

1

The backward approximation method implies we can find the z-transform directly from the Laplace transform by making the substitution:

Approximating the unknown area using a rectangle of height a{e(k+1) - u(k+1)}...

Application of the shifting theorem and simple algebra leads to...

The backward approximation rule maps the ROC of the s plane into a circle of radius 0.5 within the z plane unit circle. Pole-zero locations are very distorted under this mapping.

Page 68: Garching Control Presentation

131

Trapezoidal Approximation Method

tk k+1

)1()1()()(2

)()1( kukekukeaT

kuku

azz

T

azF

112

)(

The trapezoidal approximation method implies we can find the z-transform directly from the Laplace transform by making the substitution:

Approximating the unknown area using a trapezoid...

Application of the shifting theorem and simple algebra leads to...

Trapezoidal approximation maps the ROC of the s plane exactly into the unit circle.

1

12

z

z

Ts

This method is also known as Tustin’s method or the bi-linear transform.

132

Numerical Approximation Methods

Forward approximation

Backward approximation

Trapezoidal approximation

)()( kukeaTI

)1()1( kukeaTI

)()()1()1(2

kukekukeT

aI

T

zs

1

Tz

zs

1

1

12

z

z

Ts

-j

j

-1 1

j

-1 1

-j

j

-1 1

-j

Page 69: Garching Control Presentation

133

Step Invariant Method

2. Find the corresponding z-transform of the response

• Invariant methods emulate the response of the continuous system to a specific input

1. Determine the output of the output of the continuous time system for the selected hold input

3. Divide by the z-transform of the selected input

• Step and ramp invariant methods are also known as ZOH and FOH equivalent methods respectively

• Invariant methods capture the gain & phase characteristics of the respective hold unit

134

Direct Digital Design

• In direct design we begin by transforming the plant model into discrete form using the step invariant method. This captures the action of the ZOH element which precedes the plant.

• Standard design techniques can then be used to synthesize the controller.

• The design iterates as many times as necessary until a satisfactory controller is reached.

• Control performance with the direct method is usually significantly better than with emulation methods.

Tutorial 5.3

Page 70: Garching Control Presentation

135

6. Digital Control System Implementation

• Sample rate selection

• Sample to output delay

• Reconstruction

• Control law implementation

• Aliasing

136

Sample Rate Selection

Slow sample rate

• Reduced CPU load

• Cheaper processor

• Cheaper data converters

• Performance trade-offs required

• Larger passives components required

• Increased output ripple

• More sensitive to disturbances

• More complex & expensive anti-aliasing filters

Fast sample rate

• Increased CPU load

• More expensive processor

• More expensive data converters

• Faster transient response

• Smaller & cheaper passive components

• Reduced output ripple

• Better disturbance rejection

• Simpler & cheaper anti-aliasing filters

Page 71: Garching Control Presentation

137

Sample Rate Selection

• Acceptable results will normally be obtained for the range 4 ≤ N ≤ 10

T

tN rDefine N as the ratio of rise time to sample period:

N

tT ror

• For control systems, choice of sample rate is based on the 10% to 90% rise time of the plant

138

Sample to Output Delay

td = sample to output delay

Page 72: Garching Control Presentation

139

Phase Delay

• Delay in the time domain translates into frequency dependent phase lag in the frequency domain

• Phase lag is indistinguishable from delay in the time domain.

)()( sFtf LFrom the shifting property of the Laplace transform, if )()( sFetf s Lthen

Therefore, if F(j) = re j then e-jD F(j) = re j(-D)

140

Reconstruction

)()( kutu

Zero Order Hold (ZOH)

kTtT

kukukutu

)1()()()(

First Order Hold (FOH)

Hold functions attempt to construct a smooth continuous time signal from a discrete time sequence.

TktkT )1( To do so, the function must approximate over the interval

Page 73: Garching Control Presentation

141

Zero Order Hold

j

ejF

Tj

ZOH

1)(

The frequency response of the Zero Order Hold function can be modelled using a unit pulse

sZOH

TjF

2)(

222

2

2sin

22

2)(

Tj

Tj

TjT

j

ZOH eT

j

j

j

eeejF

2/

2sinc)( Tj

ZOH eT

TjF

This can be simplified using the exponential form of the sine function

Further simplification using the sinc function yields

This is a complex number expressed in polar form, where the angle is given by

• The Zero Order Hold contributes a frequency dependent phase lag to the loop response

142

ZOH Phase Approximation

Pha

se e

rror

(de

g)

2

T

• Comparison of phase error vs. normalised frequency for various sample rates shows the

4s

2

T holds reasonably well for approximation

Page 74: Garching Control Presentation

143

Data Converter Gain

22maxN

bb

12maxN

uu

bK ADC

1 uKDAC

• Converter gains are related to quantization limits by:

• End-to-end controller gain is KADC | F(z) | KDAC

• Quantization takes place at each continuous/discrete boundary. Resolution limits can be referred to the continuous domain by:

144

Resolution Based Limit Cycles

Dis

plac

emen

t (m

m)

Dis

plac

emen

t (m

m)

• Steady-state limit cycles may appear if the sense resolution (b) is worse than the control resolution (u)

• Limit cycle oscillation will be low amplitude & high frequency, and may not cause an issue in low bandwidth systems, or in systems with high inertia or friction. In some cases, the oscillation may even be beneficial as it introduces a “dither-like” effect.

Page 75: Garching Control Presentation

145

The Limit Cycle Condition

21 22maxmaxNN

uk

u

22maxN

bb

12maxN

uu

The “limit cycle condition” is: control resolution > sense resolution: u > b

In the steady state, control and sense quantities are related by

Control resolution is:

Sense resolution is:

This gives the inequality

kNN 221 log

maxmaxmax |)0()0(| ukuHGb

21 21

2 NN

k

• To avoid a steady-state limit cycle, control effort resolution must satisfy the inequality

146

Finding the Difference Equation

nnnn

mmmm

zzz

zzz

ze

zu

11

10

11

10

...

...

)(

)(

nn

nn

nm

nm

nmnm

zazaza

zbzbzbzb

ze

zu

1

11

1

11

110

...1

...

)(

)(

nn

nn

nm

nm

nmnm zazazazuzbzbzbzbzezu

11

11

11

110 ...)(...)()(

)()2(...)1()()1(...)1()()( 11110 nkuakuakuankebnkebmnkebmnkebku nnmm

Normalizing for the term involving the highest denominator power (a0) gives

Applying the shifting property of the z-transform term-by-term yields the difference equation

The n-pole m-zero transfer function is written

Page 76: Garching Control Presentation

147

Control Law Diagram

)()1(...)1()(...)2()1()()( 11210 nkuankuakuankebkebkebkebku nnn

The general n-pole n-zero control law can be represented in diagrammatic form as shown below...

148

2P2Z Control Law

z-1 z-1

+

z-1 z-1

+ +

-a1-a2

b0 b1 b2

e(k-2)e(k-1)e(k)

u(k-2) u(k-1)

u(k)

)2()1()2()1()()( 21210 kuakuakebkebkebku

The 2-pole 2-zero (2P2Z) control law can be represented graphically as shown below.

Page 77: Garching Control Presentation

149

Pre-Computation

)2()1()2()1()()( 21210 kuakuakebkebkebku

)1()()( 0 kvkebku )2()1()1()()( 2121 kuakuakebkebkv

Sample-to-output delay can be reduced by pre-computing that part of the control law which is already available.

Unknownat t = k-1

Can be pre-computed at t = k-1

150

Series of Constant Samples

TjTee Tj

js

sT

sincos

The sampler modifies the frequency response of a signal according to:

ss

j

je s

2sin2cos

2

Since s

T2

, this can be written

12sin2cos2

njne

s

s

n

j

When = ns ... (n integer)

• Whenever the input frequency is a multiple of the sample rate (ns), a series of constant sample values will be produced. i.e. DC is indistinguishable from any signal which is a multiple of the sample rate.

Page 78: Garching Control Presentation

151

Discrete Frequency Ambiguity

• Both f1 & f2 give rise to exactly the same set of samples. After sampling it is impossible to determine which frequency was sampled. In fact, any of an infinite number of possible sine waves could have produced these samples. This effect is known as aliasing.

152

Frequency Response of a Sampled System

k

kTttyty )()()(*

n

tjnn

k

seCkTt )(

dtekTtT

CT

T k

tjnn

s

2/

2/

)(1

The sampler is periodic so can be represented by the Fourier series

...where the Fourier coefficients are given by

dtetT

CT

T

tjnn

s

2/

2/

)(1 Only one term is within range of the integration, so

)()()( afdtattf

T

eT

CT

Tn

11 2/

2/0

We can integrate this easily using the “screening” property of the delta function

n

tjn

k

seT

kTt 1)(So, the Fourier series representing the sampler is given by

The sampled signal is given by

Page 79: Garching Control Presentation

153

Frequency Response of a Sampled System

)()()(0

sFdtetftf st

L

0

1)()(*)(* dtee

TtytysY st

n

tjn sL

n

tjns dtetyT

sY s

0

)()(1

)(*

We can now find the Laplace transform of the sampled system

n

sjnsYT

sY )(1

)(*

The integral term is the same as the Laplace transform of y(t), but with a change of complex variable

n

snjYT

jY )(1

)(*

The frequency response of the samples signal is:

Each term in the infinite summation corresponds to the response of the continuous system, shifted along the frequency axis by ±ns

n

tjn

k

seT

kTt 1

)(

154

Frequency Response of a Sampled System

Continuous Spectrum

Sampled Spectrum

Page 80: Garching Control Presentation

155

Anti-Aliasing

(dB)

c

-20 log10(2N)

s

2

0

0

2s• To prevent aliasing, we need to attenuate the input signal to less than 1 converter bit at before sampling.

Filter constraints can be relaxed if a faster sample rate is selected.

156

Suggested Design Checklist

Design controller using emulation or direct method

Select a suitable processor

Design anti-aliasing filter

Carefully select a sample rate

Account for ZOH effects

Simulate & iterate!

Evaluate sample-to-output delay

Account for data converter gains

Page 81: Garching Control Presentation

157

Review

1. Fundamental ConceptsLinear systemsTransient response classificationFrequency domain descriptions

2. Feedback ControlEffects of feedbackSteady state errorStability & bandwidth

3. Controller DesignPhase compensationRoot locus analysisTransient tuning

4. Discrete Time SystemsSampled systemsThe z-transformz plane mapping

5. Digital Control DesignPole-zero matchingNumerical approximationInvariant methodsDirect digital design

6. Digital Control Systems ImplementationSample rate selectionSample to output delayReconstructionControl law implementationAliasing

158

Suggested Reading

• J.J.DiStefano, A.R.Stubberud & I.J.Williams, Feedback & Control Systems, Schaum, 1995

• J.Doyle, B.Francis & A.Tannenbaum, Feedback Control Theory, Macmillan, 1990

• S. Skogestad & I. Postlethwaite, Multivariable Feedback Control, Wiley, 2005

• Gene F. Franklin, J. David Powell & Michael L. Workman, Digital Control of Dynamic Systems,Addison-Wesley, 1998

• K.J.Astrom & B.Wittenmark, Computer Controlled Systems, Prentice Hall, 1997

Page 82: Garching Control Presentation

159

Richard Poley

Texas Instruments Inc.

[email protected]

Page 83: Garching Control Presentation

Table of selected Laplace transforms

f (t) F(s)

)(t 1

)( Tt sTe

)(t1 (unit step)

s

1

)( Tt 1 (delayed step) sTe

s1

)()( Ttt 11 (rectangular pulse) )1(

1 sTes

t (unit ramp)

2

1

s

)!1(

1

n

t n

ns

1

ate

as 1

atn et

n

1

)!1(

1 nas )(

1

tsin

22 s

tcos 22 s

s

te at

sin

1 22)(

1

as

te at cos

22)(

as

as

Page 84: Garching Control Presentation

f (t) F(s)

)(1 btat ee

ab

))((

1

bsas

)(

1 btat beaeba

))(( bsas

s

)1(

1 atea

)(

1

ass

)1(

12

atat ateea

2)(

1

ass

)1(

12

atat eeata

)(

12 ass

ab

ae

ab

be

ab

btat

11

))((

1

bsass

)cos1(

12

t

)(

122 ss

te d

t

d

n

sin1 22 2

1

nnss

)(sin

112

te dt

dnn

n )2(

122

nnsss

)(sin t

22

cossin

s

s

Page 85: Garching Control Presentation

Table of selected z-transforms

f (nT) F(z)

)(t nz

)(

0

nTtn

1z

z

)(1 t (unit step)

1z

z

nT (unit ramp)

2)1( z

Tz

2)(nT 3

2

)1(2

)1(

z

zzT

anTe

aTez

z

anTenT 2)( aT

aT

ez

Tze

nTa1

))(1(

)1(

azz

az

ate1

))(1(

)1(aT

aT

ezz

ez

nTsin

1cos2

sin2 Tzz

Tz

nTe anT sin

aTaT

aT

eTezz

Tez22 cos2

sin

nTcos

1cos2

)cos(2

Tzz

Tzz

nTe anT cos

aTaT

aT

eTezz

Tezz22

2

cos2

cos

Page 86: Garching Control Presentation

Notes

Page 87: Garching Control Presentation

Notes

Page 88: Garching Control Presentation

Notes

Page 89: Garching Control Presentation

Notes

Page 90: Garching Control Presentation

TI Worldwide Technical Support

Internet TI Semiconductor Product Information Center support.ti.com TI Semiconductor KnowledgeBase support.ti.com/sc/knowledgebase Product Information Centers Americas Phone +1(972) 644-5580 Fax +1(972) 927-6377 Internet/Email support.ti.com/sc/pic/americas.htm Europe, Middle East, and Africa Phone European Free Call 00800-ASK-TEXAS

(00800 275 83927) International +49 (0) 8161 80 2121 Russian Support +7 (4) 95 98 10 701 Note: The European Free Call (Toll Free) number is not active in all countries. If you have technical difficulty calling the free call number, please use the international number above. Fax +(49) (0) 8161 80 2045 Internet support.ti.com/sc/pic/euro.htm

Japan Fax International +81-3-3344-5317

Domestic 0120-81-0036

Internet/Email International support.ti.com/sc/pic/japan.htm Domestic www.tij.co.jp/pic Asia Phone International +91-80-41381665

Domestic Toll-Free Number

Australia 1-800-999-084 China 800-820-8682 Hong Kong 800-96-5941 India 1-800-425-7888 Indonesia 001-803-8861-1006 Korea 080-551-2804 Malaysia 1-800-80-3973 New Zealand 0800-446-934 Philippines 1-800-765-7404 Singapore 800-886-1028 Taiwan 0800-006800 Thailand 001-800-886-0010

Fax +886-2-2378-6808 Email [email protected]

[email protected]

Internet support.ti.com/sc/pic/asia.htm

© 2011 Texas Instruments Incorporated

Texas Instruments