How to tame unruly ramp function behavior

Lead/lag filters are better-suited for many loop control situations in which ramping blocks were presumed best, and are being used more frequently as an alternative to properly handle potential problems.

Ramp function behaviorBy Martin Emond, TopControl Inc.

RAMPING BLOCK devices are widespread in most PLCs as a built-in feature these days. The same goes for DCSs in the process field. This involves either ramping the setpoint from one operating point to another production rate, or limiting the rate of change of the controller output through the use of a ramp.

Most of the time, when people use a ramp device, they attempt to: 

  1. Avoid overshooting during a setpoint change
  2. Respect equipment constraints such as electrical (over-current), thermal or mechanical stress or
  3. Make a smoother transition from one operating point to another.

For any of these three approaches, we’ll see that lead/lag filter is a better alternative to properly handle potential problems. 

Avoid Overshoot During Setpoint Change
Wherever the ramp is located--either at the controller output or at the setpoint--there certainly will be an overshoot for a non-self-regulating process and a high potential of overshoot for a self-regulating process (higher potential for a lag-dominant process model) according to the tuning’s aggressiveness. This is what we see by looking at G2(s), G3(s) and G5(s): all of them are overshot (See Figure 1 below).

Simulation for a self-regulating and non-self-regulating process model

These performances are based on a simulation for a self-regulating and non-self-regulating process model. A ramped setpoint versus a step-changed setpoint going through a lead/lag filter has been applied. (Click image to enlarge.)

On the other hand, G1(s), which was step-changed through a lead/lag filter, not only is overshoot, but it reached the new setpoint faster with exactly the same tuning. Consequently, the ramp will postpone the setpoint response and make it overshoot. Thus, the first statement that leads people to use ramp happens to be unjustified for both self-regulating and non-self-regulating process types.

What is this lead/lag filter? This function often is available as a built-in device in most DCSs and PLCs on the market. It is a ratio between 0 and 1 of two time constants. One of them is the numerator and acts as the leader. The leader corresponds to the instantaneous portion of the step change applied to the controller. For instance, if the ratio is 0.7, then 70% of the step is instant or abrupt change and the other 30% goes through a first-order filter, which also is called lag.

The denominator is the lag, which is actually the time constant of a first-order filter. Generally, this filter time constant will match the tuning value of the integral action in the controller. This type of mechanism offers the best of the two worlds: no overshoot during setpoint change and fast load rejection.

Because of this lead/lag filter, tuning can be optimized for load disturbances without having any overshoot at all during a setpoint change. Furthermore, the load rejection will remain the fastest it can be during a load disturbance. Without a lead/lag filter, most people naturally tend to relax the tuning to avoid overshooting too much on a set-point change, or to use a ramp and get an overshoot of different magnitude depending on the tuning’s aggressiveness.

With a lead/lag filter, the excitation signal sent to the PID controller has a sharp break at the beginning, then the rest of the pattern is very smooth. In fact, it has the same shape as a first-order response. When using the ramp pattern, there are two abrupt changes: there is one at the beginning and a second one at the end when it reaches the new setpoint. The idea of a lead/lag function is to make a steep change at the beginning, when it is far away from the final value, then reduce the speed for the final approach. A two-degrees of freedom PID controller (Integral only on SP change) will produce similar results.

The settling time can be improved by a factor of two without overshoot when using a lead/lag filter. Settling time is defined as the time that has passed for both the process Value and controller Output to reach steady state and remain within the range of normal process noise.

The settling time is cut by a factor of two when using a lead/lag filter, as opposed to using a ramp applied on the set point or using a ramp limiter applied at the controller output, where this latter acts as a slew rate limiter.

In addition to lengthening the settling time by 100%, the ramp caused (in this example) an overshoot of 10%. If the aggressiveness of the tuning and the slope of the ramp are reduced to lessen the overshoot as close as possible to the minimum, then the settling time could be increased by a factor as high as four--a considerable amount. Consequently, with a ramp, the reduction of the overshoot during a set point change implies a significant increase of the settling time. On the other hand, the lead/lag filter does not create overshoot for either self-regulating or non-self-regulating processes.

Respect Equipment Constraints
There is a more appropriate approach to protecting equipment from being stressed, over-used or broken than using a ramp limiter at the PID output.

For example, if the stress is the result of a high heat flow rate phenomenon, then another controller could be acting as an override or constraint controller on the temperature differential between the two surfaces or two points. A constraint controller will override the valve through a low-select signal block. Since the stress from the heat is proportional to the heat flow, which is a consequence of the temperature differential between the two points, this constraint controller will take over by just the appropriate amount of output correction and avoid causing stress.

