Getting More Information from Relay-Feedback Tests - American

The relay-feedback test is a simple and widely used identification tool for obtaining dynamic information that is useful for tuning feedback controlle...
7 downloads 0 Views 373KB Size
Ind. Eng. Chem. Res. 2001, 40, 4391-4402

4391

Getting More Information from Relay-Feedback Tests William L. Luyben† Department of Chemical Engineering, Lehigh University, Bethlehem, Pennsylvania 18015

The relay-feedback test is a simple and widely used identification tool for obtaining dynamic information that is useful for tuning feedback controllers. The height of the change in the manipulated variable h is specified, the test is run, and two parameters are normally obtained: the amplitude of the periodic output curve a (from which the ultimate gain Ku can be calculated) and the ultimate period Pu. These two parameters provide important information, but they are not sufficient for determining controller tuning for some processes, the most important being processes with large deadtimes. Many authors have suggested methods for extending this type of test in order to obtain additional information: run an additional step test, run a second relayfeedback test with a known dynamic element inserted in the loop, etc. This paper discusses the idea of avoiding these additional tests by simply looking at the shape of the output curve. Firstorder processes with small deadtime-to-time constant ratios (D/τ) give output curves that are triangular in shape. Large ratios yield curves that are a series of rectangular pulses. A simple characterization factor is proposed for quantifying the curve shape. This additional shape information can be used to determine all three parameters of a first-order/deadtime process (gain, deadtime, and time constant) from one relay-feedback test. Introduction Since its introduction almost 20 years ago by Astrom and Hagglund,1 the relay-feedback test has gained wide popularity with process-control practitioners. The simplicity and reliability of the method make it a very useful tool for obtaining dynamic information for feedback controller tuning. Many papers have appeared that discuss applications, extensions, and modifications of the basic method. Progress up to 1999 has been documented in the book by Yu.2 The conventional relay-feedback test consists of inserting a relay of height h in the feedback loop. This height (typically 5-10% of the controller-output scale) is the only parameter that is specified. The loop starts to oscillate around the setpoint, with the controller output switching every time the process-variable (PV) signal crosses the setpoint. The maximum amplitude of the PV signal (a) is used to calculate the ultimate gain Ku using eq 1. The period of the output PV curve

Ku ) 4h/aπ

(1)

is the ultimate period Pu. From these two parameters, controller tuning constants can be calculated for proportional-integral (PI) or proportional-integral-derivative (PID) controllers, using a variety of tuning methods proposed in the literature that require only the ultimate gain and ultimate frequency, e.g., ZieglerNichols (ZN), Tyreus-Luyben (TL), etc. The test has many positive features (Yu2) that have led to its widespread use: 1. Only one parameter has to be specified (relay height). 2. The time it takes to run the test is short, particularly compared to the extended periods required for methods such as pseudo-random binary sequence (PRBS). 3. The test is a closed loop, so the process is not driven away from the setpoint. †

E-mail: [email protected].

4. The information obtained is quite accurate in the frequency range that is important for the design of a feedback controller (the ultimate frequency). 5. The impact of load changes that occur during the test can be detected by the change to asymmetric pulses in the manipulated variable. All of these features make relay-feedback testing a useful identification tool. However, using the test in the normal way only gives two parameters. Many authors have demonstrated that knowing only the ultimate gain and the ultimate frequency is insufficient to be able to arrive at effective controller tuning constants for some processes. The most important are processes with large deadtimes. Some additional information about the deadtime is needed. There have been many methods proposed for obtaining this additional information. Li et al.3 suggested using two relay tests: one conventional and a second with a known dynamic element inserted in the loop. Friman and Waller4 proposed using a two-channel relay to distinguish among various classes of processes, primarily those with small deadtimes and those with large deadtimes. Marchetti and Scali5 reviewed two alternative testing methods and gave guidelines for tuning advanced controllers. The purpose of this paper is to suggest that additional tests or tests more complex than the conventional relay test may not be necessary if we use some information that is available from the single test. This information is the shape of the resulting output curves. Curve Shapes The observation that different processes yield differently shaped curves during the relay-feedback test is certainly not new. In a review of autotuning, Astrom6 suggested that much more information can be extracted from the wave form. Similar comments occur in work by Friman and Waller.7 However, it appears that this notion has not been quantitatively used to aid in the identification process. That is the goal of this paper.

