Showing posts with label action. Show all posts
Showing posts with label action. Show all posts

Integral (Reset) Windup, Jacketing Logic and the Velocity PI Form




A valve cannot open more than all the way. A pump cannot go slower than stopped. Yet an improperly programmed control algorithm can issue such commands.

Herein lies the problem of integral windup (also referred to as reset windup or integral saturation). It is a problem that has been around for decades and was solved long ago. We discuss why it occurs and how to prevent it to help those who choose to write their own control algorithm.

The PI Algorithm
To increase our comfort level with the idea that different vendors cast the same PI algorithm in different forms, we choose the independent, continuous, position PI form for this discussion:

12.jpg

Where:
CO = controller output signal (the wire out)
CObias = controller bias or null value
e(t) = current controller error, defined as SP - PV
SP = set point
PV = measured process variable (the wire in)
Kc = proportional gain, a tuning parameter
Ki = integral gain, a tuning parameter

Note that Kc is the same parameter in both the dependent and independent forms, though it is more typically called controller gain in the dependent form.

Every procedure and observation we have previously discussed about PI controllers applies to both forms. Both even use the same tuning correlations. To tune Ki, we compute Kc and Ti for the dependent form and then divide (Ki = Kc/Ti).

Integral (Reset) Windup
Our previous discussion of integral action noted that integration is a continual summing. As shown below, integration of error means that we continually sum controller error up to the present time.

13.jpg

The integral sum starts accumulating when the controller is first put in automatic and continues to change as long as controller error exists.
If an error is large enough and/or persists long enough, it is mathematically possible for the integral term to grow very large (either positive or negative):

14.jpg

This large integral, when combined with the other terms in the equation, can produce a CO value that causes the final control element (FCE) to saturate. That is, the CO drives the FCE (e.g. valve, pump, compressor) to its physical limit of fully open/on/maximum or fully closed/off/minimum.

And if this extreme value is still not sufficient to eliminate the error, the simple mathematics of the controller algorithm, if not jacketed with protective logic, permits the integral term to continue growing.

If the integral term grows unchecked, the equation above can command the valve, pump or compressor to move to 110%, then 120% and more. Clearly, however, when an an FCE reaches its full 100% value, these last commands have no physical meaning and consequently, no impact on the process.

Control is Lost
Once we cross over to a "no physical meaning" computation, the controller has lost the ability to regulate the process.

When the computed CO exceeds the physical capabilities of the FCE because the integral term has reached a large positive or negative value, the controller is suffering from windup. Because windup is associated with the integral term, it is often referred to as integral windup or reset windup.

To prevent windup from occurring, modern controllers are protected by either:
▪ Employing extra "jacketing logic" in the software to halt integration when the CO reaches a maximum or minimum value.
▪ Recasting the controller into a discrete velocity form that, by its very formulation, naturally avoids windup.
Both alternatives offer benefits but possess some fairly subtle drawbacks that we discuss below.

Visualizing Windup
To better visualize the problem of windup and the benefit of anti-windup protection, consider the plot from our heat exchanger process below (click for a large view).
To the left is the performance of a PI controller with no windup protection. To the right is the performance of the same controller protected by an anti-windup strategy.
For both controllers, the set point is stepped from 200 °C up to 215 °C and back again. As shown in the lower trace on the plot, the controller moves the CO to 0%, closing the valve completely, yet this is not sufficient to move the PV up to the new set point.

15.jpg

To the left in the plot, the impact of windup is a degraded controller performance. When the set point is stepped back to its original value of 200 °C , the windup condition causes a delay in the CO action. This in turn causes a delay in the PV response.

To the right in the plot, anti-windup protection permits the CO, and thus PV, to respond promptly to the command to return to the original SP value of 200 °C.

More Details on Windup
The plot below (click for large view) offers more detail. As labeled on the plot:

1) To the left for the Controller with Wind-up case, the SP is stepped up to 215 °C. The valve closes completely but is not able to move the PV all the way to the high set point value. Integration is a summing of controller error, and since error persists, the integration term grows very large.
The sustained error permits the controller to windup (saturate). While it is not obvious from the plot, the PI algorithm is computing values for CO that ask the valve to be open -5%, -8% and more. The control algorithm is just simple math with no ability to recognize that a valve cannot be open to a negative value.
Note that the chart shows the CO signal bottoming out at 0% while the controller algorithm is computing negative CO values. This misleading information is one reason why windup can be difficult to diagnose as the root cause of a problem from visual inspection of process data trend plots.

2) When the SP is stepped back to 200 °C, it seems as if the CO does not move at first. In reality, the control algorithm started moving the CO when the SP changed, but the values remain in the physically meaningless range of negative numbers.
So while the valve remains fully closed at 0%, the integral sum is accumulating controller errors of opposite sign. As time passes, the integral term shrinks or "unwinds" as the running sum of errors balance out.
3) When the integral sum of errors shrinks enough, it no longer dominates the CO computation. The CO signal returns from the physically meaningless world of negative values. The valve can finally move in response.
4) To the right in the plot above, the controller is protected from windup. As a result, when the set point is stepped back to 200 °C, the CO immediately reacts with a change that is proportional to the size of the SP change. The PV moves quickly in response to the CO actions as it tracks the SP back to 200 °C.

◊ Solution 1: Jacketing Logic on the Position Algorithm
The PI controller at the top of this article is called the position form because the computed CO is a specific intermediate value between full on/open/maximum and closed/off/minimum. The continuous PI algorithm is specifying the actual position (e.g., 27% open, 64% of maximum) that the final control element (FCE) should assume.

Simple Logic Creates Additional Problems
It is not enough to have logic that simply limits or clips the CO if it reaches a maximum (COmax) or minimum (COmin) value because this does nothing to check the growth of the integral sum of errors term.
I
n fact, such simple logic was used in the "control with windup" plots just discussed. The CO seems stuck at 0% and we are unaware that the algorithm is actually computing negative valve positions as described in item 1 above.

Anti-Windup Logic Outline
When we switch from manual mode to automatic, we assume that we have initialized the controller using a bumpless transfer procedure. That is, at switchover, the integral sum of error is set to zero, the SP is set equal to the current PV, and the controller bias is set equal to the current CO (implying that COmin < CObias < COmax).

