PID spotlight, part 16: Closed loop tuning of an integrating process

Relay testing can be used to tune a new proportional-integral-derivative (PID) controller. What are the steps? What data do I collect? What calculations are required? How well will it work? What problems might I run into?

Traditional closed loop tuning of integrating processes is not recommended for several reasons:

  • There is a substantial risk of losing control of the process attempting to set up a continuous oscillation.
  • Open loop tuning is as fast or faster.
  • It can be nearly impossible to induce a swing in processes with little or no deadtime. Most levels, far and away the most common integrating process, have little deadtime.

Relay tuning, however, uses closed loop tuning concepts and calculations to estimate controller tuning constants and is safe and practical. There is also the chance that you may walk up on a controller that is swinging due to too much controller gain. If this happens, you can collect the data and estimate tuning constants. These will be approximations because this is not a proper test, but they will get you close.

Relay tuning method

Relay tuning is not strictly speaking closed loop tuning. However, like closed loop tuning relay tuning induces a swing in the process and calculates an ultimate gain (Ku) and natural period (Pn), but it does this by stepping the controller output (OP) up and down. You can do this manually, or you can write software to automate the process. As a result, relay tuning is generally quite safe.

The method is:

  • Verify the controller is lined out (no disturbances) and the process variable (PV) is on setpoint (SP).
  • Place the controller in manual.
  • Step the controller output (OP) up one-half of the desired full OP step size.
  • When the PV moves off SP move the OP down a full step.
  • When the PV crosses the SP move the OP up a full step.
  • Repeat until the PV achieves a full steady oscillation.
  • Write down:
    • The time between PV peaks – this is the natural period (Pn).The full output step size (OPs)
  • The peak-to-valley amplitude of the PV swing (Ka).
  • Calculate the ultimate gain (Ku).
  • Calculate the tuning constants.

Executing a relay tuning test

Figure 1 shows the automated relay testing of an integrating process with a process gain of 0.5%/minute, three lags of 30 seconds and no deadtime.

Figure 1: Estimating the swing amplitude (Ka) and natural period (Pn) required for closed loop tuning of an integrating process with a process gain (Kp) of 0.5%/minute, three lags (T1, T2, T3) of 30 seconds each and no deadtime (Dt). Courtesy: Ed Bullerdiek, retired control engineer
Figure 1: Estimating the swing amplitude (Ka) and natural period (Pn) required for closed loop tuning of an integrating
process with a process gain (Kp) of 0.5%/minute, three lags (T1, T2, T3) of 30 seconds each and no deadtime (Dt).
Courtesy: Ed Bullerdiek, retired control engineer

The vertical lines across the bottom are when the software detects a setpoint crossing. If you write your own software trending the crossing detection will help you troubleshoot problems.

The software automatically calculates the swing amplitude and natural period. These are:

Ka = 1.81

Pn = 328 seconds = 5.47 minutes

The OP step size was:

OPs = 5%

The ultimate gain is:

Ku = 3.51

Calculating tuning constants

Ziegler-Nichols tuning calculations for self-limiting processes do not work for integrating processes. However, there are two approximate relationships we can use to convert the open loop simplified integrating process PI tuning calculations we used in PID spotlight, part 14 for use with close loop (relay) test data.

Ku ~= 1.5 * Tfill / Dt

Pn ~= 4 * Dt

After the appropriate substitutions the calculations look like:

Table 1: Simplified integrating process PI tuning constant calculations for proportional-integral (PI) controllers. Courtesy: Ed Bullerdiek, retired control engineer
Table 1: Simplified integrating process PI tuning constant calculations for proportional-integral (PI) controllers. Courtesy: Ed Bullerdiek, retired control engineer

Example calculation 1

Based on the relay test results of our process with a gain of 0.5 %/minute and three 30 second lags the tuning constants are:

Table 2: Calculating simplified integrating process PI tuning constants for a process with a process gain (Kp) of 0.5 %/minute, three lags (T1, T2, T3) of 30 seconds and no deadtime (Dt). Courtesy: Ed Bullerdiek, retired control engineer
Table 2: Calculating simplified integrating process PI tuning constants for a process with a process gain (Kp) of 0.5 %/minute, three lags (T1, T2, T3) of 30 seconds and no deadtime (Dt). Courtesy: Ed Bullerdiek, retired control engineer