10.1021/ie010142h CCC: $20.00 © 2001 American Chemical Society Published on Web 09/01/2001

4392

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001

Figure 1. Relay-feedback test responses for first-order processes with different deadtimes.

Figure 3. Shapes for different transfer functions. Figure 2. Curvature factor.

Figure 1 conveys the basic idea. Similar figures were given by Friman and Waller.7 The process is a firstorder lag, gain, and deadtime.

Kpe-Ds G) τs + 1

(2)

When this process is subjected to a relay-feedback test, the shape of the resulting output curve depends on the D/τ ratio. Small ratios correspond to a process with a large time constant. In the limit as the ratio goes to zero, this is essentially a pure integrator. The step response

of an integrator is a ramp. Therefore, a small D/τ ratio process response curve in a relay-feedback test is a series of up and down ramps. This characteristic shape tells us that a simple integrator-deadtime transfer function can be used to describe the process dynamics.

G ) (1/τ)e-Ds/s

(3)

This is the type of process (large time constants or small deadtimes) for which the Tyreus-Luyben8 tuning method is intended. Therefore, TL tuning should work well if the shape of the output curve of a relay-feedback test is triangular in shape.

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001 4393 Table 1. First-Order Process deadtime 0.1 Relay-Feedback Test Pu 0.382 a 0.0952 b 0.0488 Ku 13.4 F ) 4b/Pu 0.511 IMC ZN TL

Figure 4. Relationship between the curvature factor and the deadtime/time constant ratio.

At the other extreme, when the deadtime is very large, the lag is negligible. The response of a pure deadtime to a step input is just a step delayed in time. Therefore, a large D/τ ratio process response curve is a series of rectangular pulses. This characteristic shape tells us that a simple gain-deadtime transfer function can be used to describe the process dynamics.

G ) Kpe-Ds

(4)

A tuning method that works well for a deadtime process should be used when the relay-feedback curves are rectangular pulses.

λ Kc τI Kc τI Kc τI

Tuning Constants 0.2 5.25 1.05 6.09 0.318 4.19 0.840

1

10

2.98 0.632 0.620 2.01 0.832

21.4 1.0 9.31 1.27 1.74

1.7 0.882 1.5 0.914 2.48 0.628 6.56

17 0.353 5.5 0.577 17.8 0.397 47.1

In the middle range, the first-order process described by eq 1 gives an exponential response whose curvature depends on the D/τ ratio. The larger the ratio, the faster the exponential curve rises. The smaller the ratio, the more ramplike the response is. Thus, the shape of the curve can be used to tell us what type of process we are dealing with. Of course, what is needed is a way to quantify this curvature. Curvature Parameter There are many ways to quantify the shapes of curves. These methods vary from the simple to the complex. Figure 2 presents one simple way that is easy to apply and appears to work fairly well. The height of the peak in the curve above the steady-state value is a. The proposed procedure is as follows:

Figure 5. Comparison of the tuning method for the first-order process with D/τ ) 0.05.

4394

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001

Figure 6. Comparison of the tuning method for the first-order process with D/τ ) 0.1.

Figure 7. Comparison of the tuning method for the first-order process with D/τ ) 1.

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001 4395

Figure 8. Comparison of the tuning method for the first-order process with D/τ ) 10.

Figure 9. Relay-feedback test responses for third-order processes with different deadtimes.

4396

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001

Figure 10. Comparison of the tuning methods for the third-order process with D/τ ) 0.1.

