## Level Controller Tuning

Level control loops are common in industrial processes, but tuning level controllers can be challenging. Many level loops oscillate, sometimes causing large parts of their adjacent processes to oscillate with them. This article describes how to tune level controllers.

An important thing we need to know about level loops is that liquid level in a vessel is an integrating process, which responds differently from a self-regulating process. Therefore it has a different process model that requires a different set of tuning rules. See my article on level control loops for some general guidance.

Level controller tuning really is not all that difficult if you follow a few basic steps. There are always a few outliers, but in general I like tuning level loops and find them reasonably easy to tune. If the level controller output cascades to a flow controller (more info here), you have to tune the flow control loop first. I’ll assume you have done that already and are now ready to tune the level loop.

You should tune any controller based on the process’ dynamic response. Obtaining a model for the dynamic response of a tank’s level is easy:

- Make sure as far as possible that the uncontrolled flow into/out of the vessel is as constant as possible.
- Place the level controller in manual control mode.
- Wait for a steady slope in the level. If the level is volatile, wait long enough to be able to confidently draw a straight line though the general slope of the level.
- Make a step change in the controller output. Try to make the step change 5% to 10% in size, if the process can tolerate it.
- Wait for the level to change its slope and settle into a new direction. If the level is volatile, wait long enough to be able to confidently draw a straight line though the general slope of the level.
- Restore the level to an acceptable operating point and place the controller back in auto.

Now determine the process model:

- Draw a line (Slope 1) through the initial slope, and extend it to the right (Figure 2).
- Draw a line (Slope 2) through the final slope, and extend it to the left to intersect Slope 1.
- Measure the time between the beginning of the change in controller output and the intersection between Slope 1 and Slope 2. This is the process dead time (td), the first parameter you require for tuning the controller.

Note: Express your dead time measurement in the same time-base your controller uses for its integral time setting, i.e. minutes or seconds. - Pick any two points (PV1 and PV2) on Slope 1, located conveniently far from each other to make accurate measurements.
- Pick any two points (PV3 and PV4) on Slope 2, located conveniently far from each other to make accurate measurements.
- Calculate the difference in the two slopes as follows:

DS = (PV4 – PV3)/T2 – (PV2 – PV1)/T1

Note: Express your T1 and T2 measurements in the same time-base your controller uses for its integral time setting, i.e. minutes or seconds. - If your PV is not ranged 0 – 100 %, convert DS to a percentage of the range as follows:

DS% = 100 x DS / (PV range max – PV range min)

Calculate the process integration rate (ri) which is the second and final parameter you need for tuning the controller:

ri = DS% / dCO

Now that you have the dead time (td) and the process integration rate (ri), you can tune the controller. If the control objective is a nice and fast response to quickly recover from disturbances, you can use a modification of the Ziegler-Nichols (Z/N) tuning rules. The modification involves a slight detuning of the controller because the original Z/N tuning rules result in a very aggressive loop response and low tolerance for any change in operating conditions. I call the amount of detuning the stability margin, denoted by SM. You should set SM to a value of 2.0 or larger. The larger you make SM, the slower the loop will respond. In this way you can use SM as a fine-tuning factor.

Note:

- The tuning rules below assume your controller’s proportional setting is in gain Kc, not Proportional Band, PB. If not: PB = 100 / Kc.
- The tuning rules below also assume your controller’s integral setting is in units of time Ti (i.e minutes or seconds), not repeats per time Ki. If not: Ki = 1 / Ti.
- The tuning rules below also assume you have a controller with an interacting algorithm (although they work fairly well on noninteracting algorithms too), but not a parallel algorithm. For controllers with the parallel algorithm, you need to divide Ti by Kc, and multiply Td by Kc, to obtain their integral and derivative settings, respectively.
- See my article on PID controller algorithms for more details.

To calculate tuning constants for a PI controller:

Kc = 0.9 / (SM x ri x td)

Ti = 3.33 x SM x td

Td = 0

And for a PID controller:

Kc = 1.2 / (SM x ri x td)

Ti = 2 x SM x td

Td = td / 2

Important Note:

Some level controllers should not respond fast, e.g. when controlling the level of a surge tank. Surge tanks need a different set of tuning rules to ensure you make maximum use of the surge capacity, while not exceeding the upper and lower level limits. Follow this link for tuning surge tank level controllers.

Stay tuned!

Jacques Smuts – Author of the book Process Control for Practitioners

Used this method this week to tune a level loop that has not run in automatic since installation (4+ years). Operators have been controlling level manually. Problem was that the level filled at a faster rate than it emptied. By taking into account both the filling and emptying rates in this formula, the loop was successfully tuned and has been running in automatic all week. The operators are extremely happy.

Thanks for the great blog and I look forward to reading your book.

Andrew

Maybe I’m missing something here.

You state “Make sure as far as possible that the uncontrolled flow into/out of the vessel is as constant as possible. Place the level controller in manual control mode. Wait for a steady slope in the level.”

If flow in equals flow out, won’t level remain constant? How will you ever see a steady state slope in level?

Love your blog BTW.

Ted, although it would make the calculations easier, this tuning method does not require that inflow = outflow. In practice, it is very difficult to get the level to remain absolutely constant. The level normally slopes up or down over time when the controller is in manual. As long as the inflow remains constant, and the outflow remains constant, the slope will be constant. That is why the procedure asks for a “steady slope” and not a constant level.

How can we make level control valve (or all level control loop ) responding faster to level change. especialy when the level rises and we dont want to over flow.

there is any improvement to add to level control loop to have that.

thanks

Belami – it is mostly the controller gain that determines how fast the valve responds to an increase in level. Increasing the controller gain will make the valve respond faster. However, using too much gain will cause the loop to become unstable. Using derivative control mode can speed up the response a little bit too. Use the tuning methods on this page. If the response is too slow, consider using feedforward control.

Hello Jacques. The above tuning method for level controllers works for both interactive and non-interactive PID algorithms without any conversion for the PID constants from interactive to non-interactive algorithms?

Thanks!

Emil – If you use PI control (no derivative) then no conversion is necessary. As I said in the second last bullet above, the PID tuning rules assume you have a controller with an interacting algorithm. But they work fairly well on non-interacting algorithms too. Ideally you should convert the PID settings from interacting to non-interacting for the best performance when using derivative.

Also, the process integration rate (ri) has a negative value, when calculated with the formulas from this page. Can be the negative sign simply neglected?

Emil – Good question. Yes you would ignore the negative sign on ri. However, if ri is negative you should configure your controller to be direct-acting (Error = PV – SP). If ri is positive you should be using an indirect-acting controller (Error = SP – PV).

Jacques – thank you very much for clarifications. Your blog is the best I found so far; everything is very clear and concise; exactly what an engineer needs. Congratulations. I really appreciate your effort.

Great write up. I’d like to try this method but have a simple question. If the level controller sends remote setpoint to a flow controller, how would it effect this method? The level controller output is in GPM (not % out) and is ranged 0-2300 GPM (not 0-100%). Wouldn’t this effect the tuning?

Eric: It depends on the DCS/PLC type. Most, but not all control systems convert the 0-100% to engineering units with no adjustment required to tuning. One Exception that I know of that does not internally rescale is the Emerson Ovation system. For users of that system, I suggest using 0-100% as the controller output range, and externally scale it to engineering units using a multiplication block.