Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative...

27
Lecture 5: PID Control 1

Transcript of Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative...

Page 1: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Lecture 5:

PID Control

1

Page 2: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Objective

Identify the features of proportional, integral, and derivative control actions.

2

Page 3: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

PID CONTROLLER

TC

v1

v2

• Developed in the 1930-40’s, remains workhorse in practice

• Not “optimal”, based on good properties of each mode

• Programmed in digital control equipment

• ONE controlled variable (CV) and ONE manipulated variable (MV). Many PID’s used in a plant.

3

Page 4: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

A note about the units• Consider the following control loop. • The controller variable y(t) may have different units depending on the

process which may be temperature, pressure or level.• Similarly, the control signal u(t) may have the units of mA or psi depending

on the type of actuator. • There is a need for unification of units regardless of the nature of the

actual system. .

4

Page 5: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

The Units

Let us assume that the value of:

• the control signal u(t) lie in the range from umin to umax and

• the output signal y(t) has a value in the range from ymin to ymax

5

Page 6: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

“% of Span” Notation

• Then we can express the control signal as a percentage of its span as

• Similarly, we can express the error as a percentage of the controlled variable span as

• By this way, all variables will be expressed in % regardless of their actual units.

6

%100)(

)(minmax

min

uu

ututp

%100)(

)(minmax

yy

tyrtep

Page 7: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Example

A standard control signal assumes a value in the range of 4-20 mA.

Find the % of span value corresponding to the following actual control signal values:

4mA 0% 12mA 50% 16mA 75% 20mA 100%

7

%100)(

)(minmax

min

uu

ututp

Page 8: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Proportional Control

• The controller output is proportional to the error e(t)

• p(t): control signal (expressed in %)• ep(t): error signal (expressed in %)• Kc: controller gain• p0: controller bias signal (the controller output when the

error is zero)

8

)()( 0 teKptp pc

Page 9: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Example 1

• Consider the following closed-loop system:• What is the steady state error for set point

r = 1 and r = 2?

9

Page 10: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Answer

Case 1: r = 1• At steady state we can replace the plant with its steady

state gain value of 1.• Hence, we can write

10

01)(

1)(]1[

)],(1[1

)],([1

)]()[1()( 0

ss

cc

c

c

c

ety

KtyK

tyK

tyrK

teKuty

Page 11: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Case 2: r = 2• At steady state we can replace the gain with its steady state value of

1.• Hence, we can write

From this example, we can conclude that systems with proportional control only have in general a steady-state error or offset.

11

css

c

c

cc

c

c

c

Ke

K

Kty

KtyK

tyK

tyrK

teKuty

1

1

1

21)(

21)(]1[

)],(2[1

)],([1

)]()[1()( 0

Page 12: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Example 2

Consider a closed-loop system with a plant

and proportional control, K = 1, 2, 10.

Simulate open loop and closed loop responses

12

12

1)(

2

sssG

Page 13: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

G = tf([1],[1 2 1]);

Gc = 1;

Gcl = Gc*G/(1+Gc*G);

step(G)

hold on

step(Gcl)

Gc = 2;

Gcl = Gc*G/(1+Gc*G);

step(Gcl)

Gc = 10;

Gcl = Gc*G/(1+Gc*G);

step(Gcl)

13

Page 14: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

• ss

14

Page 15: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Features of Proportional Control

• The controller gain, Kc, determines the controller “sensitivity” – how much compensation to enact for a given change in error.

• The larger Kc is, the faster the response. (Speed)

• However, if Kc is too large, the controller will overreact, leading to oscillatory response. In the worst case, the system may become unstable. (Stability)

• System with only P-control has a steady-state error. (Offset)

• There are physical limits to a control mechanism. At these limits, the control system is saturated. 15

Page 16: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

The Proportional Band• The transfer function of a proportional controller is simply

• Generally, the proportional gain is dimensionless (p(t) and ep(t) are usually expressed in % of span).

• In practice the term proportional band (PB) is used. PB is the range over which the error (or the controlled variable) must change to drive the controller output over its full range (i.e. to move the output of the controller from its lowest to its highest value and is defined as

• A high proportional gain is equivalent to a narrow PB and a low gain is wide PB. 16

cp

c KsE

sPsG

)(

)()(

cK

100PB

Page 17: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

The Proportional Band

• Take, for example, a level controller on a tank where we measure the level from bottom to top as 0 to 100% and the set point of the controller is at 40%.

• We have a control valve on the inlet of the tank whose job is to maintain the level in the tank.

• The PB is defined as the range of level over which the control valve will go from fully closed to fully open.

• Suppose we decide that if the tank level should fall to 20% we want the control valve fully open (100% open). Additionally, if the tank level rises to 60% full, we want the control valve to be fully closed (0% open).

• If the tank level is between 20% and 60% we want the control valve to be open "in proportion" the level. So if the tank level were to rise to 40% (half way up the PB), the control valve should be set to 50% open.

• This controller would have a PB of 40% (60% - 20%).

17

Page 18: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

The Proportional Band• The figure shows that a 100%

PB means that as the controlled variable varies by 100% of its range, the controller output varies by 100% of its range.

• A 50% PB means that as the controlled variable varies by 50% of its range, the controller output varies by 100% of its range.

• Also note that a proportional only controller with a 200% PB will not move its output the entire range. A 200% PB means a very small controller gain or very little sensitivity to errors. 18

Page 19: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Direct & reverse action

• Direct action: if the process o/p rises, controller o/p also rises.

• Reverse action: if the process o/p rises, controller o/p decreases.

19

Page 20: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Proportional–Integral Control

• To eliminate offset, we can introduce integral action into the controller.

• The integral action accumulates the error from t = 0 to the present.

• Where τI is the integral time constant (reset time, or minutes per repeat).

• Roughly, the reset time is the time that it takes the controller to repeat the proportional action. This is easy to see if we take the error to be a constant in the integral.

20

s

KsGdtteteKtpI

cc

t

pI

pc 1

1)()(1

)()(0

Page 21: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Proportional–Integral Control

• The integral depends on the history of the error and it is not necessarily zero even if the current error is zero. This mode can be called “The persistent mode”.

• Note that the value of the integral will not decrease unless the integrand ep(t) changes its sign. As a result, integral action leads to oscillatory behavior (underdamped response) which may have a short rise time, but is penalized by excessive overshoot or exceedingly long settling time.

• If there is too much integral action, the system may become unstable.

• Because of this issue we usually lower the proportional gain (or detune the controller) when we add integral control.

21

Page 22: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Proportional–Derivative Control

• Derivative control action is based on how fast the error is changing with time (rate action control).

• where is the derivative time constant (sometimes just rate time).

• The derivative action is called “The predictive mode”.

22

sKsGdt

tdeteKtp DccDc

1)(

)()()(

Page 23: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Proportional–Derivative Control

• In practice, we cannot build a pneumatic device or a passive circuit that provides ideal derivative action.

• Hence, commercial (real!) PD controllers are designed on the basis of a lead–lag element:

• where α is a small number, typically 0.05 ≤ α ≤ 0.2.

23

1

1)(

s

sKsG

D

Dcc

Page 24: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

Features of Derivative Control

• PD control is not useful for systems with noisy signals.

• The sign of the rate of change in the error could be opposite that of the proportional or the integral terms. Thus adding derivative action to PI control may counteract the overcompensation of the integrating action and hence may improve system response while reducing oscillations and overshoot.

• The additional stabilizing action allows us to use a larger proportional gain and obtain a faster system response.

• What is the effect of derivative control on steady state performance (steady state error)?

24

Page 25: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

The Derivative Kick• What would be the behavior of the manipulated variable when we

enter a step change to the set point?

At the time of the step change, the error changes rapidly causing the derivative action to give very high output. This is called the derivative kick

• How can we eliminate the derivative kick?

This can be done by taking the derivative of the controlled variable, instead of the error, in the feedback loop.

25dt

tydKtp Dc

)( )(

dt

tdeKtp p

Dc

)()(

Page 26: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

PID Control• Finally, we can put all the components together to make a PID

(or three-mode) controller. • The time-domain equation and the transfer function of an

“ideal” PID controller are

26

sKs

KKsG

ss

KsG

dt

tdedtteteKtp

DI

cc

DI

cc

t pDp

Ipc

)(

11)(

)()(

1)()(

0

Page 27: Lecture 5: PID Control 1. Objective Identify the features of proportional, integral, and derivative control actions. 2.

PID Controller Implementations

• In real life, different manufacturers implement the “real” PID controller slightly differently. One possibility is to modify the derivative action as

• Another implementation is to introduce the derivative control in series with PI control (This configuration is also referred to as interacting or series PID):

27

1

11)(

s

s

sKsG

D

D

Icc

1

11)(

s

s

s

sKsG

D

D

I

Icc