PID - TUT 02

3
108 Control Theory Feedback control has definite advantages over other techniques in relative simplicity and potentially successful operation in the face of unknown contingencies. In general, it works well as a regulator to maintain a desired operating point by compensating for various disturbances that affect the system, and it works equally well as a servo system to initiate and follow changes demanded in the operating point. Feedback Control Objectives First, it is desirable that the output follow the desired behav- ior. Note that in all the subplots in Figure 2.1m, the response to a unit step change approaches the steady-state value of 1, which corresponds to the magnitude of the input step response. Because the output response eventually reaches the steady-state value, the steady-state error, or the difference between the desired final output and the actual one, is zero. Second, almost always, the steady-state error should be zero to a step input, or constant targets, as inputs. In some cases, such as the case of a ramp input, it also is desirable for the steady-state error to be zero or nearly so. There may be an upper limit on the magnitude that is tolerable when no distur- bances are present. However, in the presence of disturbances the steady-state error can become larger. Third, the speed of response is important. From the dis- cussion in connection with equation 2.1(7), viz. the solution of the differential equation, the steady-state is attained as the homogeneous portion of the solution of the differential equa- tion approaches zero. A control system can affect the rate at which this happens. If the response of the system is sluggish, then the output (control action) of the controller is not changing enough in magnitude in response to the difference between the desired and actual output. By changing the parameters of the controller, the magnitude of the control action and the speed of response can be increased in response to control errors. Fourth, the physical limitations of the plant constrain the ability of the controller to respond to input command changes. Another measure of the controller’s speed is the settling time. The settling time is defined as the time after which the control system will remain within a given percentage of the desired final value when there are no outside distur- bances. Figure 2.1z illustrates a “2% settling time,” meaning the time it takes for a step response to approach the final steady-state value within 2%. Lastly, note that (Figure 2.1l) the step change responses of a second-order system all have an overshoot, when the damping ratio of the system is less than one. Overshoot is defined as the percentage by which the peak response value exceeds the steady-state value (peak value of step response steady-state value)/(steady-state value). A small overshoot can be acceptable, but large overshoots are not. The PID Controller In Sections 2.2, 2.3, and 2.4 detailed descriptions are pro- vided of the various analog and digital PID algorithms and therefore only some of the basic aspects are discussed here. As was shown earlier, the dynamic behavior of many processes can be modeled adequately as first- or second-order systems. Thus, the PID is an ideal tool with which to control such systems. Furthermore, the PID is easily understood and tuned by trained operators. Consider the feedback control system with a plain pro- portional-only controller shown in Figure 2.1aa. Assume that the process to be controlled is a static system with a gain K p . For a proportional-only controller, the controller output is the product of the error signal (e = r c) and of the proportional gain K c . That is, 2.1(11) The closed-loop response is the relationship between the output (controlled variable), c, and the reference or set point input, r. This relationship is 2.1(12) Note that if r is a constant, say one, the controlled output is less than one. Thus, there is a nonzero steady-state error to constant inputs. This is not surprising because if r = c, then e = r c = 0 and the output of the controller would also be FIG. 2.1z The step response shown has a 4.2-second “2% settling time.” FIG. 2.1aa Block diagram of a PID feedback control loop. Step response Time (sec) 1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 Amplitude 2% settling time u Ke c = c KK KK r c p c p = + 1 r e c u + PID Plant © 2006 by Béla Lipták

description

PID TUTORIAL

