Stuck with a calculation

harrisoncw

Member
Join Date
Jul 2006
Location
Cape Town
Posts
20
Good day all.

I need to monitor the level of a cylindrical vessel. I am receiving an analogue linear signal back from the vessel and need to convert it to a percentage form that is representative of the vessel's shape.



I am using A SLC 500 and I cannot find any Math's block in the RSLogics 500 software to help me.



Thanks for the great sight.
 
There are approximations for the volume that may suit your purpose that do not use trigonometric expressions, Google "area of a segment of a circle" to see if they will help. Alternatively, work out the volume using a spreadsheet and generate a look-up table which you can use in the plc.
 
I assume you mean a horizontal cylindrical tank with flat ends.

r = radius of the tank.
l = length of the tank.
h = height of liquid in the tank.

volume = l * (pi*r^2/2 - r^2*arcsin(1-h/r) - (r-h)*sqrt(h(2r-h)))

If your tank has cylindrical or conical ends then this gets quite a bit more complicated. The equation is already math intensive enough and some PLCs don't do trig.

What kind of accuracy is needed? If extreme accuracy is not necessary or your PLC does not do trig then you may want to consider using a look up table in conjunction with a simpler line equation.

If your SLC500 is a SLC 5/03 or above then it can do trig. The arcsin is performed by the ASN instruction and square root is done by the SQR instruction. I recommend using the CPT instruction as well.

If you have Logix5000 for a ControlLogix PLC then take a look at this thread here. It has a ST sample program in it.
 
Last edited:
Dumb question alert.

Alaric I have to ask. What is the length of a cylinder when height is expressed?

I thought volume of a cylinder was pi times r-squared times height.

This does not include dome tops etc.
 
Harrisoncw: Be warned that the SLC500 does trig in radians. Make sure you account for that in your program.


Ron, pi times r-squared times height works for vertical cylindrical tanks. But horizontal cylindrical tanks are another matter. We need to calculate the area between the circle defined by the tank walls and the cord as defined by the top surface of the liquid. Then multiply this by the lenght of the cylinder. The equations you linked at mathforum is a great one for a horizontal tank with domed ends. I'm going to hang on to that one just in case I ever need it so I don't have to work out the equation my self.

--------------------------------------

For vertical cylindrical tanks with domed bottoms or conical bottoms then the solution is a two part solution. For low tank levels where h is defined as being below the cylinder and in the dome or cone then we can use simple volume of a cone equations or volume of a sphere/ellipsoid equations. For values of h where h is above the dome/cone and in the cylindrical section, we can use pi*r^2*h + the known volume of the dome/cone.

Also in a PLC its a good idea to avoid unnecessary mathematical computations. Quantities that are fixed, such as the cross sectonal area of a vertical cylindrical tank should be precalculated - not re-calculated by the PLC every scan. Thus for a 24 inch diameter vertical tank the area is 452.4 sq. inches. Use this area value times the height. Likewise for a horizontal tank, the values for pi*r^2/2, r^2, and 2r are unchanging. Don't make the PLC recalculate these every time.
 
rsdoran said:
Alaric I have to ask. What is the length of a cylinder when height is expressed?

I thought volume of a cylinder was pi times r-squared times height.

This does not include dome tops etc.
My guess is that Alaric is calculating this with the cylinder axis horizontal. This makes it much, much more complicated than what you posed in your (supposed) "dumb" question.

Confession: I thought the same thing at first...And don't be so hard on yourself. That's what we're here for.
 
Now the volume of this one will will reuqire a few more steps. Looks like we have a cylinder + a cone + an ellipsoid. Out of curiosity, is anyone familiar with the inner arrangement of this style? Is the entire structure filled with water including the riser? Or is the riser just a support structure with smaller pipes concealed within it?

Water-Tower.jpg



edited to link to smaller image.
 
Last edited:
Nevermind, I found the answer. The riser is just a support structure with pipes and access tank access stairs concealed inside of it.
 
10 poiint look-up table

An alternative to math for horizontal round tank volumes is a 10 point lookup table. The values in the the table values listed on the single page attached pdf advertise only 0.3% error.

The water towers (some people call them stand pipes) that I've worked on have had strapping tables with exact volumes calculated for incremental elevations.

Dan (hope the file attachement works, can't see it in preview)
 
Alaric said:
Nevermind, I found the answer. The riser is just a support structure with pipes and access tank access stairs concealed inside of it.

Yep! When I was a kid, a couple of buddies and I found that the local one at the fire station had been left unlocked and we climbed the inside all the way to the very top. Quite the view and no fencing!
 
All,

Wow! "we climbed the inside all the way to the very top." SO .. then the stairs go all the way through the storage tank? Now that would be hard to calculate! Tank would be shaped like a donut.
BD
 
It was 33 years ago and I don't recall the interior details other than there were some landings every so often, the hatch at the top and bottom were open, and I'm assuming the interior walls were the tank. The township was getting ready to move it about 20 yards to make room for a highway. It was this style:
97px-Carmel-indiana-water-tower.jpg
 
Here is a picture of one under construction. You can see that there is indeed a center column up through the middle.
WambaTXWaterTowerTopViewCBurns.jpg



Here is a picture of the interior of one.


We don't see any of these around here where I live. Thats because I have a huge mountain in my backyard so its not necessary to build large raised tanks to develop pressure.
 
Last edited:

Similar Topics

Hi, I am using M221 reading from 3 different sensors (modbus rs485) sharing same bus (daisy chain). I am currently using READ_VAR (in total...
Replies
0
Views
84
I'm using one TON (called SystemTimer) throughout a program that I change the .PRE given different conditions. I'm porting an IDEC ladder over to...
Replies
8
Views
315
We have a keg check weigher that that lost a fight to a forklift. The scale was previously a Systec IT3000, which was the only PROFIBUS slave...
Replies
5
Views
672
really strange issue. The panelview(2711p-T10C22D9P) will try to load an application and get stuck on "Starting Alarms". If I reboot the...
Replies
4
Views
1,445
Have an issue with a couple of KTP700F HMI's that gets stuck on the startup in the Windows screen and not loading the HMI project. THis is not the...
Replies
3
Views
1,394
Back
Top Bottom