Thus, there is nothing to cause CO to immediately change and "bump" our process at switchover.

One approach to creating anti-windup jacketing logic is to artificially manipulate the integral sum of error itself. With our controller properly initialized, the approach is to flip the algorithm around and back-calculate a value for the integral sum of error that will provide a desired controller output value (COdesired), or:

16.jpg

Note that COdesired can be different in different situations. For example,
▪ We do not want tuning parameter adjustments to cause sudden CO movements that bump our process. So if tuning values have changed, COdesired is the value of CO from the previous loop calculation cycle.
▪ If the PI controller computes CO values that are above COmax or below COmin, then we must be concerned about windup and COdesired is set equal to the limiting COmax or COmin value.

The anti-windup logic followed at every loop sample time, T, is thus:

1) If tuning parameters have changed since the last loop calculation cycle, then COdesired = current CO. Back calculate the integral sum of error so CO remains unchanged from the previous sample time. This prevents sudden CO bumps due to tuning changes.

2) Update SP and PV for this loop calculation cycle.
3) compute:
17.jpg

4) If CO > COmax or if CO < COmin, then the anti-windup (integral desaturation) logic of step 5 is required. Otherwise, proceed to step 6.

5) If CO > COmax, then CO = COdesired = COmax. if CO < COmin, then CO = COdesired = COmin. Back calculate the integral sum of error using our selected COdesired and save it for use in the next control loop calculation cycle.

6) Implement CO

◊ Solution 2 - Use the Velocity (Discrete) Controller Form
Rather than computing a CO signal indicating a specific position for our final control element, an alternative is to compute a signal that specifies a change, ∆CO, from current position for the FCE. As explained below, this is called the velocity or discrete controller form.

We employ the dependent algorithm for this presentation, but the derivation that follows can be applied in an analogous fashion to the independent PI form. To derive the discrete velocity form, we must first write the continuous, position form of the PI controller to include the independent variable on the controller output, showing it properly as CO(t) to reflect that it changes with time:

18.jpg

Please note that this controller is identical to all dependent PI forms as presented in other articles. The only difference is we are being more mathematically precise in our expression of CO(t).

Deriving the Discrete Velocity Form
The first step in deriving the discrete form is to take the time derivative of the continuous form. In physics, the time derivative (rate of change) of a position is a velocity. This is why the final form of the PI controller we derive is often called the velocity form.

Taking the derivative of the continuous PI controller above with respect to time yields:
  19.jpg

Since CObias is a constant and the derivative of a constant is zero, then:

20.jpg

Removing this term from the equation results in:

21.jpg

If we assume discrete or finite difference approximations for the continuous derivatives, then the controller becomes:

22.jpg

where ei is the current controller error, ei-1 is the controller error at the previous sample time, T, and ∆ei = ei - ei-1.
Recognizing that loop sample time is T = ∆t, then the PI controller becomes:

23.jpg

Rearranging, we arrive at the discrete velocity form of the PI controller:

24.jpg

Reason for Anti-Windup Protection
Discrete velocity algorithms compute a ∆CO that signals the FCE to move a specific distance and direction from its current position. As we can see from the PI controller form above, the computation does not keep track of the current FCE position, nor does it mathematically accumulate any integral sums.

In a sense, the accumulation of integration is stored in the final control element itself. If a long series of ∆CO moves are all positive, for example, the valve, pump or compressor will move toward its maximum value. And once the FCE reaches its maximum limit, any ∆CO commands to move further will have no impact because, as stated in the first sentences of this article, a valve cannot open more than all the way and a pump cannot go slower than stopped. It is the physical nature of the FCE itself that provides protection from over-accumulation (i.e., windup).

As long as the CO never reaches COmax or COmin, the continuous position and discrete velocity forms of the PI controller provide identical performance. A properly jacketed continuous position PI controller will also provide windup protection equal to the discrete velocity form. Implicit in these statements is that sample time,T, is reasonably fast and that T and the tuning values (Kc and Ti) are the same when comparing implementations.

Concerns with Discrete Velocity PID
Unfortunately, the usefulness of the discrete velocity form is limited because the method suffers problems when derivative action is included. We find that we must take the derivative of a derivative, yielding a second derivative. A second derivative applied to data that contains even modest noise can produce nonsense results.

Some vendors implement this form anyway and include a signal filter and additional logic sequences to address the problem. Thus, even with the anti-windup benefits of a discrete velocity algorithm, we find the need to jacket the algorithm with protective logic.

Read more


Interacting Tuning Parameters




Many process control practitioners tune by "intuition," fiddling their way to final tuning by a combination of experience and trial-and-error.

Some are quite good at approaching process control as art. Since they are the ones who define "best" performance based on the goals of production, the capabilities of the process, the impact on down stream units, and the desires of management, it can be difficult to challenge any claims of success.

To explore the pitfalls of a trial and error approach and reinforce that there is science to controller tuning, we consider the common dependent, ideal form of the PI controller:

3.jpg

Where:
CO = controller output
e(t) = controller error = set point - process variable = SP - PV
Kc = controller gain, a tuning parameter
Ti = reset time, a tuning parameter

For this form, controller activity or aggressiveness increases as Kc increases and as Ti decreases (Ti is in the denominator, so smaller values increase the weighting on the integral action term, thus increasing controller activity).

Since Kc and Ti individually can make a controller more or less aggressive in its response, the two tuning parameters interact with each other. If current controller performance is not what we desire, it is not always clear which value to raise or lower, or by how much.

Example of Interaction Confusion
To illustrate, consider a case where we seek to balance a fairly rapid response to a set point change (a short rise time) against a small overshoot. While every process application is different, we choose to call the response plot below our desired or base case performance.

mapbasecase.jpg

Now consider the two response plots below. These were made using the identical process and controller to that above. The only difference between the base case response above and plot A and plot B below is that different Kc and Ti tuning values were used in each one.

And now the question: what tuning adjustments are required to restore the desired base case performance above starting from each plot below? Or alternatively: how has the tuning been changed from base case performance to produce these different behaviors?

There are no tricks in this question. The "process" is a simple linear second order system with modest dead time. Controller output is not hitting any limits. The scales on the plot are identical. Everything is as it seems, except PI controller tuning is different in each case.

