Simple scheduled gain scheme design example - Level Control
Scheduled gain or Adaptive gain is a great tuning technique that can provide PID performance guarantees around preventing process safety events from occurring that normal PID tuning will have difficulty achieving.
Why should I care?
With the way most in plant PID controllers are tuned in the field, it is difficult to guarantee that a typical PID controller will do all it can to stop trips from occurring. This means more operator alarms, more trips, and ultimately more production losses.
Ok, so why does this happen?
In part this is due to a design - commissioning disconnect that can easily occur. For example, during HAZOP and safety reviews of a plant, the language used to describe a controller is all around safety, with the assumption that the controller will do all it can to stop bad things from happening.
When it comes to commissioning however, the emphasis is more on smooth running of the plant which may lead to different tuning settings being used than was originally intended.
Take for example level control. Level control is an interesting case for plants where you do not have direct control over the rates at which raw material is being supplied to the plant (i.e. multiphase pipelines, or raw material hoppers where there are bridging dynamics at play). Typically in these cases there is a tradeoff between level control and smooth flow of product to downstream processes (i.e. you can't have both great level control and great outlet flow control, since your mass in rates are fluctuating).
In these cases, usually a smooth flow of product out of the vessel in question is more desirable than great level control. This leads to quite slow level control settings being used, which in turn makes it difficult to say with certainty that the level controller will act fast enough during disturbances to react in time to prevent alarms and trips from occurring.
How would scheduled gain help?
With scheduled gain however, we can get the best of both worlds. In the level control applications described above, we can provide a smooth outlet flow with minimal flow variations, while putting in place performance guarantee around making sure the controller is doing all it can to prevent trips from occurring!
Here is how it all works:
Below is a typical case of an inlet separator level controller (we'll only focus on the condensate side level control). The two things we have to worry about are high levels causing liquid to overflow into the gas outlet, and low levels causing gas breakthrough into the condensate outlet (Note that often the downstream condensate handling equipment has a much lower pressure rating so this is an important condition to protect against).
In general, when carrying out tuning of separators, especially inlet separators, the objective is to install quite gentle tuning parameters, since we can use the volume of the inlet separator to dampen out any surges of liquids from upstream processes / pipelines. Usually however gentle tuning settings do not result in good performance in preventing trips -This illustrates the conundrum I referred to before: how to achieve good safety performance while still maintaining gentle tuning settings.
Span
In this case we are going to assume that a level indicating transmitter (LIT) is installed to measure condensate level with a range of 0-100% level where 0% corresponds with the low level gas breakthrough case and 100% corresponds with the high level overflow case. To make it interesting I've labelled these points as "Bad things happen here" and "Here be dragons":
Incidentally, instrument span is an extremely important parameter when it comes to selecting tuning parameters... -more on that later!
Safety functions/trips
There are typically separate safety functions implemented in a dedicated safety system to stop these process safety related events from occurring. These usually involve a separate LIT, the safety system (think of it as PLC that has been designed to be extremely reliable) and shutdown valves on the inlet and outlets. These valves will trip and close when the level becomes too low or too high (keeping it away from our 'Bad things happen here' and 'here be dragons' points!). In this example we will use 10% for the low low trip (LL) and 85% for the high level trip (HH). These points are now marked on the scale:
Alarms
Typically we don't want to see safety functions be used (firstly since it indicates the process is out of control, and secondly a high use rate may mean it fails when it is needed). Often alarms will be implemented inside of the LL and HH limits to inform the operator that the process is outside its operating envelope and that a trip is impending. In this case we'll draw these in at 20% and 70%.
Operating Envelope
I mentioned operating envelope... how do we control the allowable operating envelope? What is to stop an operator setting the set-point 1% above the Low alarm (or below the trip set-point for that matter?). The answer to this is to use set-point limits. In this example, the set-point limits will be 30-50%.
Starting to draw the gain curve:
We can now start doing some very simple math to draw our gain curve.
One of the design cases we need to consider is when the integral term of the LIC has wound the controller output up to 100%, the setpoint has been set to the low setpoint limit and the level is falling. -The controller should do all it can to stop both the low low trip and the low alarm from coming up.
Since we do not know how fast this may happen we will calculate a gain value that closes the valve before the low alarm point is reached. Lets take the margin between our low setpoint limit and our low alarm: 20% - 30% = -10%.
We need the controllers P term to generate -100% to override the 100% integral term and drive the controllers output to 0% with a 10% error.
In this case the P term needs to be 100/10 = 10 at minimum by the time the low alarm point is reached. Lets add a y scale onto our graph and mark those values onto the plot.
Lets do the same math for the high side alarm. 70-50=20%, 100/20=5 therefore the controller gain must be at least 5 by the time the high alarm setpoint is reached. This will compensate for a 0% integral term and drive the controllers output to 100% by the time the high level alarm is reached. I have marked this on the graph above as well.
Alarm management implications...
This is really handy from an alarm management perspective because we have now created a lot of assurance around the operation of this control loop. You see by the time an alarm has occurred, the controller output will always be at the state it needs to be!
So rather than the operator spending time working to put the controller in manual and close/open the outlet valve. -He/she can instead focus on managing the next step to mitigate the event (i.e. throttling the inlet valve on a high level, or shutting in the manual outlet valve on a low level.
The rest of the curve:
Lets build out the rest of our curve. As mentioned previously, we want the control loop to be very gentle inside the operating region of the control loop. There are lots of options for how to do that, from linearizing the level to a volume calculation, to characterizing the valve, to installing a cascaded level/flow control loop assuming a flow transmitter is installed. In this case however we are just going to go with a very low gain setting inside the operating region. I have chosen a gain setting of 0.5 which will give me a 5% change in controller response for every 10% in level movement which should give me approx 10% total throw on proportional control over my 30-50% operating region (with integral making up the difference).
Now that we have our curve, we can plot the proportional response. I use the SP hi and lo lims as my error=0 starting points since you must always assume the worst case response which is when the loop setpoint is set at its allowable limits.
Note also that I usually plot the response to the left of the lo limit on the positive side of the scale (even though the response will be negative). -This is purely to keep the plots to manageable sizes and seems to make it easier to convey even though it is technically incorrect.
Once again, note that the plotted proportional response curve on the graph below has reached 100% before the LAH and LAL setpoints are reached, and because this is done using proportional, the response is instant and repeatable:
In summary:
You can see now why I am a big fan of scheduled gain... want to operate your loop as close as possible to the trip setpoint but not trip? Scheduled gain makes problems like this easy to achieve!
Like the post? Love or hate scheduled gain? Have other ideas? Please leave a comment below!
Automation and Control Engineer
6yAnother technique (not so elegant but it is very efective for not very "difficult" scenarios) is to use the PID Tracking Mode (switching the PID to Manual), and also both techniques can be used together. For example, when the level is too high and you know that the valve must be opened at 100%, you can enable the PID Tracking and forcing the PID output to 100%, and when the level comes back to a reasonable value the tracking mode will be disabled, PID will start to work again in auto, taking into account that the PID must start to work from the last tracked valued, in this case 100% . This is a simple solution for not very complex systems (most of them...).
Automation - PLC & SCADA Engineer Consultant
6yI think another reason to use scheduled gain is that the transfer function for the Process (level in side separator) is not linear, i.e change in level due to certain input flow when the level is near the bottom will not be the same change in level when the level is in the middle because the width of the liquid surface in middle will be greater. So PID parameters that are suitable for certain range of level (with certain Transfer function) may not be suitable for another range of level with another transfer function.
Sr. Systems Engineer | Power Electronics & Electric Drives | R&D Leader | Ph.D., PMP, IEEE Senior Member
6yCrisply illustrated. Well done!
Generation Engineering Specialist at Saudi Electricity Company | Certified Automation Professional (ISA) | 20+ yrs I&C exp. in PPs
6yBased on above, can look up table be created for appropriate tuning parameters based on process throughput ? I am getting scheduled tuning impression, if I m not wrong !
Telecom supervisor chez Broadband Systems ApS
6yi'm looking for work as telecom engineer or electronics ... can yu help me ,?? thants