# Pros and cons of autotuning control: Part 1

## Proportional-integral-derivative (PID) controllers that can automatically select their own tuning parameters sound good but face challenges.

Although the industrial automation industry has, for the most part, adopted the proportional-integral-derivative (PID) algorithm as the de facto standard for closed-loop process control, the best means of tuning a PID loop to achieve optimal performance still is an open question. The exercise is conceptually simple: Choose the gain, rate, and reset parameters that define the relative magnitude of the P, I, and D contributions to the overall control effort.

However, loop tuning is more of an art than a science in practice. The best choice of tuning parameters depends on a variety of factors including the dynamic behavior of the controlled process, the performance objectives specified by the operator, and the operator’s understanding of how tuning works. A variety of manual techniques have been developed to help operators tune their loops, but even with the aid of loop-tuning software, loop tuning can be a difficult and time-consuming chore. See “Loop Tuning Fundamentals,” *Control Engineering*, July 2003.

“Autotuning” or “self-tuning” PID controllers are designed to simplify matters by choosing their own tuning parameters based on some sort of automated analysis of the controlled process’s behavior. These automatic procedures often involve a mathematical model of the process’s input/output relationship derived from process data augmented by information provided by an experienced operator (see Figure 1; see online extra section at bottom of article for a more detailed explanation of all figures).

“Self-tuning” refers to such procedures continuously executed while the controller is online regulating the process. “Autotuning” refers to on demand procedures executed while the controller is offline. However, the two terms often are used interchangeably because both self-tuning and autotuning controllers automatically tune themselves. For simplicity’s sake, both will be described as “autotuners” hereafter.

## Step tests

The most basic autotuners simply automate the manual tuning procedures an operator might otherwise perform when commissioning a loop: force a change in the control effort, observe the results, and adjust the tuning parameters accordingly. However, autotuners vary in how they execute those steps.

For example, a basic autotuner can perform a classical “step test” or “bump test” where the control effort is changed in a step-wise manner with feedback disabled. Theoretically, the process’s response to such a bump will provide sufficient information to characterize the process’s dynamic behavior, which in turn will dictate the appropriate tuning parameters. In practice, however, bumping a process just for the purpose of tuning the controller can be impractical in applications where fluctuations in the process variable must be minimized at all times (see Figure 2).

Some autotuners can avoid this problem by performing a step test while responding to a setpoint change. Because the process is going to be disturbed anyway, the controller can afford to apply a small bump to the process as it attempts to drive the process variable toward the new setpoint.

For example, refer to the back-to-back step tests shown in Figure 3. When a setpoint change is requested by the operator, the controller applies a 100% control effort (a positive step) then shuts down before the process variable reaches the new setpoint (a negative step). The controller then observes the fluctuations in the process variable to identify a mathematical model of the process’s behavior.

The process’s time constant can be derived either as shown in Figure 2 or from the interval between the controller’s shutdown and the point when the process variable begins to drop. The appropriate PID parameters can then be computed from the process deadtime, gain, and time constant using any number of tuning rules plus the operator’s preference for closed-loop performance. After the tuning is complete, the controller can resume normal closed-loop control operations to bring the process variable the rest of the way to the setpoint.

## Noise and disturbances

While conceptually simple, step tests can be a challenge to automate. The results will be skewed if a disturbance happens to intrude on the process variable while the test is in progress. An experienced operator performing a manual step test can generally recognize a disturbance in progress and either wait to start the test or restart it as necessary. Endowing an autotuner with similar observational skills is much trickier.

That problem is particularly acute when the process variable is subject to measurement noise. An autotuner can’t always distinguish between phantom noise and real disturbances. And even when it can, the measurement noise might still corrupt the calculation of the process model by obscuring the exact shape of the reaction curve.

Some autotuners can deal with measurement noise by executing their automatic step tests more than once and then averaging the results or selecting the results that turn up most often. A sophisticated autotuner also can calculate how well its estimates of the process model fit the noisy data and either report how confident it is in its latest results or repeat the test until it reaches an operator-defined confidence level.