Figure 11. Comparison of the tuning methods for the third-order process with D/τ ) 1.

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001 4397

Figure 12. Comparison of the tuning methods for the third-order process with D/τ ) 10.

Figure 13. Relay-feedback test responses for inverse-response processes with different deadtimes.

4398

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001

Figure 14. Relay-feedback test responses for open-loop unstable processes with different deadtimes. Table 2. Third-Order Process

Table 3. Open-Loop Unstable Process deadtime

0.1

IMC ZN

1

deadtime 10

0.1

Relay-Feedback Test Pu 4.1 7.0 a 0.026 0.066 Ku 49.0 19.3 F ) 4b/Pu 0.59 0.64

25 0.125 10.3 1.45

Kp τ D

Approximate Transfer Function 0.161 0.284 5.11 5.97 1.11 1.96

0.121 2.98 9.95

λ Kc τI Kc τI

Tuning Constants 1.88 18.6 5.66 22.3 3.42

3.33 7.39 6.95 8.77 5.83

16.9 3.88 7.96 4.63 20.8

Relay-Feedback Test Pu 0.43 a 0.12 Ku 10.6 F ) 4b/Pu 0.5

IMC ZN TL

1. Draw a vertical line at time t2 that goes through the peak in the curve. 2. Draw a horizontal line at a/2. 3. Draw a vertical line at time t1 that goes through the intersection of the horizontal line drawn in step 2. 4. The time period t2 - t1 is defined as the parameter b.

b ) t2 - t1

(5)

5. Calculate a curvature factor F, which is a quantitative measure of the curvature.

F ) 4b/Pu

0.2

0.3

0.9 0.22 5.79 0.5

1.5 0.33 3.86 0.5

Approximate Transfer Function Kp 2.64 4.84 τ 1.93 4.01 D 0.111 0.230

7.26 6.69 0.384

Tuning Constants 0.386 1.95 1.98 4.82 0.358 3.32 0.946

1.34 0.708 6.88 1.75 1.25 1.21 3.3

λ Kc τI Kc τI Kc τI

0.802 1.06 4.12 2.63 0.75 1.81 1.93

A. Integrator Process. For example, if the curve is a series of ramps (triangular shape), the slope of the curve is constant. It takes half a period to go from the lower peak to the upper peak. It takes one-quarter of a period to go from the steady-state output value (zero in the curves in Figure 3) to the peak. Thus, it takes oneeighth of a period to go from time t1 to time t2 if the curve is a ramp. So for a pure integrator-deadtime process, the parameter b has a value of 1/8Pu and the curvature parameter F is equal to 0.5.

(6)

This curvature parameter tells us how rectangular or how triangular the curve is.

F)

4b 4(Pu/8) 1 ) ) Pu Pu 2

(7)

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001 4399

Figure 15. Comparison of the tuning methods for the unstable process with D/τ ) 0.1.

Figure 16. Comparison of the tuning methods for the unstable process with D/τ ) 0.2.

B. Deadtime Process. At the opposite extreme, when the process is a pure deadtime and the curves are

rectangular pulses, the times t2 and t1 differ by a full half period. So b ) Pu/2 and the curvature factor is

4400

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001

Figure 17. Comparison of the tuning methods for the unstable process with D/τ ) 0.3.

F)

4b 4(Pu/2) ) )2 Pu Pu

(8)

Thus, the range of the curvature factor for a first-order/ deadtime process is between 0.5 and 2. This F curvature factor provides a simple way to quantify the shape of the output curve from a relay-feedback test. C. Correlation between F and D/τ. Table 1 gives values for the parameters a, b, Pu, Ku and F over a wide range of deadtime/time constant ratios. We can relate the curvature factor F to the D/τ ratios. The coefficients of a third-order polynomial can be calculated by selecting four points: D/τ ) 0.1, 1, 10, and 100 (we assume F ) 2 at D/τ ) 100). 2

