Flow Control On Tank Without Many Inbound Signals

.... I need to keep the flow leaving the product tank as constant as I can, using the 12m height (workable range 9m) as a buffer which is allowing the product to rise and fall without affecting the flow as best as is possible......

..... I do not know the rate at which the product is entering the tank .....

This is not a training problem. This is not a tuning problem. This is not a problem that can be solved with differential equations. This is an example of the laws of nature overriding the desires of an engineer.

A simple feedback control loop, PI or PID or whatever, should be able control the flow out by modulating pump speed. At that point, given your control system measurements, you are done.

Assume for sake of argument that control out of the tank is working perfectly and you have a constant flow out of the tank. If the flow into the tank is greater than the flow out of the tank then the tank level will rise. There is nothing you can do about that. The rate of level increase will be a direct function of the difference in the two flows and the area of the tank.

If the flow into the tank is lower than the flow out the level will fall according to the same relationship.
 
jamesau, you suggested using PI control. I have already discussed why PI control can't be used if the flow is to remain relatively smooth. The PV can change rapidly so the P term will cause rapid changes to the control output. Using a PI in the inner loop would be a disaster because the set point to the inner loop will be noisy. The rapidly changing SP and PV of the inner loop will cause the output to fluctuate a lot.

Something I didn't ask which is something that Tom hinted at. Why have an out-flow meter? If you know the speed of the pumps you should know the flow unless the pump flow in not linear with speed like Tom suggested.

Think about it guys, what SilverShotBee wants is to turn his tank into a low pass filter with a level override so there is no over or under flow.
 
Given the originally stated objective of constant flow out of the tank, the level measurement is a red herring. Using the available I/O all you can do with level is alarm on high or low level. Peter is right in saying the tank's function is to damp fluctuations in supply flow to the tank.
 
This is not a problem that can be solved with differential equations. This is an example of the laws of nature overriding the desires of an engineer.
??? I can use differential equations, state space or Laplace transforms to model this system. A real engineer would have done that already an provided the best algorithms to the PLC programmer as to how to control this system. This is why I have such contempt for most mechanical engineers and even professors. They can't or don't do the simulations before hand.

A simple feedback control loop, PI or PID or whatever, should be able control the flow out by modulating pump speed. At that point, given your control system measurements, you are done.
I have already explained why a PI or PID will not work if you want to keep the flow rate from changing rapidly, A PID will only work if the P and D gains are near zero or don't exist.

Assume for sake of argument that control out of the tank is working perfectly and you have a constant flow out of the tank. If the flow into the tank is greater than the flow out of the tank then the tank level will rise. There is nothing you can do about that.
That is true but the flow rate can change slowly.

The rate of level increase will be a direct function of the difference in the two flows and the area of the tank.
This is true too.

If the flow into the tank is lower than the flow out the level will fall according to the same relationship.
Yes, but the tank and control can function as a low pass filter that basically smooths the in-flow. The out-flow will not be constant but it can change very slowly relative to the in-flow as long as there is no under or over flow. The response will be stable. Low pass filters are stable.
 
??? I can use differential equations, state space or Laplace transforms to model this system. A real engineer would have done that already an provided the best algorithms to the PLC programmer as to how to control this system. This is why I have such contempt for most mechanical engineers and even professors. They can't or don't do the simulations before hand.

Let me clarify. I wasn't saying the system couldn't be modeled with differential equations. It obviously can, and if that had been done, with proper inclusion of mass balance, the original poster would have realized that level can't be controlled. I was referring to the multiple attempts to use all kinds of devices to include level in the flow control logic, which cannot be done.
 
I thought this was an interesting problem so I did model it

I don't have exact values. I do know the peak in-flow and the level has a span of 9 meters so I assumed 1-10 meters with the set point at 1 meter.
I used a low pass filter. I made two slightly different simulations but the results were similar.

No matter what the out-flow must mach the in-flow eventually. Tom mentioned this. However the out-flow can chase the in-flow slowly if the surface area of the tank is big enough. The larger the surface area the more smoothing there will be.

The simplest method I came up with was to go back to a simple proportional band so the out-flow is 0 at 1 meter and 100 at 10 meters. The trick is to filter the PV with a low pass filter and use the filtered PV for the closed loop control.

The only problem with this is that if the filtering is too much and the in-flow increases rapidly the pump will not increase its flow fast enough to keep the actual PV below 10 meters. Increasing the surface area of the tank allows for more filtering and slower changes to the out-flow.

If I knew the total pump capacity and tank surface area that would be a help but since the tank exists there is nothing that can be done to make the tank surface area larger.
 
Let me clarify. I wasn't saying the system couldn't be modeled with differential equations. It obviously can, and if that had been done, with proper inclusion of mass balance, the original poster would have realized that level can't be controlled.
The OP is trying to smooth the out-flow. My filter technique does a poor job of controlling the level but it smooths the out-flow. The big problem is the filter doesn't allow the pump to respond faster enough to prevent over flows unless the filtering is turned down.

I was referring to the multiple attempts to use all kinds of devices to include level in the flow control logic, which cannot be done.
One thing that can be done is to make the filter time constant faster as the level get close to the top. The out-flow would change faster in order to avoid overflow.
 
^
Just curious, what algorithm are you using for the low-pass filter?
I just used a simple low pass filter like what has been posted here so many times before. One simulation uses a LP filter like I showed above. The only difference is that I can calculate what the optimal gains and low pass filter time constants should be and my low pass filter has a gain.

