42
1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

Embed Size (px)

Citation preview

Page 1: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

1

PD, PI, PID Compensation

M. Sami Fadali

Professor of Electrical Engineering

University of Nevada

Page 2: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

2

Outline

• PD compensation.

• PI compensation.

• PID compensation.

Page 3: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

3

PD Control

• L= loop gain = N / D.

• scl = desired closed-loop pole location.

• Find a controller C s.t. L C(scl) = 180 or its odd multiple (angle condition).

• Controller Angle for scl

C cl cl clL s N s D s 180 180

Zero location nC

da

tan

Page 4: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

4

Remarks

• Graphical procedures are no longer needed.

• CAD procedure to obtain the design parameters for specified & n.

» evalfr(l,scl) % Evaluate l at scl

» polyval( num,scl) % Evaluate num at scl

• The complex value and its angle can also be evaluated using any hand calculator.

Page 5: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

5

Procedure:MATLAB or Calculator

1. Calculate L (scl)

»theta = pi angle(evalfr(l, scl) )2. Calculate zero location using (5.14).3. Calculate new loop gain (with zero)

» lc = tf( [1, a],1)*l4. Calculate gain (magnitude condition)

» K = 1/abs( evalfr( lc, scl))5. Check time response of PD-compensated

system. Modify the design to meet the desired specifications if necessary (MATLAB).

Page 6: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

6

Procedure 5.2: Given e() &

1. Obtain error constant Ke from e() and determine a system parameter Kf that remains free after Ke is fixed for the system with PD control.

2- Rewrite the closed-loop characteristic equation of the PD controlled system as

1 0 K G sf f ( )

Page 7: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

7

Procedure 5.2 (Cont.)

3. Obtain Kf corresponding to the desired closed-loop pole location. As in Procedure 5.1, Kf can be obtained by clicking on the MATLAB root locus plot or applying the magnitude condition using MATLAB or a calculator.

4. Calculate the free parameter from the gain Kf .

5. Check the time response of the PD compensated system and modify the design to meet the desired specifications if necessary.

Page 8: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

8

Example 5.5

Use a CAD package to design a PD controller for the type I system

G ss s

( )( )

1

4

to meet the following specifications(a) = 0.7 & n = 10 rad/s.(b) = 0.7 & e()= 4% due to a unit ramp.

Page 9: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

9

(a) =0.7 & n=10 rad/sMATLAB: calculate pole location & corresponding gain» scl = 10*exp( j*( pi-acos(0.7) ) )scl =7.0000 + 7.1414I

» g=zpk([ ],[0,-4],1); theta=pi( angle( evalfr( g, scl) ) )theta =

1.1731» a = 10 * sqrt(1-0.7^2)/ tan(theta) + 7a =

10.0000» k =1/abs(evalfr(tf( [1, a],1)*l,scl)) % Gain at sclk =

10.0000

Page 10: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

10

RL of Uncompensated System

-8 -7 -6 -5 -4 -3 -2 -1 00

1

2

3

4

5

6

7

8

0.7

Root Locus

Real Axis

Imag

inar

y A

xis

Page 11: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

11

RL of PD-compensated System

-20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0-8

-6

-4

-2

0

2

4

6

80.7

0.7

10

System: gcompGain: 10

Pole: -7.01 + 7.13iDamping: 0.701

Overshoot (%): 4.56Frequency (rad/sec): 10

Root Locus

Real Axis

Imag

inar

y A

xis

Page 12: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

12

(b) =0.7, e()=4% for unit ramp

KaeiKa

aKK v

100..100

425

Closed-loop characteristic equation with PD