log(D/τ) ) -5.2783 + 12.7147F - 9.8974F + 2.6788F3 (9) Figure 4 gives a plot showing the dependence of the deadtime/time constant ratio on the curvature factor. Thus, knowing F from the relay-feedback test permits us to calculate this ratio. Calculation of Parameters The conventional approach for using the results of a single relay-feedback test is to employ a controller tuning method that uses only the ultimate gain and ultimate frequency parameters. An alternative is to fit a two-parameter dynamic model (the time constant and deadtime in a deadtime-integrator model; see eq 3), using the two known experimental parameters. With the use of the curvature factor, the relayfeedback test produces three parameter values: ultimate gain Ku, ultimate period Pu, and curvature factor

F. There are three parameters in a first-order/deadtime process: gain Kp, time constant τ, and deadtime D. Thus, it is possible to calculate all three parameters. This permits the use of controller tuning methods that require all three process parameters. The first-order/deadtime process transfer function given in eq 2 can be expressed as a complex function in the frequency domain with an argument and magnitude.

arg G(iω) ) arg

(

|G(iω)| )

)

Kpe-iωD ) -ωD - arctan(ωτ) 1 + iωτ

|

|

Kpe-iωD ) 1 + iωτ

Kp

x1 + (ωτ)2

(10)

At the ultimate frequency ωu, the argument is equal to -π radians and the magnitude is equal to the reciprocal of the ultimate gain.

argG(iωu) ) -ωuD - arctan(ωuτ) ) -π |G(iωu)| )

Kp

x1 + (ωuτ)

) 2

1 Ku

(11) (12)

The proposed identification procedure is as follows: 1. Run a relay-feedback test. 2. Pick off values of a, b, and Pu. 3. Calculate ωu ) 2π/Pu. 4. Calculate Ku from eq 1. 5. Calculate F from eq 6. 6. Calculate the D/τ ratio from eq 9. Call this known numerical value R.

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001 4401

7. Substitute D ) Rτ in eq 11. This gives one equation with one unknown (τ). 8. Solve iteratively for τ. Then calculate D ) Rτ. 9. Calculate Kp from eq 12. This gives all three of the process parameters.

Up to now we have only considered first-order lag processes with deadtime. Of course, not all processes can be modeled in this way. So it is important to see if the proposed method of using the curvature factor to calculate the three parameters can be applied to other types of processes.

Controller Tuning There are dozens of controller tuning methods. We illustrate the use of three: ZN,8 TL,9 and IMC.10 The first two use only two parameters (Ku and Pu). The last requires all three parameters of the process transfer function (gain Kp, time constant τ, and deadtime D). The ZN tuning equations for a PI controller are

Application to Other Types of Processes A. Third-Order/Deadtime Process. A third-order lag process with deadtime is used to further test the proposed method.

G)

Kc ) Ku/2.2 τI ) Pu/1.2

(13)

These rules were intended to optimize the load response of lag-dominant processes. The IMC tuning equations for a PI controller are

λ ) max (1.7D, 0.2τ) K cKp )

2τ + D 2λ

τI ) τ + D/2

(14)

The TL tuning equations for a PI controller are

Kc ) Ku/3.2 τI ) 2.2Pu

(15)

These were derived for a pure integrator-deadtime process, so they should work well when the curvature factor is close to F ) 0.5. Table 1 gives parameter values and tuning constants for various deadtime/time constant ratios and tuning methods. All of these results have been calculated from relay-feedback test results, not from solving rigorously for the ultimate gain and ultimate frequency directly from the transfer function. The effectiveness of these tuning rules is evaluated in the following section for a wide range of deadtime/time constant ratios. Results for a First-Order/Deadtime Process Figure 1 gives relay-feedback test results for a firstorder lag process with Kp ) τ ) 1 for deadtimes of D ) 0.1, 1, and 10. The values of the various parameters calculated from these three tests are given in Table 1. Figure 5 gives the responses of a first-order lag process with a small deadtime/time constant ratio (D/τ ) 0.05). The disturbance is a unit step in setpoint at a time equal to zero. The ZN settings give a large overshoot and are probably too aggressive for most chemical engineering applications. With the IMC tuning rules used in eq 14, the response is somewhat sluggish. The TL settings work well. Figure 6 gives results for D/τ ) 0.1. The ZN results are still aggressive. The IMC and TL results are similar. Figure 7 gives results for D/τ ) 1. Now the IMC results are the best. The ZN settings are fairly good, but the TL settings give a sluggish response. In Figure 8 D/τ is increased to 10. The IMC results are much superior. Both the ZN and TL results are much too sluggish.