This same process was used as the first example in PID spotlight, part 14..As in PID spotlight, part 14 the second calculation (the override calculation) sets the controller gain and integral, telling us that this process will have stability problems at a higher controller gain. There are differences in the calculated results between the two methods, but this shouldn’t be surprising given that approximations were used to convert the calculations to use closed loop input data (see PID spotlight, part 14 Table 2).

Figure 2: Simplified integrating process PI tuning. Tuning constants are K = 1.05, Ti = 8.51 minutes/repeat, Td = 0 minutes. Courtesy: Ed Bullerdiek, retired control engineer
Figure 2: Simplified integrating process PI tuning. Tuning constants are K = 1.05, Ti = 8.51 minutes/repeat,
Td = 0 minutes. Courtesy: Ed Bullerdiek, retired control engineer

Figure 2 is very similar to PID spotlight, part 14 Figure 2 as we would expect. We have the same issues with the process variable (PV) overshooting the setpoint (SP) on a setpoint change and the size of the PV deviation from SP after a disturbance greatly exceeding the desired target. Furthermore, because the controller gain is higher (1.05 versus 0.70) we see more oscillation in the responses to a SP change and a disturbance. There is no great concern here as the secondary oscillation is minor.

Example calculation 2

Figure 3 shows the automated relay testing of an integrating process with a process gain of 0.1%/minute, three lags of 30 seconds and no deadtime. This illustrates a potential problem with relay testing of low gain processes; it can be very difficult to get a large enough swing to accurately detect SP crossings by the PV with an acceptable controller output (OP) step size. There will also be issues with estimating the swing amplitude size (Ka). If there is any appreciable process noise relay testing may be impossible.

Figure 3: Estimating the swing amplitude (Ka) and natural period (Pn) required for closed loop tuning of an integrating process with a process gain (Kp) of 0.1%/minute, three lags (T1, T2, T3) of 30 seconds each and no deadtime (Dt). Courtesy: Ed Bullerdiek, retired control engineer
Figure 3: Estimating the swing amplitude (Ka) and natural period (Pn) required for closed loop tuning of an
integrating process with a process gain (Kp) of 0.1%/minute, three lags (T1, T2, T3) of 30 seconds each and
no deadtime (Dt). Courtesy: Ed Bullerdiek, retired control engineer

The swing amplitude and natural period are:

Ka = 0.36

Pn = 328 seconds = 5.47 minutes

The OP step size was:

OPs = 5%

The Ultimate Gain is:

Ku = 17.68

When we put the new ultimate gain and natural period in the calculations we get:

Table 3: Calculating simplified integrating process PI tuning constants for a process with a process gain (Kp) of 0.1 %/minute, three lags (T1, T2, T3) of 30 seconds and no deadtime (Dt). Courtesy: Ed Bullerdiek, retired control engineer
Table 3: Calculating simplified integrating process PI tuning constants for a process with a process gain (Kp) of 0.1 %/minute, three lags (T1, T2, T3) of 30 seconds and no deadtime (Dt). Courtesy: Ed Bullerdiek, retired control engineer

This same process was used as the third example in PID spotlight, part 14. Unlike PID spotlight, part 14 both the controller gain and integral are set by the primary (top) calculation. In PID spotlight, part 14 the controller gain was set by the primary calculation, and the integral was set by the override calculation (see PID spotlight, part 14 Table 4).

Figure 4: Simplified integrating process PI tuning. Tuning constants are K = 2.5, Ti = 12.9 minutes/repeat, Td = 0 minutes. Courtesy: Ed Bullerdiek, retired control engineer
Figure 4: Simplified integrating process PI tuning. Tuning constants are K = 2.5, Ti = 12.9 minutes/repeat, Td = 0 minutes.
Courtesy: Ed Bullerdiek, retired control engineer