0)4(

1

ss

asK

Assume that K varies with K a fixed, then

14 100

02

Ks

s s

RL= circle centered at the origin

Page 13: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

13

RL of PD-compensated System

K a fixed

Page 14: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

14

(b) Design Cont.

Desired location: intersection of root locus with = 0.7 radial line.

K = 10, a =10 (same values as in Example 5.3).

MATLAB command to obtain the gain

» k = 1/abs( evalfr( tf([1,10],[ 1, 4, 0]), scl) )

k =

10.0000• Time responses of two designs are identical.

Page 15: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

15

PI Control • Integral control to improve e(),

(increases type by one) worse transient response or instability.

• Add proportional control controller has a pole and a zero.

• Transfer function of proportional-plus-integral (PI) controller

pi

pi

p

KKas

asK

s

KKsC

)(

Page 16: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

16

PI Remarks

• Used in cascade compensation (integral term in the feedback path is equivalent to a differentiator in the forward path)

• PI design for a plant transfer function G(s) = PD design of G(s)/ s.

• A better design is often possible by "almost canceling" the controller zero and the controller pole (negligible effect on time response).

Page 17: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

17

Procedure 5.3

1. Design a proportional controller for the system to meet the transient response specifications, i.e. place the dominant closed-loop system poles at scl = n j d .

2. Add a PI controller with the zero location (a) = small angle ( 3 5).

3. Tune the gain of the system to move the closed-loop pole closer to scl.

10)tan(1 2nn aora

Page 18: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

18

Comments

• Use PI control only if P-control meets the transient response but not the steady-state error specifications. Otherwise, use another control.

• Use pole-zero diagram to prove zero location formula.

Page 19: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

19

Pole-zero Diagram of PI Controller

a

asclz

p cls

scl

n

d

j

Page 20: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

20

Proof

Controller angle at scl

z p p z180 180

From Figure

n

n

dz

n

dp

ax

xa

2

2

1180tan

1180tan

Page 21: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

21

Proof (Cont.)

tantan tan

tan tanA B

A B

A B

1

tan

1 1

11

1

1

2 2

2

2x

x

x

x

Solve for x x

1

1 2 tan

x = ( a/ n) Multiplying by n gives a.

Trig. identity

Page 22: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

22

Controller Angle at scl (< 3) vs.

3about

101

tan

10

2

21

nax

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.5

1

1.5

2

2.5

3

3.5

Page 23: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

23

Example 5.6

Design a controller for the position control system to perfectly track a ramp input with a dominant pair with = 0.7 & n =4 rad/s.

G ss s

( )( )

1

10

Page 24: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

24

Solution

• Procedure 5.1 with modified transfer function.• Unstable for all gains (see root locus plot).• Controller must provide an angle 249 at the

desired closed-loop pole location. • Zero at 1.732. • Cursor at desired pole location on compensated

system RL gives a gain of about 40.6.

G ss s

i ( )( )

1

102

Page 25: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

25

RL of System With Integrator

-10 -8 -6 -4 -2 00

1

2

3

4

5

6

0.7

4

Root Locus

Real Axis

Imag

inar

y A

xis

Page 26: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

26

RL of PI-compensated System

Page 27: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

27

Analytical Design

Values obtained earlier, approximately.

732.164.4044.4

64.404)4.4)(7.0(24)2(

4.4)4)(7.0(210210

22

Ka

K

n

nn

n

2223

2223

)2()2(

)2)((10

nnnn

nn

sss

sssKzKsss

Closed-loop characteristic polynomial

Page 28: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

28

MATLAB

» scl = 4*exp(j*(pi acos( 0.7)) )scl =

-2.8000 + 2.8566i» theta = pi + angle( polyval( [ 1, 10, 0, 0], scl ) )theta =

1.9285» a = 4*sqrt(1-.7^2)/tan(theta)+ 4*.7a =

1.7323» k = abs(polyval( [ 1, 10, 0,0], scl )/ polyval([1,a], scl) )k =

40.6400

Page 29: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

29

Design I ResultsClosed-loop transfer function for Design I

G ss

s s s

s

s s s

cl ( ). ( . )

. .

. ( . )

( . )( . )

40 64 1732

10 40 64 69 28

40 64 1732

4 4 56 16

3 2

2

Zero close to the closed-loop poles excessive PO(see step response together with the response for a later design: Design II).

Page 30: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

30

Step Response of PI-compensated System

Design I (dotted), Design II (solid).

Page 31: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

31

Design II: Procedure 5.3 = 0.7, K 51.02 & n = 7.143 rad/s. (acceptable design)

zero location

5.0)3tan(49.017.0

143.7

)tan(1 2

na

Closed-loop transfer function

G ss

s s s

s

s s scl ( )

( . ) ( . )

( . )( . )

50 05

10 50 25

50 05

0559 9 4413 2 2 44.7225

Gain slightly reduced to improve response.Dominant poles 0.7, n= 6.6875 rad/s

Time response for Designs I and IIPO for Design II (almost pole-zero cancellation) << Design I (II better)

Page 32: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

32

PID (proportional-plus-integral-plus-derivative) Control

• Improves both transient & steady-state response.

• Kp , Ki , Kd = proportional, integral, derivative gain, resp.

• Controller zeros: real or complex conjugate.

d

in

d

pn

nndd

ip

KK

K

Ks

ssKsK

sK

KsC

2

22

,2

2)(

Page 33: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

33

PID Design Procedures

1. Cancel real or complex conjugate LHP poles. 2. Cancel pole closest to (not on) the imaginary

axis then add a PD controller by applying Procedures 5.1 or 5.2 to the reduced transfer function with an added pole at the origin.

3. Follow Procedure 5.3 with the proportional control design step modified to PD design. The PD design meets the transient response specifications and PI control is then added to improve the steady-state response.

Page 34: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

34

Example 5.7

Design a PID controller for the transfer function to obtain zero e() due to ramp, = 0.7 and n = 4 rad/s.

)10)(1(1

)(

sss

sG

Page 35: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

35

Design I

Cancel pole at 1 with a zero & add an integrator

G ss si ( )

( )

1

102

Same as transfer function of Example 5.6 Add PD control of 5.6PID controller

C ss s

s( )

( )( . )

50

1 05

Page 36: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

36

Design IIDesign PD control to meet transient response specs.Select n = 5 rad/s (anticipating effect of adding PI control).

Design PD controller using MATLAB commands» [k,a,scl] = pdcon(0.7, 5, tf(1, [1,11,10,0]) )k = 43.0000a = 2.3256scl = -3.5000 + 3.5707i » b =5 /(0.7 + sqrt(1-.49)/tan(3*pi/ 180) ) % Obtain PI zero.b =

0.3490

Transfer function for Design II (reduce gain to 40 to correct for PI)

C ss s

s( )

( . )( . )

40

0 349 2 326

Page 37: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

37

Conclusions

• Compare step responses for Designs I and II: Design I is superior because the zeros in Design II result in excessive overshoot.

• Plant transfer function favors pole cancellation in this case because the remaining real axis pole is far in the LHP. If the remaining pole is at 3, say, the second design procedure would give better results.

• MORAL: No easy solutions in design, only recipes to experiment with until satisfactory results are obtained.

Page 38: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

38

Time response for Design I(dotted) and Design II (solid)

Page 39: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

39

Example 5.8

Design a PID controller for the transfer function to obtain zero e() due to step,

= 0.7 and n 4 rad/s

G ss s s

( )( )( )

1

10 2 102

Page 40: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

40

Solution

• Complex conjugate pair slows down the time response.

• Third pole is far in the LHP.

• Cancel the complex conjugate poles with zeros and add an integrator

G ss s

( )( )

1

10

Page 41: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

41

Solution (cont.)

• Stable for all gains.

• Closed-loop characteristic polynomial222 210 nnssKss

Equate coefficients with = 0.7

n

10

2

5

0 77143

..

(meets design specs.)PID controller

C ss s

s( ) .

5102

2 102

Page 42: 1 PD, PI, PID Compensation M. Sami Fadali Professor of Electrical Engineering University of Nevada

42

Step Response of PID-compensated System

In practice, pole-zero cancellation may not occur but nearcancellation is sufficient to obtain a satisfactory time response