(1/8)e-Ds (s + 1)3

(16)

Figure 9 shows the relay-feedback test responses of this process for three different deadtimes. There is little noticeable difference in the shapes of the curves for the small and intermediate deadtimes. First-order processes have response curves that show an abrupt change when subjected to a step change in input. The derivative is discontinuous at the time the step is made. Higher-order processes have continuous first derivatives, so the relayfeedback test responses have rounded peaks instead of sharp peaks. The deadtime must be quite large before the curves start to take on a rectangular appearance. Amplitude increases as deadtime increases. Table 2 gives parameter values for this third-order system. The three parameters from the relay-feedback test (Pu, Ku, and F) are used to calculate the three parameters in a first-order/deadtime transfer function (Kp, D, and τ). What we are doing is assuming that a first-order/ deadtime model can be used to fit this process, which is really third order. For example, for a deadtime of 1, the real process is

G)

(1/8)e-s (s + 1)3

(17)

The relay-feedback test gives F ) 0.64, Ku ) 19.3, and Pu ) 7. From these parameters, the approximate transfer function is

G)

Kpe-Ds 0.284e-1.96s ) τs + 1 5.97s + 1

(18)

Then IMC settings are calculated using this approximate transfer function. Figures 10-12 show that the IMC settings compare favorably with the ZN settings over the entire range of deadtime. They are much better for large deadtimes. These results indicate that using the shape of the response curves, even for a higher order system, provides the additional information that permits the design of more effective feedback controllers. B. Inverse Response/Deadtime Process. The proposed method does not work for processes with strong inverse response. As shown in Figure 13, the relayfeedback response of a process with inverse response displays some interesting humps and curves. These figures were generated using the transfer function

G)

(-τzs + 1)e-Ds (s + 1)2

(19)

4402

Ind. Eng. Chem. Res., Vol. 40, No. 20, 2001

where +1/τz is the positive zero. The larger τz, the more irregular the shape. Note that the presence of inverse response can be detected in the initial response of the process to the first step change in the input from the relay. If inverse response is detected, the proposed identification method should not be used. For inverse response processes, the value of the curvature parameter F can actually be less than the 0.5 limit for the firstorder case. Tuning of processes with both deadtime and inverse response is discussed in Luyben.11 C. Open-Loop Unstable/Deadtime Process. The relay-feedback test can be used on some open-loop unstable processes if the deadtime is not too large. Consider the system with the transfer function

G)

e-Ds τs - 1

(20)