I will post my two simulations tomorrow so you can see the calculations.
These calculations make some assumptions. I assumed a surface area for the tank. If the OP can tell me the actual surface area the simulation will be more accurate. I assumed a max pump flow. If the OP can tell me what the actual max pump flow is the simulation should be right on target.

We are also missing a specification such as the flow can't change at a rate of put flow by more than 0.01 cubic meter per second per second.

I could have used PI control but it is over kill since we don't really want to control level as longs as it stays with a specified level range.

I really would like to know what Shinskey has to say about this. What I propose is something you don't find in the text books. I can do the calculations/simulations. Given a specification I can find the best tank surface area and time constant. I know how to optimize many variables at once given a cost function that needs to be minimized. These techniques lead to optimal design.

I love tank level control problems. They seem so simple and they should be for the PLC programmers. However, the mechanical designer should know how to optimize the design. The mechanical designer should know what is the best way to control his contraption and provide gains and time constants and let the PLC programmer know when the time constants are not constant. If you remember from my Advanced Control, Tank Level Control, time constants aren't always constant.

I have yet to see a transfer function for any mechanical contraption unless I generated it.
 
I have yet to see a transfer function for any mechanical contraption unless I generated it.

I think any civil or mechanical engineer here in the water industry would look at me blankly if i asked for such a thing.

The Automation engineer arrives last on the job and has to fix any civil or mechanical **** ups that aren't big enough to make things completely inoperable. "Can't you just write some code to stop that?" Is something i hear all too often!
 
The Automation engineer arrives last on the job and has to fix any civil or mechanical **** ups that aren't big enough to make things completely inoperable. "Can't you just write some code to stop that?" Is something i hear all too often!

Amen to that
 
OK, so now you guys know why I have the same contempt you guys do for lazy engineers.
A real engineer would make simulations similar two what I have done. It doesn't take much time. With out a simulation one can't design the tank without guessing. The volume is critical to smooth the in-flow. Think of the tank as a big capacitor for a power supply that reduces ripple.

If I were doing this for real I would try to get some data on the expect in-flows over a week or so. I had to fake in-flow data.

Below are links to the two simulations. One uses the method I mentioned above. It uses a low pass filter with gain for control. The second uses a low pass filter to smooth the in-flow data and then uses a simple proportional band. Both methods works but since most here understand simple low pass filters and proportional bands I would suggest trying the second method first.

The first link uses some advanced techniques to calculate the filter gain and time constant by specifying a closed loop time constant. In the end I had to adjust the closed loop time constant because if I made them too long the tank would over flow but making the time constants too short reduces the filtering.

Neither simulation really tries to control the level except to keep it within the 1 to 10 meter range.

Also, the closed loop algorithm doesn't need to run as fast as every second. Every 10 seconds seem to work fine with little difference.

Compare the two simulations' graphs.
http://deltamotion.com/peter/Mathcad/Mathcad - t1 lp level.pdf
http://deltamotion.com/peter/Mathcad/Mathcad - t1 lp PB level.pdf
 
I would do this with 2 PIDs one for flow and one for level. The flow PID would be the normal control. Set the level PID at your max level and let it take control by way of a signal select to override the flow control.
Integral (reset) windup can be handle through logic by writing to the PID's min/max output parameters dynamically, this makes for a smooth transition between PID's. A low level shut-off should also be considered to protect the pumps.
 
Last edited:
Peter,
Thanks much for sharing your insights and posting those files. Like others here, this kind of math was much more familiar to me 25 years ago but I find myself with a newfound desire to get reacquainted with it and plenty of opportunities in my current job position to use it. Keep it up!
 
I don't care how many graphs and differential equations you try, if you maintain a constant output flow with a variable and uncontrolled input flow then you cannot control level. You can't beat the Law of Conservation of Mass.

Remember, the original post said the objective was " ... a system to control the flow leaving a product tank ..."

Make it simple - assume the pump is positive displacement. Then the flow of product out of the tank is constant at a constant pump speed.

Qout = constant
Vtank = Level x Area Therefore Level = Vtank / Area

As a function of time:
Vtank(t) = V(0) + (Qin - Qout) = V0 + (Qin - constant)
Level(t) x Area = Level(0) x Area + Qin - constant

Level(t) = Level(0) + ((Qin - constant) / Area)

The level in the tank will be a function of the inlet flow rate. Period. End of story. It cannot be controlled.

If a centrifugal pump is used, at constant speed the flow out will vary as an uncontrollable result of the pump characteristic curve. The purpose of the feedback control in this system is to adjust the pump speed to compensate for the pump characteristics as the differential head varies.

The only way to control level is to vary the flow out of the tank, which is the opposite of the original objective! Peter's graphs confirm this - they show a variable output flow. That isn't what the original post asked for.

Don't overthink this.
 
Last edited:

Similar Topics

I was just presented with an application requiring control of two separate valves, each controlling individual flows into 2(or 2 sets of 2) tanks...
Replies
17
Views
4,980
Hello All Could we get some expertise on flow control ? -Using a PID loop in Productivity 2000 with an analog output, How can we convert...
Replies
19
Views
1,576
Hello: I am experiencing the following error: [ERROR] C0297: Stack overflow detected in DecodeOID. Maximal Stack Size: 64512. Calculated...
Replies
8
Views
1,217
Hi all, i'm after some help on a flow control valve control strategy. There are 8 parallel vessels that require evenly distributed flow. Each...
Replies
32
Views
6,969
Hello all, I am new to pid loops and control. I was wondering how to control a system with two process variables. This is a water system with a...
Replies
7
Views
2,007
Back
Top Bottom