Advanced Control - Tank Level Control

Join Date
Apr 2002
Location
No income tax, no capital gains tax. Freedom!
Posts
8,381
The purpose of this thread is to use a simple system to show how one can approach systems that are much more complicated. Everyone knows, hopefully, that tank level control can be accomplished with just a proportional gain and or even an simple on off system using limit switches but that isn't the point. I intend this to be a college level 'class' and one doesn't waste good time and money on learning how to kludge a control system together. I feel a college level course should go deeper so excuse me if this seem like over kill but like I said, this is not simply about controlling the level of fluid in a tank but truly understanding what is really happening.

Getting started

If one wants to truly control the level and not use some on-off limits witch then this equation applies

in flow=out flow

If the the in flow is not equal to the out flow then the level will change

d level/dt = ( in flow-out flow ) / area

where the area is the surface area. Right now lets assume the surface are is a constant 1/meter^2. In reality the area may change if the tank is a horizontal cylinder, cone or a sphere so then the more general formula is

d level/dt = ( in flow-out flow ) / area(level)

If the surface area changes as a function of the level then 'complications' are introduce but I will show what to do about his later.

The d level/dt is the rate of change in the level. It should make sense that the greater the flow mismatch the faster the level will change and the greater the surface area the slower the level will change.

The above equations are the first differential equations. My first challenge is to expand the equation for in flow and out flow. There are two cases. In one case the pump controls the out flow and in the other case the pump controls the in flow. In hydraulics Q is used to represent flow so Qin is in flow and Qout is out flow. Just so everyone is using the same terminology lets assume the tank has a volume of 1 cubic meter with a constants surface area of 1 meter squared. Flow is in cubic meter/min. In the case where the pump is controlling the out flow assuming the in flow is Qin(t) which is some function of time we don't have control over but must be in the equation. Do your best, the equations may still seem very general and not good enough for real use but it will be a start.

I helped a college student with a problem like this on LinkedIn about 2 years ago. The difference is that there were two cascaded tanks. I told him I would not give him a passing grade unless he could write the differential equation for his system. He couldn't do it without some help. He still got an A grade from his instructor.

“When you can measure what you are speaking about, and express it in numbers, you know something about it, when you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely, in your thoughts advanced to the stage of science.”
― William Thomson
aka Lord Kelvin
 
Okay, so the greater the area compared to the difference between the input and output flow, the lower the rate of change.

So far so good :)

Thank you for starting out slow - I hope I will be able to keep up.
 
I'll hazard a try.

If level is what we are looking for, I'd say the gain is

1/area
Yes! If the area is constant as a function of level then then system gain is constant but what if the area of the tank varies as a function of the level? Then the controller gains should also change as a function of level. Tank level control seems simple but it can get complicated quickly.

For the moment assume the surface area is constant as a function of level.
 
Going forward with the pump controlling the outflow.
Lets do a simple proportional only control but first lets assume the pump response quickly to any speed changes so the pump and and tank can be thought of as being the 'plant'. The pump gain is Kp with units of cubic meters per minute per % control output. So now the plant is Kp/area and the units are meters per min per % control output.
In Laplace transforms the plant is now Kp/(area*s) where s is the Laplace operator. You should have had Laplace transforms in the first two years of college.

Now define the proportional only controller as Kc*(1+1/(ti*s)+td*s). Kc is the controller proportional gain, ti is the
integrator time constant and td is the derivative time constant. Kc will have units of % control output per meter of error. I have displayed the integrator and derivative terms since we are only going to do proportional control this simplifies to just Kc.

Now we can derive the close loop transfer function. See this:
http://en.wikipedia.org/wiki/Control_theory
Look at the diagram.
Control guys use r for the set point, y for the PV and u for the CV or MV. I often use CO too.
C is the controller. In this case it is simply Kc.
P is the plant Kp/(area*s)
F is the feed back that is assumed to be 1 with no time delay.

So
H(s) = (Kc*Kp/(area*s))/(1+Kc*Kp/(area*s)))
This simplfies down to:
H(s) = 1/((area/(Kc*Kp)*s+1)
This is a simple first order system. If s is set to 0 then H(0)=1 which means the PV/SP=y/r=1 so y=r and there is no error. The interesting part is the (area/(Kc*Kp) term. This is the time constant which remains constant
as long as the surface area of the tank remains constant as the level changes. If a lot of water is poured into the tank so the level rises above the set point it will take 5 time constants
for the level to reach within 1% of the SP.

If the proportional gain is increased it the level will reach the SP faster. This should be intuitive.
The key point is that at steady state the error will always be 0 and there is no chance of oscillating.
Controlling the outflow is easy when the fluid stop entering the tank. Now what happens when the in flow changes?
More to come.
 
Doesn't it make sense that the larger the surface area of the tank the slower the level will change for any volume of added water? I will explain in more detail in my next post where I add the pump to the "plant".

Yes, it does, because you are inferring the overall tank volume via surface area. The only variable that you aren't accounting for by doing so is hydraulic head. Of course, that effect would be negligible to the process control and would only confuse matters, so I'll shut up and listen now. 📚

This is a very interesting thread. Thanks for doing it.
 

Similar Topics

This video shows the things I think about on page 1. I use Laplace transforms a lot. Laplace transforms allow one to express differential...
Replies
2
Views
1,805
Oh No! Not that again! I will start out sort of simple ( evil thoughts ) Suppose I have a tank that is 4 meters tall with a constant surface area...
Replies
15
Views
7,397
Is anyone interested in covering this topic at a college level? Tank level control is a simple application but I can go where most have not gone...
Replies
26
Views
6,530
Instead of this info getting lost in another thread I will start a new thread. For those that don't know you can search for Advanced Control on...
Replies
8
Views
2,642
sampling data. I will probably use this in a magazine article.
Replies
18
Views
8,363
Back
Top Bottom