## Heuristic tuning

But even with such enhancements, autotuners are generally not very accurate. Operators often take an autotuner’s results as recommendations that require further refinement by traditional trial-and-error tuning techniques.

It comes as no surprise, then, some autotuners have incorporated trial-and-error tuning into their algorithms. In fact, heuristic reasoning was one of the first autotuning techniques to be embedded in a commercial PID controller. Refer to “Techniques for Adaptive Control” (ISBN 978-0-7506-7495-9).

Heuristic autotuners skip the process modeling operations that are so hard to get right. Instead, they rely on measurements of the process’s open-loop or closed-loop performance, such as the period of oscillation, overshoot, and damping of the disturbance or setpoint response.

The controller’s PID parameters are then derived from those performance measurements by means of tuning rules that mimic an experienced operator’s heuristic tuning technique. It’s a pattern-recognition algorithm that tweaks the controller’s tuning parameters just the way an experienced operator might.

## Still no panacea

But there are drawbacks to automated heuristic tuning as well. If the patterns of process behavior the autotuner is trained to recognize don’t occur, or if the process behaves in an entirely unexpected manner, the autotuner won’t know what to do. A heuristic autotuner relying on fuzzy logic or artificial intelligence to record an operator’s experience can be re-trained to recognize new patterns, but an experienced operator still has to help because it can’t be done automatically most of the time.

Heuristic tuning also can take a long time and several iterations to reach a final result. Heuristic autotuners tend to be conservative about how much and how often they tweak their tuning parameters lest they should end up overdoing it.

This article continues in the August 2018 issue of *Control Engineering* with a look at some of the more elaborate and mathematically complex approaches to automatic loop tuning.

## MORE ANSWERS

**KEYWORDS:** PID, autotuning

**The best means**of tuning a proportional-integral-derivative (PID) loop to achieve optimal performance is still an open question.**In practice**, loop tuning is more of an art than a science.**The most basic**autotuners automate the manual tuning procedures an operator might otherwise perform when commissioning a loop.

## CONSIDER THIS

**How well** do the autotune controllers in your plant control your processes?

## ONLINE extra

See related articles about PID control linked below.

## Figure explanations

Figure 1: An autotuning proportional-integral-derivative (PID) controller measures the process’s input (the control effort) and output (the process variable), then updates its own tuning parameters so as to meet the operator’s closed-loop performance specifications. The best way to do so remains an open question. Courtesy: *Control Engineering*, CFE Media

Figure 2: For a step test, the controller is taken offline and the control effort is increased abruptly by a known amount. The resulting shape of the process variable’s trend chart, also known as the “reaction curve,” can be analyzed to determine a mathematical model of the process’s behavior. The model can then be translated into tuning parameters for the controller to use when it is subsequently brought back on line. In this case, the deadtime ** d**, time constant

**, and gain**

*T***of the process model can be translated into the gain, rate, and reset parameters of a PID controller. Some autotuning controllers can perform such a step test and calculate their own tuning parameters automatically. Courtesy:**

*K**Control Engineering*, CFE Media

Figure 3: For some applications where the process behaves in a very predictable manner, a slight detour in a setpoint change is sufficient to identify the behavior of the process. An autotuner performing a setpoint response test interrupts the controller’s initial response to a setpoint change to conduct two step tests: one positive and one negative. After one complete oscillation of the process variable, the autotuner can compute a new set of tuning parameters then reactivate the PID algorithm. By the time the process variable reaches the setpoint, the controller will have been tuned to produce the closed-loop behavior specified by the operator in terms of rise time, percent overshoot, settling time, etc. Courtesy: *Control Engineering*, CFE Media

Do you have experience and expertise with the topics mentioned in this content? You should consider contributing to our CFE Media editorial team and getting the recognition you and your company deserve. Click here to start this process.