The practical limit for a proportional control to be able to stabilize this type of process is a D/τ ratio of about 0.6. So relay-feedback tests will not work near this limit. Figure 14 gives relay-feedback test results for three values of deadtime. With these small deadtimes, the response curves have an almost triangular shape of an integrator-deadtime process but with a slight upward curvature. Assuming F ) 0.5, the approximate model parameters are calculated and controller tuning constants are determined for the IMC, ZN, and TL methods. Results are given in Table 3. Figure 15 gives results for D/τ ) 0.1. The ZN tuning is a little aggressive. With the IMC tuning rules used in eq 14, the response is somewhat sluggish. The TL tuning works best. Note the large overshoot with all of the tuning methods. This is an inherent feature of openloop unstable systems. A proportional-only controller results in a negative steady-state offset; i.e., the change in the process variable is greater than the change in the setpoint. When the D/τ is increased to 0.2, Figure 16 shows that the ZN and TL settings still work, but the IMC settings yield poor control. Finally Figure 17 shows that control becomes marginal (oscillatory) with either ZN or TL tuning. The IMC settings gave an unstable response. The overshoot and settling time increase as the deadtime increases. At a deadtime of 0.4, neither of the PI controllers gives a stable closed-loop system. These results indicate that the IMC tuning rule (eq 14), based on an approximate stable first-order plus deadtime model derived from considering the curvature factor, does not provide effective control for open-loop unstable systems. Conclusions The shapes of the response curves of a relay-feedback test contain useful information. They are particularly useful in telling us if the process has small or large deadtimes. A simple identification method is proposed that provides approximate models for processes that can be described by a first-order lag with deadtime. The technique also works on some higher-order systems, but it is not effective for inverse-response processes because of the more complex curvature of the responses. It is not effective for open-loop unstable processes. The

method would probably not be effective for systems with small signal-to-noise ratios unless the output curves could be filtered to permit reading the parameter values from the response curves. A quantitative parameter for describing the shape of the response curve is suggested. The curvature factor is simple to calculate and effective for first-order systems. There are, of course, many other possible approaches. There may be more general characterization methods that would handle a wider variety of processes and could lead to a more generally applicable tuning procedure. This is an area of future work. Nomenclature a ) amplitude of output response b ) t2 - t1, measure of the curve width D ) deadtime F ) curvature factor ) 4b/Pu G ) process transfer function IMC ) internal model tuning Kc ) controller gain Kp ) process steady-state gain Ku ) ultimate gain M ) manipulated variable Pu ) ultimate period s ) Laplace transform variable t1 ) time when the output reaches half of the peak magnitude t2 ) time when the output reaches the peak magnitude TL ) Tyreus-Luyben tuning Y ) controlled variable ZN ) Ziegler-Nichols tuning τ ) process open-loop time constant τI ) controller integral time τz ) positive zero time constant ωu ) ultimate frequency (rad/time)

Literature Cited (1) Astrom, K. J.; Hagglund, T. Automatic Tuning of Simple Regulators with Specifications on Phase and Amplitude Margins. Automatica 1984, 20, 645. (2) Yu, C. C. Autotuning of PID Controllers; Springer: London, 1999. (3) Li, W.; Eskinat, E.; Luyben, W. L. An Improved Autotune Indentification Method. Ind. Eng. Chem. Res. 1991, 30, 1530. (4) Friman, M.; Waller, K. V. A Two-Channel Relay for Autotuning. Ind. Eng. Chem. Res. 1997, 36, 2662. (5) Marchetti, G.; Scali, C. Ind. Eng. Chem. Res. 2000, 39, 3325. (6) Astrom, K. J. Automatic Tuning and Adaptive ControlsPast Accomplishments and Future Directions; Shell Process Control Workshop; Butterworth: Boston, 1988. (7) Friman, M.; Waller, K. V. Autotuning of Multiloop Control Systems. Ind. Eng. Chem. Res. 1994, 33, 1708. (8) Ziegler, J. G.; Nichols, N. B. Optimum Settings for Automatic Controllers. Trans. ASME 1942. (9) Tyreus, B. D.; Luyben, W. L. Tuning PI Controllers for Integrator-Deadtime Processes. Ind. Eng. Chem. Res. 1992, 31, 2625. (10) Morari, M.; Zafiriou, E. Robust Process Control; PrenticeHall: Englewood Cliffs, NJ, 1989. (11) Luyben, W. L. Tuning Proportional-Integral Controllers for Processes with Both Inverse Response and Deadtime. Ind. Eng. Chem. Res. 2000, 39, 973.

Received for review February 12, 2001 Revised manuscript received June 20, 2001 Accepted July 17, 2001 IE010142H