In contrast to quantitative tuning procedures where definite numerical values for P, I, and D controller settings are obtained through data collection and analysis, a heuristic tuning procedure is one where general rules are followed to obtain approximate or qualitative results. The majority of PID loops in the world have been tuned with such methods, for better or for worse. My goal in this section is to optimize the effectiveness of such tuning methods.
When I was first educated on the subject of PID tuning, I learned this rather questionable tuning procedure:
The first three steps of this procedure are identical to the steps recommended by Ziegler and Nichols for closed-loop tuning. The last two steps are someone else’s contribution. The results of this method are generally poor, and I strongly recommend against using it!
While this particular procedure is crude and ineffective, it does illustrate a useful principle in trial-and-error PID tuning: we can tune a PID-controlled process by incrementally adjusting the aggressiveness of a controller’s P, I, and/or D actions until we see oscillations (suggesting the action has become too aggressive), then reducing the aggressiveness of the action until stable control is achieved. The “trick” to doing this effectively and efficiently is knowing which action(s) to focus on, which action(s) to avoid, and how to tell which of the actions is too aggressive when things do begin to oscillate. The following portions of this subsection describe the utility of each control action, the limitations of each, and how to recognize an overly-aggressive condition.
Much improvement may be made to any “trial-and-terror” PID tuning procedure if one is aware of the process characteristics and recognizes the applicability of P, I, and D actions to those process characteristics. Random experimentation with P, I, and D parameter values is tedious at best and dangerous at worst! As always, the key is to understand the role of each action, their applicability to different process types, and their limitations. The competent loop-tuner should be able to visually analyze trends of PV, SP, and Output, and be able to discern the degrees of P, I, and D action in effect at any given time in that trend.
Here is an improved PID tuning technique employing heuristics (general rules) regarding P, I, and D actions. It is assumed that you have taken all necessary safety precautions (e.g. you know the hazards of the process and the limits you are allowed to change it) and other steps recommended in the “Before You Tune . . .” section (30.2) beginning on page :
Note: the loop should never “porpoise” (see page ) when responding to a setpoint or load change! Some oscillation around setpoint may be tolerable (especially when optimizing the tuning for fast response to setpoint and load changes), but “porpoising” is always something to avoid.
Knowing which control actions to focus on first is a matter of characterizing the process (identifying whether it is self-regulating, integrating, runaway, noisy, has lag or dead time, or any combination of these traits based on an open-loop response test984) and then selecting the best actions to fit those characteristics. The following table shows some general recommendations for fitting PID tuning to different process characteristics
[tuning_recommendations]
General rules:
Once you have determined the basic character of the process, and understand from that characterization what the needs of the process will be regarding P, I, and/or D control actions, you may “experiment” with different tuning values of P, I, and D until you find a combination yielding robust control.
When performing heuristic tuning of a PID controller, it is important to be able to identify a condition where one or more of the “actions” (P, I, or D) is configured too aggressively for the process. The characteristic indication of over-tuning is the presence of sinusoidal oscillations. At best, this means damped oscillations following a sudden setpoint or load change. At worst, this means oscillations that never decay:
At this point, the question is: which action of the controller is causing this oscillation? We know all three actions (P, I, and D) are fully capable of causing process oscillation if set too aggressive, so in the lack of clarifying information it could be any of them (or some combination!).
One clue is the trend of the controller’s output compared with the trend of the process variable (PV). Modern digital control systems all have the ability to trend manipulated variables as well as process variables, allowing personnel to monitor exactly how a loop controller is managing a process. If we compare the two trends, we may examine the phase shift between PV and output of a loop controller to discern what it’s dominant action is.
For example, the following trend graphs show the PV and output signals for a loop controller with proportional-dominant response. Both direct- and reverse-acting versions are shown:
Since we know proportional action is immediate, there should be no phase shift985 between the PV and output waveforms. This makes sense from a mathematical perspective: if we substitute a sine function for the error variable in a proportional-only controller equation, we see that different gain values (\(K_p\)) simply result in an output signal of the same phase, just amplified or attenuated:
\[m = K_p e + b\]
\[m = K_p (\sin t) + b\]
If ever you see a process oscillating like this (sinusoidal waveforms, with the PV and output signals in-phase), you know that the controller’s response to the process is dominated by proportional action, and that the gain needs to be reduced (i.e. increase proportional band) to achieve stability.
Integral and derivative actions, however, introduce phase shift between the PV waveform and the output waveform. The direction of phase shift will reveal which time-based action (either I or D) dominates the controller’s response and is therefore most likely the cause of oscillation.
For example, the following trend graph shows the PV and output signals for a loop controller with integral-dominant response. Both direct- and reverse-acting versions are shown:
Here, the output waveform is phase-shifted 90\(^{o}\) behind (lagging) the PV waveform compared to what it would be by proportional action alone. This \(-90^{o}\) phase shift is most difficult to see for reverse-acting controllers, since the natural 180\(^{o}\) phase shift caused by reverse action makes the additional \(-90^{o}\) shift look like a \(+90^{o}\) shift (i.e. a \(-270^{o}\) shift). One method I use for discerning the direction of phase shift for reverse acting controllers is to imagine what the output waveform would look like for a proportional-only controller, and compare to that. Another method is to perform a “thought experiment” looking at the PV waveform, noting the velocity of the controller’s output at points of maximum error (when integral action would be expected to move the output signal fastest). In the previous example of an integral-dominant reverse-acting controller, we see that the output signal is indeed descending at its most rapid pace when the PV is highest above setpoint (greatest positive error), which is exactly what we would expect reverse-acting integration to do.
Mathematically, this makes sense as well. Integration of a sine function results in a negative cosine waveform:
\[-\cos t = \int \sin t \> dt\]
Another way of stating this is to say integration always adds a \(-90^{o}\) phase shift:
\[\sin (t - 90^{o}) = \int \sin t \> dt\]
If derivative action is set too aggressive for the needs of the process, the resulting output waveform will be phase-shifted \(+90^{o}\) from that of a purely proportional response:
Once again, the direction of phase shift is easiest to discern in the direct-acting case, since we expect the PV and output sine waves to be perfectly in-phase for proportional-dominant response. A \(+90^{o}\) phase shift is very clear to see in the direct-acting example because the peaks of the output waveform clearly precede the corresponding peaks of the PV waveform. The reverse-acting control example is more difficult due to the added 180\(^{o}\) of phase shift intrinsic to reverse action.
The derivative of a sine function is always a cosine function (or alternatively stated, a sine function with a \(+90^{o}\) phase shift):
\[\cos t = {d \over dt} \sin t\]
\[\sin (t + 90^{o}) = {d \over dt} \sin t\]
You may encounter cases where multiple PID terms are set too aggressively for the needs of the process, in which case the phase shift will be split somewhere between 0\(^{o}\) and \(\pm\) 90\(^{o}\) owing to the combined actions. In such cases one must “round up” or “round down” the phase shift to the nearest value of \(-90^{0}\), 0\(^{o}\), or \(+90^{o}\) in order to determine which of the three actions (I, P, or D, respectively) is most responsible for the oscillations.
An interesting case of over-tuning is when the process variable “porpoises986” on its way to setpoint following a step-change in setpoint. The following trend shows such a response:
[porpoising]
“Porpoising” is universally poor behavior for a loop, because it combines the negative consequences of over-tuning (instability and excessive valve travel) with the negative consequence of under-tuning (delay achieving setpoint). There is no practical purpose served by a loop “porpoising,” and so this behavior should be avoided if at all possible.
Thankfully, identifying the cause of “porpoising” is rather easy to do. Only two control actions are capable of causing this response: proportional and derivative. Integral action simply cannot cause porpoising. In order for the process variable to “porpoise,” the controller’s output signal must reverse direction before the process variable ever reaches setpoint. Integral action, however, will always drive the output in a consistent direction when the process variable is on one side of setpoint. Only proportional and derivative actions are capable of producing a directional change in the output signal prior to reaching setpoint.
Solely examining the process variable waveform will not reveal whether it is proportional action, derivative action, or both responsible for the “porpoising” behavior. A trial reduction in the derivative987 tuning parameter is one way to identify the culprit, as is phase-shift analysis between the PV and output waveforms during the “porpoising” period.