Study the plots for a moment before reading ahead and see if you can figure it out. Each plot has a very different answer.

mapchallenge.jpg

Some Hints
Before we reveal the answer, here is a hint. One plot has been made more active or aggressive in its response by doubling Kc while keeping Ti constant at the original base case value.

The other cuts Ti in half (remember, decreasing Ti makes this PI form more active) while keeping Kc at the base case value:

So we have:
• Base case = Kc and Ti
• Plot A or B = 2Kc and Ti
• Other Plot B or A = Kc and Ti/2

Still not sure? Here is a final hint: remember from our previous discussions that proportional action is largely responsible for the first movements in a response. We also discussed that integral action tends to increase the oscillatory or cycling behavior in the PV.

It is not easy to know the answer, even with these huge hints, and that is the point of this article.

The Answer
Below is a complete tuning map with the base case performance from our challenge problem in the center. The plot shows how performance changes as Kc and Ti are doubled and halved from the base case for the dependent, ideal PI controller form.

maptuningsmall.jpg

Starting from the center and moving up on the map from the base case performance brings us to plot B. As indicated on the tuning map axis, this direction increases (doubles) controller gain, Kc, thus making the controller more active or aggressive. Moving down on the map from the base case decreases (halves) Kc, making the controller more sluggish in its response.

Moving left on the map from the base case brings us to plot A. As indicated on the tuning map axis, this direction decreases reset time (cuts it in half), again making the controller more active or aggressive. Moving right on the map from the base case increases (doubles) reset time, making the controller more sluggish in its response.

It is clear from the tuning map that the controller is more active or aggressive in its response when Kc increases and Ti decreases, and more sluggish or conservative when Kc decreases and Ti increases.

Building on this observation, it is not surprising that the upper left most plot (2Kc and Ti/2) shows the most active controller response, and the lower right most plot (Kc/2 and 2Ti) is the most conservative or sluggish response.

Back to the question. With what we now know, the answer:
• Base case = Kc and Ti
• Plot B = 2Kc and Ti
• Plot A = Kc and Ti/2


Interacting Parameters Makes Tuning Problematic

The PI controller has only two tuning parameters, yet it produces very similar looking performance plots located in different places on a tuning map.

f our instincts lead us to believe that we are at plot A when we really are at plot B, then the corrective action we make based on this instinct will compound our problem rather than solve it. This is strong evidence that trial and error is not an efficient or appropriate approach to tuning.

When we consider a PID controller with three tuning parameters, the number of similar looking plots in what would be a three dimensional tuning map increases dramatically. Trial and error tuning becomes almost futile.

We have been exploring a step by step tuning recipe approach that produces desired results without the wasted time and off-spec product that results from trial and error tuning.

If we follow this industry-proven methodology, we will improve the safety and profitability of our operation.

Interesting Observation

Before leaving this subject, we make one more very useful observation from the tuning map. This will help build our intuition and may help one day when we are out in the plant.

The right most plot in the center row (Kc, 2Ti) of the tuning map above is reproduced below.

mapintegral.jpg

Notice how the PV shows a dip or brief oscillation on its way up to the set point? This is a classic indication that the proportional term is reasonable but the integral term is not getting enough weight in the calculation. For the PI form used in this article, that would mean that the reset time, Ti, is too large since it is in the denominator.

If we cover the right half of the "not enough integral action" plot, the response looks like it is going to settle out with some offset, as would be expected with a P-Only controller. When we consider the plot as a whole, we see that as enough time passes, the response completes. This is because the weak integral action finally accumulates enough weight in the calculation to move the PV up to set point.

This "oscillates on the way" pattern is a useful marker for diagnosing a lack of sufficient integral action.

Read more


PI Disturbance Rejection Of The Gravity Drained Tanks

When exploring the capabilities of the P-Only controller in rejecting disturbances for the gravity drained tanks process, we confirmed the observations we had made during the the P-Only set point tracking study for the heat exchanger.

In particular, the P-Only algorithm is easy to tune and maintain, but whenever the set point or a major disturbance moves the process from the design level of operation, a sustained error between the process variable (PV) and set point (SP), called offset, results.

Further, we saw in both case studies that as controller gain, Kc, increases (or as proportional band, PB, decreases):
▪ the activity of the controller output, CO, increases
▪ the oscillatory nature of the response increases
▪ the offset (sustained error) decreases

In this article, we explore the benefits of integral action and the capabilities of the PI controller for rejecting disturbances in the gravity drained tanks process. We have previously presented the fundamentals behind PI control and its application to set point tracking in the heat exchanger.

As with all controller implementations, best practice is to follow our proven four-step design and tuning recipe. One benefit of the recipe is that steps 1-3, summarized below from our P-Only study, remain the same regardless of the control algorithm being employed. After summarizing steps 1-3, we complete the PI controller design and tuning in step 4.

Step 1: Determine the Design Level of Operation (DLO)
The control objective is to reject disturbances as we control liquid level in the lower tank. Our design level of operation (DLO), detailed here for this study is:
▪ design PV and SP = 2.2 m with range of 2.0 to 2.4 m
▪ design D = 2 L/min with occasional spikes up to 5 L/min

Step 2: Collect Process Data around the DLO
When CO, PV and D are steady near the design level of operation, we bump the CO as detailed here and force a clear response in the PV that dominates the noise.

Step 3: Fit a FOPDT Model to the Dynamic Process Data
We then describe the process behavior by fitting an approximating first order plus dead time (FOPDT) dynamic model to the test data from step 2. We define the model parameters and present details of the model fit of step test data here. A model fit of doublet test data using commercial software confirms these values:
▪ process gain (how far), Kp = 0.09 m/%
▪ time constant (how fast), Tp = 1.4 min
▪ dead time (how much delay), Өp = 0.5 min

Step 4: Use the FOPDT Parameters to Complete the Design
Following the heat exchanger PI control study, we explore what is often called the dependent, ideal form of the PI control algorithm:

picontroller3.jpg

Where:
CO = controller output signal (the wire out)
CObias = controller bias or null value; set by bumpless transfer
e(t) = current controller error, defined as SP - PV
SP = set point
PV = measured process variable (the wire in)
Kc = controller gain, a tuning parameter
Ti = reset time, a tuning parameter