For other applications, a constraint controller also could be based on electrical current, pressure, level, density, etc. Here, instead of switching from a controller to a ramp limiter, the control is switched from one controller to another, which still is a linear device. A PID controller is defined as being a linear piece of equipment unless the output is saturated at either 0% or 100%, or any other external device would limit the controller output. On the other hand, a ramp limiter is a non-linear function block.

athematically, a linear function is defined as K*y = K*x. When the ramp limiter takes over the PID and prevents it from moving overly fast, then the equation becomes K*y  K*x+bias, and is not satisfied all the way through 0-100% any more. As a matter of fact, whenever a rule-based function such as “if X then conclude Y; else conclude Z” is being used in a control scheme, a non-linearity is inserted. When a non-linearity is present, the behavior of the closed-loop becomes harder to predict and definitely is different throughout the full range of the controller’s 0-100% output. In fact, this type of rule-based mechanism is most likely suitable when the process is so non-linear that an operator can beat the linear controller (PID) by manipulating the output in manual mode. Alternative types of controllers based on Fuzzy logic and Expert Systems then could be used to achieve better performance.

Smooth Transition From One Operating Point to Another
A ramp solution that makes the transition from one operating zone to another production rate smoother, is not as smooth as people would expect it to be. As we saw in Figure 1, the ramp creates an overshoot for a non-self-regulating process and likely produces the same on self-regulating process, depending on tuning’s aggressiveness, when looking at the process value (PV). But now, if we look at the output’s behavior (See Figure 2 below), the pattern exhibits sharp breaks (OUT2, OUT3 and OUT5) and all three of them involve a ramp device.

Output behavior patterns

Transitioning from one operating zone to another isn’t as smooth as it could be. The output behavior patterns exhibit sharp breaks (OUT2, OUT3 and OUT5) and all three involve a ramp device. (Click image to enlarge.)

What is so awful about a sharp break? Refer to the fundamental of frequency domain according to Fourier theorem: “Any signal can be synthesized by the sum of sinusoids of different frequencies that are multiple integer (harmonics) of the periodic signal to be reproduced.” In addition, as more sinusoids of high frequency are added, the synthesized signal will get sharper. For instance, to generate a square wave of 2 Hz, all odd multiple-integer frequencies (also called harmonics) of the square wave [(1x2Hz)+(3x2Hz)+(5x2Hz)+(7x2Hz)+(nx2Hz)…] will add to create the 2 Hz square wave. Moreover, the higher the frequencies, the sharper the corner of those square waves becomes. Therefore, based on Fourier Theory, during a setpoint ramping, those two sharp breaks will generate lots of high-frequency harmonics (many integer-multiple frequencies), which in turn will cause the controller to have a higher risk of oscillation. This is why those abrupt changes are so violent.

Why is the ramp effect worse on a non-self-regulating process than on one that is self-regulating? The non-self-regulating is, in other words, an integrating process. The downside of an integrating process type is that it will create more lag (i.e., an important phase shift). In fact, an integrating function causes a 90° phase shift. In theory, when two integrators are used back-to-back, a 180° phase shift takes place, since a perfect oscillator is being produced. In practice, a third integrator function might be required to obtain a perfect oscillator. Since a ramp can be reproduced mathematically by the integration of a step, that ramp could represent that third component needed for the oscillation to occur.

We began this article by saying that none of the three stated considerations for using a ramp--avoiding overshoot, respecting equipment constraints, or smoothing operating point transition-- are well-served by a ramp function. Moreover, a ramp will insert non-linearity, which is really not suitable in a regulatory control scheme using PID. Since a PID controller is a linear piece of equipment, and as long as this PID controller operates in a linear environment, its behavior will be predictable. Finally, a ramp will postpone the setpoint response and make it overshoot. So why would we use those ramp functions to turn something linear to non-linear, when there are many other means to achieve the same goal?

Lead/Lag Filter in an Hour
Depending on the controller, the implementation of a lead/lag filter might vary from one minute to one hour. Some DCSes have this feature as a built-in function in the PID controller. In that case, the only task that is left to do is to specify the lead value. The lag will inherit the same value as the integral time of the PID controller. In other cases, most DCSes and PLCs will have a lead/lag function available and minimum programming will be required to insert the block in the control scheme. Even if nothing exists, we can create programmatically the whole lead/lag tool within an hour.

  About the Author
Martin Emond is a registered professional engineer who specializes in process control optimization, audit, loop tuning, performance monitoring and training. Contact him at