Transcript of PID - TUT 02

  • 108 Control Theory

    Feedback control has denite advantages over othertechniques in relative simplicity and potentially successfuloperation in the face of unknown contingencies. In general,it works well as a regulator to maintain a desired operatingpoint by compensating for various disturbances that affectthe system, and it works equally well as a servo system toinitiate and follow changes demanded in the operating point.

    Feedback Control Objectives

    First, it is desirable that the output follow the desired behav-ior. Note that in all the subplots in Figure 2.1m, the responseto a unit step change approaches the steady-state value of 1,which corresponds to the magnitude of the input stepresponse. Because the output response eventually reaches thesteady-state value, the steady-state error, or the differencebetween the desired nal output and the actual one, is zero.

    Second, almost always, the steady-state error should bezero to a step input, or constant targets, as inputs. In somecases, such as the case of a ramp input, it also is desirable forthe steady-state error to be zero or nearly so. There may be anupper limit on the magnitude that is tolerable when no distur-bances are present. However, in the presence of disturbancesthe steady-state error can become larger.

    Third, the speed of response is important. From the dis-cussion in connection with equation 2.1(7), viz. the solutionof the differential equation, the steady-state is attained as thehomogeneous portion of the solution of the differential equa-tion approaches zero. A control system can affect the rate atwhich this happens. If the response of the system is sluggish,then the output (control action) of the controller is not changingenough in magnitude in response to the difference between thedesired and actual output. By changing the parameters of thecontroller, the magnitude of the control action and the speedof response can be increased in response to control errors.

    Fourth, the physical limitations of the plant constrain theability of the controller to respond to input commandchanges. Another measure of the controllers speed is thesettling time. The settling time is dened as the time afterwhich the control system will remain within a given percentageof the desired nal value when there are no outside distur-bances. Figure 2.1z illustrates a 2% settling time, meaningthe time it takes for a step response to approach the nalsteady-state value within 2%.

    Lastly, note that (Figure 2.1l) the step change responsesof a second-order system all have an overshoot, when thedamping ratio of the system is less than one. Overshoot isdened as the percentage by which the peak response valueexceeds the steady-state value (peak value of step response steady-state value)/(steady-state value). A small overshoot canbe acceptable, but large overshoots are not.

    The PID Controller

    In Sections 2.2, 2.3, and 2.4 detailed descriptions are pro-vided of the various analog and digital PID algorithms andtherefore only some of the basic aspects are discussed here.

    As was shown earlier, the dynamic behavior of manyprocesses can be modeled adequately as rst- or second-ordersystems. Thus, the PID is an ideal tool with which to controlsuch systems. Furthermore, the PID is easily understood andtuned by trained operators.

    Consider the feedback control system with a plain pro-portional-only controller shown in Figure 2.1aa. Assume thatthe process to be controlled is a static system with a gain Kp.For a proportional-only controller, the controller output is theproduct of the error signal (e = r c) and of the proportionalgain Kc. That is,

    2.1(11)

    The closed-loop response is the relationship between theoutput (controlled variable), c, and the reference or set pointinput, r. This relationship is

    2.1(12)

    Note that if r is a constant, say one, the controlled output isless than one. Thus, there is a nonzero steady-state error toconstant inputs. This is not surprising because if r = c, thene = r c = 0 and the output of the controller would also be

    FIG. 2.1z The step response shown has a 4.2-second 2% settling time.

    FIG. 2.1aa Block diagram of a PID feedback control loop.

    Step response

    Time (sec)

    1.4

    1.2

    1

    0.8

    0.6

    0.4

    0.2

    00 1 2 3 4 5 6

    Ampl

    itude

    2% settling time

    u K ec

    =

    cK K

    K Kr

    c p

    c p

    =

    +1

    r e cu+

    PID Plant

    2006 by Bla Liptk

    SIRTRUNGHighlight

    SIRTRUNGHighlight

    SIRTRUNGHighlight

  • 2.1 Control Basics 109

    zero. This produces a contradiction in that c would be forcedto zero, which, in general, is not the value of r.

    Therefore, the plain proportional controller reduces butdoes not eliminate the error. Note from Equation 2.1(12) thatas the controller gain increases, the controlled output, c,approaches the referenced input r more and more closely.Thus, the steady-state error, e, becomes smaller as Kc is madelarger. But since Kc

    can never be innite, the error is neverzero.

    The Derivative Mode To better understand the effect ofderivative action, consider the situation in which the control-ler shown in Figure 2.1aa is proportional plus derivative (PD).In this case, the controller output is given by

    2.1(13)

    if the proportional gain Kc is 1 and the derivative gain is ,which is called the derivative time. Figure 2.1bb illustratesthe controlled variables step response, the error and deriva-tive of the error signal, when the set point (reference) is r = 1.

    The vertical lines in the top two plots of Figure 2.1bbare in locations where the controlled variable signal and theerror signal have local maximums and minimums or pointswhere the derivative is zero. Note that the controlled variableresponse has exceeded the set point (target value) of one. Theexcess overshoot is due to the presence of a certain momen-tum in the response of the system; the controller did not turn

    the input around in time to stop the system from exceedingthe desired value.

    This is seen in the error signal that has not changed signuntil the controlled variable output has exceeded the set point.Note also that the derivative is zero at the peak values andof opposite sign to the value of the error signal. When theerror is added to a constant times the derivative, the result isa signal that changes sign earlier in time, that is, before theoutput has actually reached the steady-state value. Figure 2.1ccillustrates this.

    The PD controller is used in applications where overshootcannot be tolerated, such as pH neutralization. The reductionor elimination of overshoot can often be accomplished with-out signicantly affecting the settling time of the closed-loopsystem. The primary disadvantage of derivative mode is itssensitivity to noise. Noise is generally of high frequency, anddifferentiating just amplies it. The controller output canbecome cyclic or unstable, which can have a detrimentaleffect on the longevity of actuators such as valves or motors.

    Integral Mode Nearly all controllers have some form of inte-gral action. Integral action is important because it correctsbased on the accumulated error, which is the area under theerror curve. If the error goes to zero, the output of the integratoris the constant area that had accumulated up to that point.

    Consider the feedback system illustrated in Figure 2.1aa.The task of the integral term in the PID algorithm is to ndthe manipulated variable (the input to the plant) needed todrive the steady-state error to zero when the set point (refer-ence input) is constant.

    When the error is zero, both the proportional term andthe derivative term contribute nothing to the controller output.

    FIG. 2.1bbThe step response of a PD controller showing the responses of thecontrolled variable (top), the error (center), and the derivative ofthe error (bottom).

    u t e t T de tdtd

    ( ) ( ) ( )= +

    Td

    1.5

    1

    0.5

    00 1 2 3 4 5

    Error signal

    Step response

    6 7 8 9 10

    1

    210

    0.5

    0

    0.5

    12

    0 1 2 3 4 5Derivative of error signal

    6 7 8 9 10

    0 1 2 3 4 5 6 7 8 9 10

    FIG. 2.1cc The anticipation of the PD controller can be seen by noting thecontrolled variable response of a plain proportional controller(solid line) and that of a PD controller (dashed line) to the samestep upset.

    Controller response with and without derivation action1

    0 1 2 3 4 5Time

    6 7 8 9 10

    0.8

    0.8

    0.6

    0.6

    0.4

    0.4

    0.2

    Cont

    rolle

    r out

    put

    0.2

    0

    2006 by Bla Liptk

    SIRTRUNGHighlight

    SIRTRUNGLine

    SIRTRUNGTypewritere (t)

    SIRTRUNGTypewriterde(t)------ dt

    SIRTRUNGLine

    SIRTRUNGLine

    SIRTRUNGHighlight

    SIRTRUNGTypewriterP

    SIRTRUNGTypewriterPD

    SIRTRUNGHighlight

    SIRTRUNGHighlight

    SIRTRUNGHighlight

  • 110 Control Theory

    Only the integral term provides any input to the controlleroutput; only the integrator drives the manipulated variable tocompensate for the area under the past error curve.

    In summary, the PID controller produces an outputdened as

    2.1(14)

    where Kp is the proportional gain; Td is the derivative time;and Ti is the integral time.

    The integral time can be viewed as the amount of thetime it takes for the integral component to make the samecontribution as the proportional term. If the integral time isshort, the integral contribution to the PID output is large andtoo much integral gain (Ti too small) can cause the systemto become unstable.

    Feedforward Control

    Feedforward control is another basic technique used to com-pensate for uncontrolled disturbances entering the controlledprocess. Both feedback and feedforward control are dis-cussed in detail in Section 2.8 and therefore only an intro-duction is given here. In this technique the control action isbased on the disturbance input into the process without con-sidering the condition of the process. In concept, feedforwardcontrol yields much faster correction than feedback controldoes, and in the ideal case compensation is applied in sucha manner that the effect of the disturbance is never seen inthe controlled variable, the process output.

    A skillful operator of a direct contact water heater coulduse a simple feedforward strategy to compensate for changesin inlet water temperature by detecting a change in inlet watertemperature and in response to that, increasing or decreasingthe steam rate to counteract the change (Figure 2.1dd). Thissame compensation could be made automatically with aninlet temperature detector designed to initiate the appropriatecorrective adjustment in the steam valve opening.

    The concept of feedforward control is very powerful, butunfortunately it is difcult to implement in most process

    control applications. In many cases disturbances cannot beaccurately measured, and therefore pure feedforward cannotbe used. The main limitation of feedforward is due to ourinability to prepare perfect process models or to make per-fectly accurate measurements.

    Because of these limitations, pure feedforward wouldaccumulate the errors in its model and would eventually self-destruct. The main limitations of feedback control are thatfeedback cannot anticipate upsets but can only respond tothem after the upsets have occurred, and that it makes itscorrection in an oscillating, cycling manner.

    It has been found that combining feedback and feedfor-ward is desirable in that the imperfect feedforward modelcorrects for about 90% of the upset as it occurs, while feed-back corrects for the remaining 10%. With this approach, thefeedforward component is not pushed beyond its abilities,while the load on the feedback loop is reduced by an orderof magnitude, allowing for much tighter control.

    Feedforward Response

    Ideally the feedforward correction would be so effective thata disturbance would have no measurable effect on the con-trolled variable, the process output. As an example, con-sider a rst-order system in which there is a measurabledisturbance. Suppose that a process disturbance occurs at timet = 5 seconds, as shown in the top segment of Figure 2.1ee, andcauses the PID controller to generate a corrective action asshown in lower part of Figure 2.1ee. Note that while thecontroller will eliminate the disturbance, it will do that onlyafter it has occurred.

    FIG. 2.1ddThe concept of feedforward control implemented by a humanoperator.

    u t K e tT

    e d T de tdtp i

    d( ) ( ) ( )( )

    = + +

    1

    Steam

    Cool waterSteamvalve

    Waterheater

    Temperatureindicator

    Hot water

    FIG. 2.1ee If a step disturbance occurs at t = 5, the controlled variable of afirst-order process responds to that upset as shown in the top portionof the figure. The bottom part shows the response of a feedbackPID controller to such an upset, which generates the manipulatedvariable.

    1.5

    1

    0.5

    00

    Ampl

    itude

    Ampl

    itude

    1 2 3 4 5

    Controller output with disturbance

    Process output with disturbance

    6 7 8 9 10

    0 1 2 3 4 5 6 7 8 9 10

    2

    1.5

    1

    0.5

    0

    2006 by Bla Liptk

    SIRTRUNGHighlight