Aside: our observations using the dependent ideal PI algorithm directly apply to the other popular PI controller forms. For example, the integral gain, Ki, in the independent algorithm form:
pieqindyellow.jpg
can be computed directly from controller gain and reset time as: Ki = Kc/Ti.

In the P-Only study, we established that for the gravity drained tanks process:
▪ sample time, T = 1 sec
▪ the controller is reverse acting
▪ dead time is small compared to Tp and thus not a concern in the design

Controller Gain, Kc, and Reset Time, Ti
We use our FOPDT model parameters in the industry-proven Internal Model Control (IMC) tuning correlations to compute PI tuning values.

The first step in using the IMC correlations is to compute Tc, the closed loop time constant. All time constants describe the speed or quickness of a response. Tc describes the desired speed or quickness of a controller in responding to a set point change or rejecting a disturbance.

If we want an active or quickly responding controller and can tolerate some overshoot and oscillation as the PV settles out, we want a small Tc (a short response time) and should choose aggressive tuning:
Aggressive Response: Tc is the larger of 0.1·Tp or 0.8·Өp

If we seek a sluggish controller that will move things in the proper direction, but quite slowly, we choose conservative tuning (a big or long Tc).
Conservative Response: Tc is the larger of 10·Tp or 80·Өp

Moderate tuning is for a controller that will move the PV reasonably fast while producing little to no overshoot.
Moderate Response: Tc is the larger of 1·Tp or 8·Өp

With Tc computed, the PI controller gain, Kc, and reset time, Ti, are computed as:

pituning2.jpg

Notice that reset time, Ti, is always equal to the process time constant, Tp, regardless of desired controller activity.

a) Moderate Response Tuning:
For a controller that will move the PV reasonably fast while producing little to no overshoot, choose:
Moderate Tc = the larger of 1·Tp or 8·Өp
= larger of 1(1.4 min) or 8(0.5 min)
= 4 min
Using this Tc and our model parameters in the tuning correlations above, we arrive at the moderate tuning values:

gdtpimoderate.jpg

b) Aggressive Response Tuning:
For an active or quickly responding controller where we can tolerate some overshoot and oscillation as the PV settles out, specify:
Aggressive Tc = the larger of 0.1·Tp or 0.8·Өp
= larger of 0.1(1.4 min) or 0.8(0.5 min)
= 0.4 min
and the aggressive tuning values are:

gdtpiaggressive.jpg

Practitioner's Note: The FOPDT model parameters used in the tuning correlations above have engineering units, so the Kc values we compute also have engineering units. In commercial control systems, controller gain (or proportional band) is normally entered as a dimensionless (%/%) value.
To address this, we could:
▪ Scale the process data before fitting our FOPDT dynamic model so we directly compute a dimensionless Kc.
▪ Convert the model Kp to dimensionless %/% after fitting the model but before using the FOPDT parameters in the tuning correlations.
▪ Convert Kc from engineering units into dimensionless %/% after using the tuning correlations.

Since we already have Kc in engineering units, we employ the third option. CO is already scaled from 0 - 100% in the above example. Thus, we convert Kc from engineering units into dimensionless %/% using the formula:

2.jpg

For the gravity drained tanks, PVmax = 10 m and PVmin = 0 m. The dimensionless Kc values are thus computed:
▪ moderate Kc = (3.5 %/m)∙[(10 - 0 m) ÷ (100 - 0%)] = 0.35 %/%
▪ aggressive Kc = (17 %/m)∙[(10 - 0 m) ÷ (100 - 0%)] = 1.7 %/%

We use the Kc with engineering units in the remainder of this article and are careful that our PI controller is formulated to accept such values. If we were using these results in a commercial control system, we would be careful to ensure our tuning parameters are cast in the form appropriate for our equipment.

Controller Action
The process gain, Kp, is positive for the gravity drained tanks, indicating that when CO increases, the PV increases in response. This behavior is characteristic of a direct acting process. Given this CO to PV relationship, when in automatic mode (closed loop), if the PV starts drifting above set point, the controller must decrease CO to correct the error. Such negative feedback is an essential component of stable controller design.
A process that is naturally direct acting requires a controller that is reverse acting to remain stable. In spite of the opposite labels (direct acting process and reverse acting controller), the details presented above show that both Kp and Kc are positive values.

In most commercial controllers, only positive Kc values can be entered. The sign (or action) of the controller is then assigned by specifying that the controller is either reverse acting or direct acting to indicate a positive or negative Kc, respectively.

If the wrong control action is entered, the controller will quickly drive the final control element (FCE) to full on/open or full off/closed and remain there until a proper control action entry is made.

Implement and Test
The ability of the PI controller to reject changes in the pumped flow disturbance, D, is pictured below for the moderate and aggressive tuning values computed above. Note that the set point remains constant at 2.2 m throughout the study.

gdtpidisturbsmall.jpg

The aggressive controller shows a more energetic CO action, and thus, a more active PV response. As shown above, however, the penalty for this increased activity is some overshoot and oscillation in the process response.

Please be aware that the terms "moderate" and "aggressive" hold no magic. If we desire a control performance between the two, we need only average the Kc values from the tuning rules above. Note, however, that these rules provide a constant reset time, Ti, regardless of our desired performance. So if we believe we have collected a good process data set, and the FOPDT model fit looks like a reasonable approximation of this data, then Ti = Tp always.

While not our design objective, presented below is the set point tracking ability of the PI controller when the disturbance flow is held constant:

gdtpisetpointsmall.jpg

Again, the aggressive tuning values provide for a more active response.
Aside: it may appear that the random noise in the PV measurement signal is different in the two plots above, but it is indeed the same. Note that the span of the PV axis in each plot differs by a factor of four. The narrow span of the set point tracking plot greatly magnifies the signal traces, making the noise more visible.
Comparison With P-Only Control
The performance of a P-Only controller in addressing the same disturbance rejection and set point tracking challenge is shown here. A comparison of that study with the results presented here reveals that PI controllers:
▪ can eliminate the offset associated with P-Only control,
▪ have integral action that increases the tendency for the PV to roll (or oscillate),
▪ have two tuning parameters that interact, increasing the challenge to correct tuning when performance is not acceptable.
Derivative Action
The addition of the derivative term to complete the PID algorithm provides modest benefit yet significant challenges.