Figure 4 is a near copy of PID spotlight, part 14 Figure 4. It is the same process with nearly identical tuning constants (same controller gain and an integral of 12.9 minutes/repeat versus 10.4 from open loop tuning). The slower integral resulted in a slightly higher PV deviation from SP (3.49% versus 3.42%) and a slightly longer time to fully arrest the disturbance response (6:12 versus 5:55). There is nothing here that is unexpected.

In short, we have proven that we can convert open loop tuning calculations to closed loop tuning calculations using a couple of approximations and get very similar and, more importantly, functional controller tuning calculations.

Closed loop tuning tips

I do not recommend using traditional closed loop tuning in a live process environment. Pushing a process to the edge of stability is hazardous. If the process gets away from you there will be an incident. 

Relay tuning is preferred because it is much safer than traditional closed loop tuning. Relay tuning can be used to tune slow loops provided you write relay testing logic that will manage the test automatically. You can leave it running and do something else, however, the operator must be able to stop the test automatically in the event of an upset.

It may be impossible to use closed loop tuning (traditional or relay) on high fill time/deadtime ratio processes. It will take a very large controller output (OP) swing to achieve a continuous process variable (PV) swing that is detectable. For example, it requires a 30% peak to peak OP swing to achieve a 2% peak to peak PV swing if the ultimate controller gain is 15. This may cause unacceptable disturbances to associated processes.

Closed loop and relay tuning limitations

Slow control loops cannot be tested using the traditional closed loop method. They must be watched closely to make sure they do not go unstable. It may also be difficult to tell that a controller is going unstable and once it does it will take a long time to stop the oscillation. Slow loops can be tested using relay tuning if the process is automated.

Bad valves will warp the results. It may be impossible to start an oscillation at an acceptable amplitude when a valve has hysteresis and/or stiction. A bad valve will affect the estimate of ultimate gain and natural period; ultimate gain may be larger or smaller than actual and natural period will likely be longer. Assuming you can get a steady swing that is not just related to valve stick/slip action the tuning constants will likely fall within an acceptable range.

Process noise makes relay tuning difficult if not impossible. It becomes difficult to determine when the PV crosses the SP. Failure to change OP at the crossing time will yield a false natural period.

If you walk up to a control loop that is already swinging, you can use the closed loop tuning calculations if the controller is swinging because it has too much gain. A controller with integral will swing at a period greater than the natural period (Papparent > Pn). If the swing is caused by excess gain, then the apparent period will be only slightly higher than the natural period and can safely be used to calculate the integral tuning constant.

Ed Bullerdiek is a retired control engineer with 37 years of process control experience in petroleum refining and oil production. Edited by Mark T. Hoske, editor-in-chief, Control Engineering, WTWH Media, [email protected].

CONSIDER THIS

How does closed-loop (relay) tuning of an integrating process differ from that of self-limiting processes and how do the calculations differ? What new possible issues need to be considered when tuning an integrating process?

PID series from Ed Bullerdiek, retired control engineer

Part 1: Three reasons to tune control loops: Safety, profit, energy efficiency

PID spotlight, part 2: Know these 13 terms, interactions

PID spotlight, part 3: How to select one of four process responses

PID spotlight, part 4: How to balance PID control for a self-limiting process

PID spotlight, part 5: What does good and bad controller tuning look like?

PID spotlight, part 6: Deadtime? How to boost controller performance anyway

PID spotlight, part 7: Open-loop tuning of a self-limiting process

PID spotlight, part 8: Closed-loop tuning for self-limiting processes

PID spotlight, part 9: Heuristic tuning for a self-limiting process (part A on heuristic tuning)

PID spotlight, part 10: Heuristic tuning in a self-limiting process

PID spotlight, part 11: How a PID controller works with an integrating process

PID spotlight, part 12: What does good and bad controller tuning look like?

PID spotlight, part 13: Deadtime: what’s the best that I can do?

PID spotlight, part 14: Open loop tuning of an integrating process

PID spotlight, part 15: Open loop tuning of near integrating processes

Aug. 1 RCEP webcast available for one year: How to automate series: The mechanics of loop tuning

More on PID and advanced process control from Control Engineering.