PID loop but with external limiting factor


Thread Starter

Peter Thornton

Here is the outline of a problem that I'm trying to solve. I have a tank that contains a certain level of liquid. The flow into this tank is not controlled for the purposes of this loop. The flow out of the tank is pumped by a variable speed pump. So the task is to use PID control loop to keep the level in the tank constant by varying the speed of the pump. Simple - the level rises, the pump goes faster, the level drops the pumps slows. OK, but there's a complication. The device that the pump is pumping to can only accept flow up to a maximum rate (10 meters cubed/hour). So we have to limit the speed of the pumps so that the flow out of the tank doesn't exceed 10 M3/hr. I'm aware that this can cause the tank to overflow, but the customer doesn't care about this, they need to limit the flow to less than 10M3/hr. How can I go about limiting this? Should I vary the parameters of the PID loop as the outflow gets near 10M3/hr? Or should I disable PID control when the flow is near 10M3/Hr and re-enable it later? Or should I try something else entirely? All suggestions are gratefully received. Best regards, Peter Thornton EMR Radio & Telemetry [email protected]

Peter Nachtwey

I would limit the output of the PID and when the PID is limited prevent the integral term from winding up. That may required setting the integral gain to 0 until the output is no longer limited.
Peter: You have described what we call currently " Pump box". In mining we use hundreds of them. The box is there for the pump. The control is simple. A bubbler tube and P mode set at high gain, and pinch valve on the outlet side of the pump. Valve = Pump Overflowing the tank is no problem, your customer recycles back, elsewhere. Make sure you don't use I and/or D. The slight offset from P has no influence on the pump. Does it answer your question ?
I'd suggest option C (something else), and divide the problem into two loops, level and flow. The level control outputs a flow rate setpoint, which the flow controls to by varying the speed of the pump. The level loop's output can be limited to not call for a flow greater than desired. -- Ken Irving <[email protected]>
Peter: I have a few loops similar to this in my plant. I have a temperature loop cascading a set point to a steam pressure loop. The heat exchanger has a MAP of 600# and we use 800# steam. We set an upper set point limit of 600# on the steam pressure loop so we don't lift the safety relief valve. I'm assuming you have a flow meter on the pump discharge. You would then cascade a flow set point based on level, where the flow loop has an upper set point limit at or below your down stream maximum. If you don't have a flow meter, and hence can not make it a cascade loop, then an output limit based on the pump curve / characteristics with gap tuning may be another approach, but your control system may not support this. I hope this helps. Regards, Chris

Bruce Durdle

In many comercial PI or PID controllers you will have the option of setting an output limit. If this is available, set it so that it is at the value that gives the required maximum pump speed. If the controller you are using doesn't have this feature, swap it for one that does. Or wire the controller output to the motor drive via a Low Select, with another output set at the required maximum - but then you will need to consider how to avoid Integral Wind-Up problems if the controller output goes well beyond the limiting value. If you are trying to "home-brew" a controller to do this, good luck! Bruce.
You don't indicate what you are using to control this application, but I can think of two ways to accomplish your goal. If the pump's output flow is proportional to the speed (as with a positive displacement pump) then limit the maximum value that the output of your PID controller can achieve. If this is not the case, you can still provide the control desired by using 2 PID loops, one using on the level signal, the other using the measured product flow. Connect the outputs of each PID controller to a low override selector, and allow the selector to vary the pump speed. With this scheme, as long as the flow limit is not exceeded, the output of the level controller will be selected to vary the pump speed. When the maximum flow limit is reached, the flow controller output is selected and will act as a flow controller at your desired maximum flow. The use of override selector will prevent reset windup from occurring in the non-selected PID controller by keeping its output within a set percentage of the selected output, based on the error between PV and SP. This works very well in our location on a natural gas pressure control system. John Beck Pennzoil Quaker State Refinery Shreveport, LA


Just set the Max speed on the Variable speed drive to whatever speed gives you 10m3/hr. Even if the PID commands faster flow, the drive will clip the output at that speed. --Joe Jansen

Van den Brink, Raymond

There are several ways of doing this. 1) If you are not using a positive displacement pump - insert a restriction orifice in the line that will with a hole size that will only allow a flow of 10M3/h at pump maximum pressure. 2) If you are using a positive displacement pump - use the option above but insert a pressure relieve valve between the pump and restriction orifice. This valve must lift at the pressure in the line @ 10M3/h. The relieve line you feed back into your supply tank. This short circuits the pump and pressure/flow cannot increase further. 3) Limit the output of your controller (depending on make and type used) to the level where you get 10M3/h without the orifice. Regards Raymond van den Brink [email protected]
You should use a cascaded control structure with the inner Loop controlling the flow ( Flow sensor required) and the outer loop controlling the tank level. ___________ ____________ SPl | PID LEV | CVf | PID Flow | CVs ------->O-----| |---->O-------| |--------->VFD ^ |___________| ^ |____________| | | | | PVl PVf SPl Level Setpoint PVl Actual level CVf Control variable Level PID in m3/h = Setpoint for flow PID PVf Actual flow CVs Control variable VFD = Speed setpoint Then limit the output of the Level PID with your max flow. Most PID have that max limitation. Make shure that your PID algorithm limits the integral windup. If it doesnt you need to limit your integrator to the max flow as well. Best Regards Rolf RG Electrical Engineering & Consulting PO Box 37601, Winnellie NT 0821 Australia Tel: ++61 (0)8 8984 4385 Fax: ++61 (0)8 8984 4001 Mobile: 0417 837 933 Allen Bradley System Integrator Rockwell Strategic Software Provider