Again, the aggressive tuning values provide for a more active response.

Aside: it may appear that the random noise in the PV measurement signal is different in the two plots above, but it is indeed the same. Note that the span of the PV axis in each plot differs by a factor of four. The narrow span of the set point tracking plot greatly magnifies the signal traces, making the noise more visible.

Comparison With P-Only Control
The performance of a P-Only controller in addressing the same disturbance rejection and set point tracking challenge is shown here. A comparison of that study with the results presented here reveals that PI controllers:
▪ can eliminate the offset associated with P-Only control,
▪ have integral action that increases the tendency for the PV to roll (or oscillate),
▪ have two tuning parameters that interact, increasing the challenge to correct tuning when performance is not acceptable.

Derivative Action
The addition of the derivative term to complete the PID algorithm provides modest benefit yet significant challenges.

Read more


PI Control of the Heat Exchanger

PI Control of the Heat Exchanger

 We investigated P-Only control of the heat exchanger process and learned that while P-Only is an algorithm that is easy to tune and maintain, it has a severe limitation. Specifically, its simple form permits steady state error, called offset, in most processes during normal operation.

Then we moved on to integral action and PI control. We focused in that article on the structure of the algorithm and explored the mathematics of how the proportional and integral terms worked together to eliminate offset.

Here we test the capabilities of the PI controller on the heat exchanger process. Our focus is on design, implementation and basic performance issues. Along the way we will highlight some strengths and weaknesses of this popular algorithm.

As with all controller implementations, best practice is to follow our proven four-step design and tuning recipe as we proceed with this case study.

Step 1: Design Level of Operation (DLO)

Real processes display a nonlinear behavior. That is, their process gain, time constant and/or dead time changes as operating level changes and as major disturbances change. Since controller design and tuning is based on these process Kp, Tp and Өp values, controllers should be designed and tuned for a specific level of operation.
Thus, the first step in our controller design recipe is to specify our design level of operation (DLO). This includes stating:
▪ Where we expect the set point, SP, and measured process variable, PV, to be during normal operation.
▪ The range of values the SP and PV might assume so we can explore the nature of the process dynamics across that range.
We will track along with the same design conditions used in the P-Only control study to permit a direct comparison of performance and capability. As in that study, we specify:
▪ Design PV and SP = 138 °C with range of 138 to 140 °C
We also should know normal or typical values for our major disturbances and be reasonably confident that they are quiet so we may proceed with a bump test. The heat exchanger process has only one major disturbance variable, and consistent with the previous study:
▪ Expected warm liquid flow disturbance = 10 L/min

Step 2: Collect Data at the DLO
The next step in the design recipe is to collect dynamic process data as near as practical to our design level of operation. We have previously collected and documented heat exchanger step test data that matches our design conditions.

Step 3: Fit an FOPDT Model to the Design Data
Here we document a first order plus dead time (FOPDT) model approximation of the step test data from step 2:
▪ Process gain (how far), Kp = -0.53 °C/%
▪ Time constant (how fast), Tp = 1.3 min
▪ Dead time (how much delay), Өp = 0.8 min

Step 4: Use the Parameters to Complete the Design
One common form of the PI controller computes a controller output (CO) action every loop sample time T as:

picontroller2.jpg


Where:
CO = controller output signal (the wire out)
CObias = controller bias or null value; set by bumpless transfer as explained below
e(t) = current controller error, defined as SP - PV
SP = set point
PV = measured process variable (the wire in)
Kc = controller gain, a tuning parameter
Ti = reset time, a tuning parameter

Loop Sample Time, T
Best practice is to specify loop sample time, T, at 10 times per time constant or faster (T ≤ 0.1Tp). For this study, T ≤ 0.13 min = 8 sec. Faster sampling may provide modestly improved performance, while slower sampling can lead to significantly degraded performance. Most commercial controllers offer an option of T = 1.0 sec, and since this meets our design rule, we use that here.

Computing controller error, e(t)
Set point, SP, is something we enter into the controller. The PV measurement comes from our sensor (our wire in). With SP and PV known, controller error, e(t) = SP - PV, can be directly computed at every loop sample time T.

Determining Bias Value
Strictly speaking, CObias is the value of the CO that, in manual mode, causes the PV to steady at the DLO while the major disturbances are quiet and at their normal or expected values.

Bumpless Transfer
A desirable feature of the PI algorithm is that it is able to eliminate the offset that can occur under P-Only control. The integral term of the PI controller provides this capability by providing updated information that, when combined with the controller bias, keeps the process centered as conditions change.

Since integral action acts to update (or reset) our bias value over time, CObias can be initialized in a straightforward fashion to a value that produces no abrupt control actions when we switch to automatic. Most commercial controllers do this with a simple "bumpless transfer" feature. When switching to automatic, they initialize:
▪ SP equal to the current PV
▪ CObias equal to the current CO

With the set point equal to the measured process variable, there is no error to drive a change in our controller output. And with the controller bias set to our current controller output, we are prepared by default to maintain current operation.

We will use a controller that employs these bumpless transfer rules when we switch to automatic. Hence, we need not specify any value for CObias as part of our design.

Computing Controller Gain and Reset Time
Here we use the industry-proven Internal Model Control (IMC) tuning correlations. The first step in using the IMC correlations is to compute Tc, the closed loop time constant. All time constants describe the speed or quickness of a response. The closed loop time constant describes the desired speed or quickness of a controller in responding to a set point change or rejecting a disturbance.

If we want an active or quickly responding controller and can tolerate some overshoot and oscillation as the PV settles out, we want a small Tc (a short response time) and should choose aggressive tuning:
aggressive: Tc is the larger of 0.1·Tp or 0.8·Өp
Moderate tuning is for a controller that will move the PV reasonably fast while producing little to no overshoot.
moderate: Tc is the larger of 1·Tp or 8·Өp
If we seek a more sluggish controller that will move things in the proper direction, but quite slowly, we choose conservative tuning (a big or long Tc).
conservative: Tc is the larger of 10·Tp or 80·Өp

Once we have decided on our desired performance and computed the closed loop time constant, Tc, with the above rules, then the PI correlations for controller gain, Kc, and reset time, Ti, are:

