[ Team LiB ]
Chapter 6. PID Controller Tuning In Chapter 5 we were given a process transfer function and a controller transfer function (P, PI, PID, etc.) and asked to find the closed-loop response (or stability). In this chapter we provide an overview of classical methods for tuning PID controllers. We also provide an introduction to model-based techniques, using the direct synthesis approach. After studying this chapter, the reader should be able to do the following: Understand the different forms of a PID controller Tune PID controllers using the classical, Ziegler-Nichols, and Cohen-Coon methods Derive controllers based on a process model and desired closed-loop response The major sections of this chapter are as follows: 6.1 Introduction 6.2 Closed-Loop Oscillation-Based Tuning 6.3 Tuning Rules for First-Order + Dead Time Processes 6.4 Direct Synthesis 6.5 Summary [ Team LiB ]
[ Team LiB ]
6.1 Introduction Consider the standard feedback block diagram shown in Figure 6-1, where disturbance inputs have been neglected. Transfer functions (and block diagrams) are used to analyze the behavior of control systems, because the algebraic expressions are easy to manipulate.
Figure 6-1. Feedback control block diagram.
We noted in Chapter 5 that the closed-loop transfer function could be used to determine, for example, the range of controller gains that assure closed-loop stability.
PID Controller Forms PID controller algorithms were developed in Chapter 5. Here we provide a concise review of the algorithms in common use.
P-Only Control The proportional only algorithm is
Equation 6.1a
which has the following transfer function relationship between error and controller output:
Equation 6.1b
PI-Control The PI algorithm is
Equation 6.2a
which has the following transfer function relationship between error and controller output:
Equation 6.2b
PID Control The ideal PID algorithm is
Equation 6.3a
which has the following transfer function relationship between error and controller output:
Equation 6.3b
In practice it is impossible to perfectly differentiate the error signal, so the following Laplace transfer function approximations are often used for "real" PID control (where = 0.1 is common):
Equation 6.4a
or
Equation 6.4b
A problem with taking the derivative of the error is that step setpoint changes cause the derivative to become unbounded and result in a "spike" in the manipulated variable action. In most practical PID controllers, then, the derivative of the measured process output is used.
Equation 6.5a
The transfer function representation is
Equation 6.5b
which is usually implemented in the form of
Equation 6.5c
where the measured process output has been "filtered" to minimize noise problems. [ Team LiB ]
[ Team LiB ]
6.2 Closed-Loop Oscillation-Based Tuning A PID controller has three tuning parameters. If these are adjusted in an ad hoc fashion, it may take a while for satisfactory performance to be obtained. Also, each tuning technician will end up with a different set of tuning parameters. There is plenty of motivation, then, to develop an algorithmic approach to controller tuning. The first widely used method for PID tuning was published by Ziegler and Nichols in 1942.
Ziegler-Nichols Closed-Loop Method The Ziegler-Nichols closed-loop tuning technique was perhaps the first rigorous method to tune PID controllers. The technique is not widely used today because the closed-loop behavior tends to be oscillatory and sensitive to uncertainty. We study the technique for historical reasons, and because it is similar to commonly used automatic tuning ("autotune") techniques covered in Chapter 11. The closed-loop Ziegler-Nichols method consists of the following steps.
1. With P-only closed-loop control, increase the magnitude of the proportional gain until the closed-loop is in a continuous oscillation. For slightly larger values of controller gain, the closed-loop system is unstable, while for slightly lower values the system is stable. 2. The value of controller proportional gain that causes the continuous oscillation is called the critical (or ultimate) gain, kcu . The peak-to-peak period (time between successive peaks in the continuously oscillating process output) is called the critical (or ultimate) period, Pu. 3. Depending on the controller chosen, P, PI, or PID, use the values in Table 6-1 for the tuning parameters, based on the critical gain and period. Tyreus and Luyben have suggested tuning parameter rules that result in less oscillatory responses and that are less sensitive to changes in the process condition. Their rules are shown in Table 62.
Table 6-1. Ziegler-Nichols Closed-Loop Oscillation Method Tuning Parameters Controller type
kc
•I
•D
P-only
0.5 kcu
—
—
PI
0.45 kcu
Pu/1.2
—
PID
0.6 kcu
Pu/2
Pu/8
Table 6-2. Tyreus-Luyben Suggested Tuning Parameters Based on the
Ziegler-Nichols Closed-Loop Oscillation Tuning Method Controller type
kc
•I
•D
PI
kcu /3.2
2.2 Pu
—
PID
kcu /2.2
2.2 Pu
Pu/6.3
Example 6.1: Third-Order Process Consider the third-order system used in Example 5.3, with a time unit of minutes
Recall that a P-only controller caused the closed-loop to be on the verge of instability (continuous oscillation) when the value of the controller gain was kc = 10. This is the critical proportional gain, kcu . From the response shown in Figure 6-2 we see that the ultimate period (period of oscillation) is Pu = 6.2 minutes.
Figure 6-2. Response to unit step setpoint change at t = 0; kcu = 10. Notice that Pu = 6.2 minutes.
The closed-loop responses for Ziegler-Nichols tuning for P, PI, and ideal PID controllers (based on Table 6-1) are shown in Figure 6-3. Notice that a P-only controller has offset, as expected. Also, all the responses are quite oscillatory; this is one of the major disadvantages to the Ziegler-
Nichols tuning method. It typically results in more oscillatory behavior than would be allowable in a typical process plant. The tuning parameters are also not very robust, that is, they are very sensitive to process uncertainty. If the process conditions change, then the control system may become unstable.
Figure 6-3. Response to unit step setpoint change. Comparison of Ziegler-Nichols P, PI, and PID tuning rules. Notice the "spike" in the manipulated input for the PID controller.
The closed-loop responses for Tyreus-Luyben tuning for P (assumed to be the Ziegler-Nichols value), PI, and PID controllers are compared in Figure 6-4. The Tyreus-Luyben parameters result in less oscillatory responses and will be less sensitive to uncertainty.
Figure 6-4. Response to unit step setpoint change. Comparison of Tyreus-Luyben P, PI, and PID tuning rules. Notice the "spike" in the manipulated input for the PID controller.
Note that the PID controllers simulated in Figures 6-3 and 6-4 are based on an ideal derivative of the error. A problem is that this results in a "spike" in the manipulated input when a step setpoint change is made. Also, an ideal derivative controller will be more sensitive to measurement noise. [ Team LiB ]
[ Team LiB ]
6.3 Tuning Rules for First-Order + Dead Time Processes The previous tuning rules were based on tests that forced a process into a continuous oscillation. Obvious disadvantages to the techniques are that the system is forced to the edge of instability, and it may take a while to iteratively adjust the controller to obtain a continuous oscillation. In this section we present tuning rules based on process models that have been obtained through the open-loop step tests presented in Chapter 4.
Ziegler-Nichols Open-Loop Method Ziegler and Nichols also proposed tuning parameters for a process that has been identified as integrator + time-delay based on an open-loop process step response,
Since first-order + time-delay processes have a maximum slope of k = kp/p at t = for a unit step input change, these same rules can be used for first-order + time-delay processes,
Their recommended tuning parameters, which should give roughly quarter-wave damping, are shown in Table 6-3. We see a potential problem for systems with a low time-delay/time-constant ratio, since this causes the proportional gain to become very large. Similarly, the integral time tends to be low, causing oscillatory behavior.
Cohen-Coon Parameters The method developed by Cohen and Coon (1953) is based on a first-order + time-delay process model. A set of tuning parameters was empirically developed to yield a closed-loop response with a decay ratio of 1/4 (similar to the Ziegler-Nichols methods). The tuning parameters as a function of the model parameters are shown in Table 6-4. A major problem with the Cohen-Coon parameters is that they tend not to be very robust; that is, a small change in the process parameters can cause the closed-loop system to become unstable.
Table 6-3. Ziegler-Nichols Open-Loop Tuning Parameters
Controller type
kc
•I
•D
P-only
—
—
PI
3.3
—
PID
2
0.5
Table 6-4. Cohen-Coon Tuning Parameters Controller type P-only
PI
PID
[ Team LiB ]
kc
•I —
•D —
—
[ Team LiB ]
6.4 Direct Synthesis Consider the standard feedback block diagram shown in Figure 6-1. Recall that we could determine the performance or stability of the closed-loop system from the closed-loop transfer function
Equation 6.6
In the direct synthesis procedure, we select a desired closed-loop response, gCL (s), and, based on the known process, gp(s), find the controller gc(s) that will yield this response. Solving Equation (6.6) for gc(s), we obtain
Equation 6.7
By now you should be able to perform block diagram manipulations to find the relationship between any external signal [such as a setpoint change, r(s)] and any other signal on the control block diagram. For example, it is important to analyze the manipulated variable action required for a setpoint change to make certain that it is not too rapid or that it does not violate constraints. From Figure 6-1 we can easily derive the effect of the setpoint change on the manipulated variable action,
Equation 6.8
The direct synthesis procedure then consists of specifying the desired closed-loop transfer function (e.g., first-order response, second-order underdamped, etc.), gCL (s), using Equation (6.7) to find the feedback controller, and considering the manipulated variable response (usually tested by simulation). The real question is: How do we specify the desired closed-loop response? It turns out that we are not limited by the desired closed-loop response, if the system is minimum phase (the process does not have RHP zeros or time delays—the terminology becomes clear in Chapter 7). In the following section we present the direct synthesis method for minimum-phase systems, and cover non-minimum-phase systems in the subsequent section.
Direct Synthesis for Minimum-Phase Processes It seems fairly natural to specify a desired closed-loop response that is first order, since we understand the characteristics of a first-order response.
Equation 6.9
For a specified first-order response, there is only one tuning parameter, , since we desire a closed-loop gain of 1 (we want the process output to equal the setpoint as the closed-loop system goes to a new steady state); small values of results in fast responses, while large values result in slow responses. One could also argue for a desired closed-loop response that is second order and underdamped, which would lead to specifying two parameters.
Example 6.2: Direct Synthesis For a First-Order Process Consider a first-order process
Equation 6.10
Assume that a first-order closed-loop response is specified. If we desire a fast closed-loop response, we make small; for a slower (more "robust") response, we make large. Solving for gc(s) from Equation (6.7), we find
Equation 6.11
which can be written (by multiplying by p/p)
Equation 6.12
Recall that the form of a PI controller is
Equation 6.13
so that our direct synthesis controller for a first-order process is simply a PI controller, where
Notice that there was only one "tuning parameter" for this direct synthesis example. The desired closed-loop time constant, , was the only adjustable parameter. Given the first-order transfer function parameters (kp and p) and the desired closed-loop time constant (), we found that the direct synthesis controller was PI, but that we only needed to "adjust" one PI parameter (kc). This is a nice result, because once we find the process time constant (p), we can set the integral time (I) equal to the time constant, and tune kc on-line until we achieve a desired response. Tuning a single controller parameter is much easier than tuning two or three.
Numerical Example Consider the following first-order process, with a time constant of 10 minutes and a process gain of 2 %/%
The output and manipulated variable responses for = 1, 5, and 10 min (I = 10; kc = 5, 1, and 0.5, respectively) are shown in Figure 6-5. As expected, the manipulated variable response for the faster desired closed-loop time constant is much more aggressive than for the slower closedloop time constants. Notice that setting the closed-loop time constant equal to the open-loop time constant ( = p = 10) results in a single step change in the manipulated variable action.
Figure 6-5. Response to a unit step setpoint change.
The same type of procedure shown in Example 6.2 can be used if a second-order closed-loop response is specified. See Exercise 13.
Direct Synthesis for Nonminimum-Phase Processes This section presents examples for nonminimum-phase processes, that is, processes that have time delays or RHP zeros. The general technique remains the same for these processes; however, there is a restriction on the type of closed-loop response that can be specified. The next example provides the motivation for specifying different desired closed-loop responses for systems with time delays.
Example 6.3: First-Order + Dead Time Example Consider the following process transfer function:
If the desired closed-loop response is first order, gCL (s) = 1/s + 1, the resulting controller is
which is a PI controller with an additional term (e3s). This additional term is not physically
realizable because it requires knowledge of future errors to obtain the current control action. This is clearly impossible. Perhaps this is shown more clearly in the time domain
where the control action at time t depends on the error at time t + 3, which is clearly impossible to implement. The next example shows how a system with a RHP zero must have a modified desired closed-loop response.
Example 6.4: Process with a RHP Zero Consider a process with the following transfer function, where the time unit is minutes
Equation 6.14
The direct synthesis procedure with gCL (s) = 1/s + 1 yields the controller
which is unstable because of the RHP pole. The RHP pole in the controller is due to the inversion of the process zero. This inversion occurs because of the specification of a first-order closed-loop response. The output and manipulated variable responses are shown in Figure 6-6 for = 5 minutes. Notice that the inverse response does not appear in the output variable but that the manipulated variable is unbounded (unstable). This is often called internal instability.
Figure 6-6. Response to a unit step setpoint change when the controller is unstable.
Clearly, the manipulated variable for any physical system will eventually hit a constraint, making the closed-loop system effectively open-loop, since the controller is no longer functioning. It is easy to understand the behavior shown in Figure 6-6. On a short timescale, the process appears to the controller to have a negative gain, since a step change in the manipulated variable yields an output that initially dips before going in the positive direction. The controller is acting on this effective "negative gain" to continually force the manipulated variable in a negative direction. The reader should verify that once the manipulated variable hits a lower bound, the process output will begin to decrease. Specifying a desired first-order closed-loop response for a system with a RHP zero resulted in an unstable controller and unbounded manipulated variable action. A stable controller can be obtained if the desired closed-loop response has the same RHP zero as the process.
Reformulation of the Desired Response Including the right-half-plane zero desired closed-loop transfer function specified as
using the direct synthesis procedure, you should find the following controller,
which is an ideal PID controller cascaded with a first-order filter. The parameters are
The output and input responses for a step setpoint change with = 5 minutes are shown in Figure 6-7. The closed-loop system has inverse response (as specified by the closed-loop transfer function) and reasonable manipulated variable action.
Figure 6-7. Responses to a unit step setpoint change at t = 0 minute, when RHP zero is in the desired response (• = 5).
[ Team LiB ]
[ Team LiB ]
6.5 Summary The closed-loop Ziegler-Nichols method (Table 6-1) was shown to lead to oscillatory closed-loop behavior, which is one of the major disadvantages to the approach. A major advantage to the approach is that a process model is not needed. Tyreus-Luyben parameters (Table 6-2) were shown to be less oscillatory and are generally recommended over the Ziegler-Nichols parameters. The open-loop Ziegler-Nichols (Table 6-3) and the Cohen-Coon (Table 6-4) methods also tend to lead to oscillatory closed-loop behavior; we have covered these approaches primarily for historical reasons. In the direct synthesis design procedure, a desired closed-loop response (or closed-loop transfer function) is specified. A feedback controller is then synthesized to obtain that response. We have seen that a PID-type controller often results. Some problems can arise if the process has a time delay or inverse response. In these cases, the desired closed-loop response must also have a time delay or inverse response. We develop a more transparent method for designing controllers for first-order + time-delay processes in Chapters 8 and 9. [ Team LiB ]
[ Team LiB ]
References The original Ziegler-Nichols parameters are developed in the following paper: Ziegler, J. G., and N. B. Nichols, "Optimum Settings for Automatic Controllers," Trans. ASME, 64, 759–768 (1942). The Cohen-Coon parameters are developed in the following paper: Cohen, G. H., and G. A. Coon, "Theoretical Considerations of Retarded Control," Trans. ASME, 75, 827 (1953). The Tyreus-Luyben parameters are presented in the following textbook: Luyben, M. L., and W. L. Luyben, Essentials of Process Control, McGraw-Hill, New York (1997). [ Team LiB ]
[ Team LiB ]
Student Exercises 1:
Consider the gas pressure problem shown below. The objective of this problem is to understand (via simulation) how the tuning parameters for a PI controller affect the stability and speed of response for setpoint changes or disturbances.
The relationship between the manipulated valve position (u in deviation variables) and the pressure in the second tank (y in deviation variables) is (with a time unit of minutes)
Assume that the dynamic behavior of the pressure measurement/transmitter is characterized by a first-order lag with a time constant of 9 seconds:
Also assume that the dynamic behavior of the control valve is also characterized by a first-order lag with a time constant of 6 seconds,
where c(s) is the output from the controller and u(s) is the valve position. For P-only control, find the value of kc (via simulation) that causes a closed-loop to go unstable. Call this value kcu , and call Pu the period of oscillation (time between peaks) when the system goes unstable. These values are used in the Ziegler-Nichols closed-loop oscillation method. a
a. Show that the value of kc sightly greater than that you obtained causes at least one root of the closed-loop characteristic equation [gCL (s)] to be positive. Find the P and PI tuning parameters on the Ziegler-Nichols closed-loop oscillations method. b. Compare the response of the two different controllers (P vs. PI), for step setpoint changes of 1 psig in the desired output (y). The closed-loop block diagram is shown below.
2:
Consider the following first-order + time-delay process:
Perform simulations for the process output and manipulated input for unit step changes in the setpoint.
a. Compare the closed-loop step response of this process using P-only control based on (i) Ziegler-Nichols closed-loop oscillations method, (ii) Ziegler-Nichols openloop method, (iii) Cohen-Coon, and (iv) Tyreus-Luyben tuning. b. Compare the closed-loop step response of this process using PI control based on (i) Ziegler-Nichols closed-loop method, (ii) Ziegler-Nichols open-loop method, (iii) Cohen-Coon, and (iv) Tyreus-Luyben tuning. c. Compare the closed-loop step response of this process using PID control based on (i) Ziegler-Nichols closed-loop method, (ii) Ziegler-Nichols open-loop method, (iii) Cohen-Coon, and (iv) Tyreus-Luyben tuning. Comment on the results for all of these tuning methods. 3:
Consider the process transfer function for the Van de Vusse reactor (Module 5).
Find the Ziegler-Nichols controller parameters for P, PI, and PID controllers for this process, based on the closed-loop oscillation method. Compare the responses of all three controllers to a step setpoint change. 4:
Most PID controller design procedures assume that a perfect derivative controller is used. For the process transfer function used in problem 3 above, and the ZieglerNichols closed-loop method, compare the responses of (i) ideal PID, (ii) real PID, and (iii) PID with ideal derivative action on the process output, rather than the error.
5:
Show that the following state space representation of a controller,
has the following transfer function representation:
where
6:
Consider the PID algorithm
where yf is a "filtered" value of the process output. Assuming that a first-order filter is used, with a time constant of f , write the modeling equations (differential and algebraic) to simulate the behavior of this controller. 7:
Apply (simulate) the Tyreus-Luyben parameters for PI and PID controllers to the following process
Compare these results with Cohen-Coon. Which do you recommend for implementation on a real process?
8:
Find the feedback controller for an integrating process, gp(s) = kp/s, assuming a desired first-order response using the direct synthesis method. Answer: It is a P-only controller, with kc = 1/kp
9:
Find the feedback controller for an integrating process, gp(s) = kp/s, assuming a desired second-order response Partial Answer: The controller is a first-order lag.
10:
Show that the direct synthesis procedure for the following process, assuming a desired first-order response, yields a PID controller
Find the PID tuning parameters if a closed-loop time constant of 5 minutes is desired. 11:
For a second-order system with numerator dynamics,
find a controller that gives a first-order closed-loop response. (Hint: It will be a PID with a first-order lag.) 12:
Consider the following first-order process:
If the desired closed-loop response to a setpoint change is second order with the following form,
find the feedback controller required, where and are adjustable tuning parameters (they are both positive). What type of controller is this? If the controller is PID form (perhaps with a lag), find each of the tuning parameters (kc, I, D, F). Show that > 0.5 is required for the controller to be stable. 13:
Consider a first-order process with a desired closed-loop response that is second order. Use the direct synthesis procedure with the following specified closed-loop transfer function (which is critically damped),
to derive the controller. Perform simulations for several values of and compare and contrast the closed-loop results with those shown in Figure 6-5.
[ Team LiB ]