pituning.jpg

Notice that reset time, Ti, is always set equal to the time constant of the process, regardless of desired controller activity.

a) Moderate Response Tuning:
For a controller that will move the PV reasonably fast while producing little to no overshoot, choose:
Moderate Tc = the larger of 1·Tp or 8·Өp
= larger of 1(1.3 min) or 8(0.8 min)
= 6.4 min
Using this Tc and our model parameters in the tuning correlations above, we arrive at the moderate tuning values:

hemoderatepi.jpg

b) Aggressive Response Tuning:

For an active or quickly responding controller where we can tolerate some overshoot and oscillation as the PV settles out, specify
Aggressive Tc = the larger of 0.1·Tp or 0.8·Өp
= larger of 0.1(1.3 min) or 0.8(0.8 min)
= 0.64 min
and the aggressive tuning values are:

heaggressivepi.jpg

Practitioner's Note: The FOPDT model parameters used in the tuning correlations above have engineering units, so the Kc values we compute also have engineering units. In commercial control systems, controller gain (or proportional band) is normally entered as a dimensionless (%/%) value.

For commercial implementations, we could:
▪ Scale the process data before fitting our FOPDT dynamic model so we directly compute a dimensionless Kc.
▪ Convert the model Kp to dimensionless %/% after fitting the model but before using the FOPDT parameters in the tuning correlations.
▪ Convert Kc from engineering units into dimensionless %/% after using the tuning correlations.

CO is already scaled from 0 - 100% in the above example. Thus, we convert Kc from engineering units into dimensionless %/% using the formula:

1.jpg

For the heat exchanger, PVmax = 250 oC and PVmin = 0 oC. The dimensionless Kc values are thus computed:

▪ moderate Kc = (- 0.34 %/ oC)∙[(250 - 0 oC) ÷ (100 - 0%)] = - 0.85 %/%
▪ aggressive Kc = (- 1.7%/ oC)∙[(250 - 0 oC) ÷ (100 - 0%)] = - 4.2 %/%

We use Kc with engineering units in the remainder of this article and are careful that our PI controller is formulated to accept such values. We would be mindful if we were using a commercial control system, however, to ensure our tuning parameters are cast in the form appropriate for our equipment.

Controller Action
The process gain, Kp, is negative for the heat exchanger, indicating that when CO increases, the PV decreases in response. This behavior is characteristic of a reverse acting process. Given this CO to PV relationship, when in automatic mode (closed loop), if the PV starts drifting above set point, the controller must increase CO to correct the error. Such negative feedback is an essential component of stable controller design.
A process that is naturally reverse acting requires a controller that is direct acting to remain stable. In spite of the opposite labels (reverse acting process and direct acting controller), the details presented above show that both Kp and Kc are negative values.

In most commercial controllers, only positive Kc values can be entered. The sign (or action) of the controller is then assigned by specifying that the controller is either reverse acting or direct acting to indicate a positive or negative Kc, respectively.

If the wrong control action is entered, the controller will quickly drive the final control element (FCE) to full on/open or full off/closed and remain there until a proper control action entry is made.

Implement and Test

Below we test our two PI controllers on the heat exchanger process simulation. Shown are two set points step pairs from 138 °C up to 140 °C and back again.
The first set point steps to the left show the PI controller performance using the moderate tuning values computed above. The second set point steps to the right show the controller performance using the aggressive tuning values. Note that the warm liquid disturbance flow, though not shown, remains constant at 10 L/min throughout the study.
(For comparison, the performance of the P-Only controller in tracking these set point changes is pictured here).

hepicontrol2small.jpg

The asymmetrical behavior of the PV for the set point steps up compared to the steps down is due to the very nonlinear character of the heat exchanger.

If we seek tuning between moderate and aggressive performance, we would average the Kc values from the tuning rules above.

But if we believe we had collected good bump test data (we saw a clear response in the PV when we stepped the CO and the major disturbances were quiet during the test), and the FOPDT model fit appears to be visually descriptive of the data, then we have a good value for Tp and that means a good value for Ti.

If we are going to fiddle with the tuning, we can tweak Kc and we should leave the reset time alone.

Tuning Recipe Saves Time and Money
The exciting result is that we achieved our desired controller performance based on one bump test and following a controller design recipe. No trial and error was involved. Little off-spec product was produced. No time was wasted.

Soon we will see how software tools help us achieve such results with even less disruption to the process.

The method of approximating complex behavior with a FOPDT model and then following a recipe for controller design and tuning has been used successfully on a broad spectrum of processes with streams composed of gases, liquids, powders, slurries and melts. It is a reliable approach that has been proven time and again at diverse plants from a wide range of companies.

Read more


Integral Action and PI Control

 Like the P-Only controller, the Proportional-Integral (PI) algorithm computes and transmits a controller output (CO) signal every sample time, T, to the final control element (e.g., valve, variable speed pump). The computed CO from the PI algorithm is influenced by the controller tuning parameters and the controller error, e(t).
PI controllers have two tuning parameters to adjust. While this makes them more challenging to tune than a P-Only controller, they are not as complex as the three parameter PID controller.
Integral action enables PI controllers to eliminate offset, a major weakness of a P-only controller. Thus, PI controllers provide a balance of complexity and capability that makes them by far the most widely used algorithm in process control applications.

The PI Algorithm

While different vendors cast what is essentially the same algorithm in different forms, here we explore what is variously described as the dependent, ideal, continuous, position form:

Where:
CO = controller output signal (the wire out)
CObias = controller bias or null value; set by bumpless transfer as explained below
e(t) = current controller error, defined as SP - PV
SP = set point
PV = measured process variable (the wire in)
Kc = controller gain, a tuning parameter
Ti = reset time, a tuning parameter

The first two terms to the right of the equal sign are identical to the P-Only controller referenced at the top of this article.
The integral mode of the controller is the last term of the equation. Its function is to integrate or continually sum the controller error, e(t), over time.

Some things we should know about the reset time tuning parameter, Ti:
▪ It provides a separate weight to the integral term so the influence of integral action can be independently adjusted.
▪ It is in the denominator so smaller values provide a larger weight to (i.e. increase the influence of) the integral term.
▪ It has units of time so it is always positive.


Function of the Proportional Term

As with the P-Only controller, the proportional term of the PI controller, Kc·e(t), adds or subtracts from CObias based on the size of controller error e(t) at each time t.

As e(t) grows or shrinks, the amount added to CObias grows or shrinks immediately and proportionately. The past history and current trajectory of the controller error have no influence on the proportional term computation.

The plot below illustrates this idea for a set point response. The error used in the proportional calculation is shown on the plot:
▪ At time t = 25 min, e(25) = 60-56 = 4
▪ At time t = 40 min, e(40) = 60-62 = -2

pierrorsmall.jpg

Recalling that controller error e(t) = SP - PV, rather than viewing PV and SP as separate traces as we do above, we can compute and plot e(t) at each point in time t.

Below is the identical data to that above only it is recast as a plot of e(t) itself. Notice that in the plot above, PV = SP = 50 for the first 10 min, while in the error plot below, e(t) = 0 for the same time period.

pierror2small.jpg

This plot is useful as it helps us visualize how controller error continually changes size and sign as time passes.

Function of the Integral Term

While the proportional term considers the current size of e(t) only at the time of the controller calculation, the integral term considers the history of the error, or how long and how far the measured process variable has been from the set point over time.

Integration is a continual summing. Integration of error over time means that we sum up the complete controller error history up to the present time, starting from when the controller was first switched to automatic.

Controller error is e(t) = SP - PV. In the plot below, the integral sum of error is computed as the shaded areas between the SP and PV traces.

piintsmall.jpg

Each box in the plot has an integral sum of 20 (2 high by 10 wide). If we count the number of boxes (including fractions of boxes) contained in the shaded areas, we can compute the integral sum of error.

So when the PV first crosses the set point at around t = 32, the integral sum has grown to about 135. We write the integral term of the PI controller as:

Since it is controller error that drives the calculation, we get a direct view the situation from a controller error plot as shown below:

piint2small.jpg

Note that the integral of each shaded portion has the same sign as the error. Since the integral sum starts accumulating when the controller is first put in automatic, the total integral sum grows as long as e(t) is positive and shrinks when it is negative.

At time t = 60 min on the plots, the integral sum is 135 - 34 = 101. The response is largely settled out at t = 90 min, and the integral sum is then 135 - 34 7 = 108.

Integral Action Eliminates Offset
The previous sentence makes a subtle yet very important observation. The response is largely complete at time t = 90 min, yet the integral sum of all error is not zero.

In this example, the integral sum has a final or residual value of 108. It is this residual value that enables integral action of the PI controller to eliminate offset.

As discussed in a previous article, most processes under P-only control experience offset during normal operation. Offset is a sustained value for controller error (i.e., PV does not equal SP at steady state).

We recognize from the P-Only controller:

ponlycontrollereq.jpg

that CO will always equal CObias unless we add or subtract something from it.

The only way we have something to add or subtract from CObias in the P-Only equation above is if e(t) is not zero. It e(t) is not steady at zero, then PV does not equal SP and we have offset.

However, with the PI controller:

picontroller.jpg

we now know that the integral sum of error can have a final or residual value after a response is complete. This is important because it means that e(t) can be zero, yet we can still have something to add or subtract from CObias to form the final controller output, CO.

So as long as there is any error (as long as e(t) is not zero), the integral term will grow or shrink in size to impact CO. The changes in CO will only cease when PV equals SP (when e(t) = 0) for a sustained period of time.

At that point, the integral term can have a residual value as just discussed. This residual value from integration, when added to CObias, essentially creates a new overall bias value that corresponds to the new level of operation.

In effect, integral action continually resets the bias value to eliminate offset as operating level changes.

Challenges of PI Control

There are challenges in employing the PI algorithm:
▪ The two tuning parameters interact with each other and their influence must be balanced by the designer.
▪ The integral term tends to increase the oscillatory or rolling behavior of the process response.

Because the two tuning parameters interact with each other, it can be challenging to arrive at "best" tuning values. The value and importance of our design and tuning recipe increases as the controller becomes more complex.

Initializing the Controller for Bumpless Transfer

When we switch any controller from manual mode to automatic (from open loop to closed loop), we want the result to be uneventful. That is, we do not want the switchover to cause abrupt control actions that impact or disrupt our process

We achieve this desired outcome at switchover by initializing the controller integral sum of error to zero. Also, the set point and controller bias value are initialized by setting:
▪ SP equal to the current PV
▪ CObias equal to the current CO

With the integral sum of error set to zero, there is nothing to add or subtract from CObias that would cause a sudden change in the current controller output. With the set point equal to the measured process variable, there is no error to drive a change in our CO. And with the controller bias set to our current CO value, we are prepared by default to maintain current operation.

Thus, when we switch from manual mode to automatic, we have "bumpless transfer" with no surprises. This is a result everyone appreciates.

Reset Time Versus Reset Rate

Different vendors cast their control algorithms in slightly different forms. Some use proportional band rather than controller gain. Also, some use reset rate, Tr, instead of reset time. These are simply the inverse of each other:
Tr = 1/Ti

No matter how the tuning parameters are expressed, the PI algorithms are all equally capable.

But it is critical to know your manufacturer before you start tuning your controller because parameter values must be matched to your particular algorithm form. Commercial software for controller design and tuning will automatically address this problem for you.

Implementing a PI controller

We explore PI controller design, tuning and implementation on the heat exchanger in this article and the gravity drained tanks in this article.

Read more


P-Only Disturbance Rejection of the Gravity Drained Tanks

In a previous article, we looked at the structure of the P-Only algorithm and we considered some design issues associated with implementation. We also studied the set point tracking (or servo) performance of this simple controller for the heat exchanger process.

Here we investigate the capabilities of the P-Only controller for liquid level control of the gravity drained tanks process. Our objective in this study is disturbance rejection (or regulatory control) performance.

Gravity Drained Tanks Process
A graphic of the gravity drained tanks process is shown below :

 

The measured process variable (PV) is liquid level in the lower tank. The controller output (CO) adjusts the flow into the upper tank to maintain the PV at set point (SP).

The disturbance (D) is a pumped flow out of the lower tank. It's draw rate is adjusted by a different process and is thus beyond our control. Because it runs through a pump, D is not affected by liquid level, though the pumped flow rate drops to zero if the tank empties.

We begin by summarizing the previously discussed results of steps 1 through 3 of our design and tuning recipe as we proceed with our P-Only control investigation:

Step 1: Determine the Design Level of Operation (DLO)
Our primary objective is to reject disturbances as we control liquid level in the lower tank. As discussed here, our design level of operation (DLO) for this study is:
  • design PV and SP = 2.2 m with range of 2.0 to 2.4 m
  • design D = 2 L/min with occasional spikes up to 5 L/min
Step 2: Collect Process Data around the DLO
When CO, PV and D are steady near the design level of operation, we bump the CO far enough and fast enough to force a clear dynamic response in the PV that dominates the signal and process noise. As detailed here, we performed two different open loop (manual mode) dynamic tests, a step test and a doublet test.

Step 3: Fit a FOPDT Model to the Dynamic Process Data
The third step of the recipe is to describe the overall dynamic behavior of the process with an approximating first order plus dead time (FOPDT) dynamic model. We define the model parameters and present details of the model fit of step test data here. A model fit of doublet test data using commercial software confirms these values:
  • process gain (how far), Kp = 0.09 m/%
  • time constant (how fast), Tp = 1.4 min
  • dead time (how much delay), Өp = 0.5 min
Step 4: Use the FOPDT Parameters to Complete the Design
Following the heat exchanger P-Only study, the P-Only control algorithm computes a CO action every loop sample time T as:

CO = CObias Kc∙e(t)

Where:
CObias = controller bias or null value
Kc = controller gain, a tuning parameter
e(t) = controller error, defined as SP - PV

· Sample Time, T
Best practice is to set the loop sample time, T, at one-tenth the time constant or faster (i.e., T ≤ 0.1Tp). Faster sampling may provide modestly improved performance. Slower sampling can lead to significantly degraded performance.

In this study, T ≤ (0.1)(1.4 min), so T should be 8 seconds or less. We meet this specification with the common vendor sample time option:
▪ sample time, T = 1 sec


· Control Action (Direct/Reverse)
The gravity drained tanks has a positive Kp. That is, when CO increases, PV increases in response. When in automatic mode (closed loop), if the PV is too high, the controller must decrease the CO to correct the error (read more here). Since the controller must move in the direction opposite of the problem, we specify:
▪ controller is reverse acting

· Dead Time Issues
If dead time is greater than the process time constant (Өp > Tp), control becomes increasingly problematic and a Smith predictor can offer benefit. For this process, the dead time is smaller than the time constant, so:
▪ dead time is small and thus not a concern


· Computing Controller Error, e(t)
Set point, SP, is manually entered into a controller. The measured PV comes from the sensor (our wire in). Since SP and PV are known values, then at every loop sample time, T, controller error can be directly computed as:
▪ error, e(t) = SP - PV

· Determining Bias Value, CObias
CObias is the value of CO that, in manual mode, causes the PV to remain steady at the DLO when the major disturbances are quiet and at their normal or expected values. Our doublet plots establish that when CO is at 53%, the PV is steady at the design value of 2.2 m, thus:
▪ controller bias, CObias = 53%

· Controller Gain, Kc
For the simple P-Only controller form, we use the integral of time-weighted absolute error (ITAE) tuning correlation:

Moderate P-Only:

Aside: Regardless of the values computed in the FOPDT fit, best practice is to set Өp no smaller than sample time, T (or Өp ≥ T) in the control rules and correlations (more discussion here). In this gravity drained tanks study, our FOPDT fit produced a Өp much larger than T, so the "dead time greater than sample time" rule is met.


Using our FOPDT model values from step 3, we compute:

 

And our moderate P-Only controller becomes:

▪ P-Only controller: CO = 53% 8∙e(t)

Implement and Test
To explore how controller gain impacts P-Only performance, we test the controller with the above Kc = 8 %/m. Since the correlation tends to produce moderate performance values, we also explore increasingly aggressive or active P-Only tuning by doubling Kc (2Kc = 16 %/m) and then doubling it again (4Kc = 32 %/m).

The ability of the P-Only controller to reject step changes in the pumped flow disturbance, D, is pictured below (click for a large view) for the ITAE value of Kc and its multiples. Note that the set point remains constant at 2.2 m throughout the study.

 

As shown in the figure above, whenever the pumped flow disturbance, D, is at the design level of 2 L/min (e.g., when time is less than 30 min) then PV equals SP.

The three times that D is stepped away from the DLO, however, the PV shifts away from the set point. The simple P-Only controller is not able to eliminate this "offset," or sustained error between the PV and SP. This behavior reinforces that both set point and disturbances contribute to defining the design level of operation for a process.

The figure shows that as Kc increases across the plot:
  • the activity of the controller output, CO, increases,
  • the offset (difference between SP and final PV) decreases, and
  • the oscillatory nature of the response increases.

Offset, or the sustained error between SP and PV when the process moves away from the DLO, is a big disadvantage of P-Only control. Yet there are appropriate uses for this simple controller (more discussion here).

While not our design objective, presented below is the set point tracking ability of the controller (click for a large view) when the disturbance flow is held constant:

 

The figure shows that as Kc increases across the plot, the same performance observations made above apply here: the activity of CO increases, the offset decreases, and the oscillatory nature of the response increases.

Aside: it may appear that the random noise in the PV measurement signal is different in the two plots above, but it is indeed the same. Note that the span of the PV axis in the two plots differs by a factor of four. The narrow span of the set point tracking plot greatly magnifies the signal traces, making the noise more visible.

Proportional Band
Different manufacturers use different forms for the same tuning parameter. The popular alternative to controller gain found in the marketplace is proportional band, PB.

If the CO and PV have units of percent and both can range from 0 to 100%, then the conversion between controller gain and proportional band is:

PB = 100/Kc

Thus, as Kc increases, PB decreases. This reverse thinking can challenge our intuition when switching among manufacturers.

Many examples on this site assign engineering units to the measured PV because plant software has made the task of unit conversions straightforward. If this is true in your plant, take care when using this formula.

Integral Action
Integral action has the benefit of eliminating offset but presents greater design challenges.

Read more

Followers

Powered by Blogger.

About This Blog

categories

Web hosting for webmasters