Horizontal Round Cylinder Tank Volume Formula

What is the point in doing precise math when the physical characteristics will be somewhat lacking.

Here in the UK, all brewing used "dip" or "strapping" tables, per vessel, to determine acceptably precise volume measurement for excise liabilities.

There was no calculation done at all, the "dip-table" gave an accurate volume from the dipped level of the liquid. These "dip-tables" were produced by specialist companies that filled each vessel through certified flow-meters.

Customs and Excise officials (often resident in larger breweries) used to record the produced volumes of every "brew" by using a graduated hard-wood stick (the dip) that was inserted into the top of the vessels. There was an attached "datum" that sat on the flange of the insertion hole. The distance to the liquid level from the datum was the input to the dip-table, the output being a calibrated volume.

Nowadays all excise duty is charged by product leaving the gate, presumably by weighbridge weight, but I have no idea how they account for the weight of the barrels ...
 
What is the point in doing precise math when the physical characteristics will be somewhat lacking.


The point is that

  1. As long as the math is at least as accurate as the known physical characteristics, it's good enough (as you note).
  2. The cost per computation for a PLC is negligibly cheap, essentially zero.
  3. The cost per computation for someone with a stick is extremely expensive by comparison, which is why they had a dip-table, and event that is expensive by comparison to a PLC.
  4. The calculations to make the dip table are no more complicated, and essentially the same, as doing the calculation in the PLC every time.
  5. The only complication is the lack of an arccosine function, which is easily remedied via the constrained Chebyshev polynomial from the 1972 NASA document, or could even be done almost as easily with a binary search and a built-in cosine function if present, which is essentially the same as loading a dip-table into the PLC.
 
Last edited:
[Update: I named the program sector; it should be named segment]


Another way to get there is to use the following algorithm:

  1. Say R is 10.0 (radius of the tank)
  2. Scale the level, L0, linearly between
    1. L0 = -10 (= -R) when the tank is full
    2. L0 = +10 (= +R) when the tank is empty
    3. e.g. L0 = 0 when the tank is half full
  3. Assign L0 to L
  4. Assign N = 1
  5. Assign Area = 0.0
  6. Add N * SQR((R-L)**3 * (R+L)) to Area; i.e. compute statement: Area <= Area + (N*(SQR((R-L)*(R-L)*(R-L)*(R+L)))
  7. Reassign L <= SQR(R * (R+L) / 2.0)
  8. Double N i.e. compute statement N <= N * 2.0
  9. Repeat steps 6-9 as long as N is less than 1,048,576 (i.e. repeat those steps 19 more times)
  10. Area will be a reasonable approximation of the cross-sectional area of a tank of radius R, filled to level (R+L0) below the top.
That would be not much more than half a dozen instructions if a loop was used.


The attached file implements this algorithm for MicroLogix 1100, but it is a lot more instructions because there is no CPT (compute) instruction.


And here is a screen shot of the program calculating the area of a drum with a radius of 10 that is full (L0 = -10) as 100 times π.


xxx.png




And this is a plot showing the exponential convergence of the algortihm:


ssgment.png
 
Last edited:
I added the .RSS and PDFs to Github repository, with the derivation of the algorithm.


It takes ~25ms per level-to-volume calculation on my MicroLogix 1100 Rev. B PLC, which may or may not be acceptable.


Yes, I have too much time on my hands.
 
Added RSLogix V16 implementation of arccos-free algorithm to Github repo.




segment_csa_acd.png
 
Can someone post PDF files here of tank calculation examples from rockwell site?

Yah, just a sec; although it's essentially the same formula from post #2 of this thread, using (1-ASIN(...)) instead of arccosine ... here it is (print screen => PNG; I hope that is close enough to a PDF); the double-.ZIP (.ZIP inside self-extracting .EXE) from the RA website (Access: Everyone) has a .L5X, which has the formula in plain text.


The 0.004329 a conversion factor from cubic inches to USgal, i.e. 1USgal = 231in**3 (btw, that 231in**3/USgal conversion used to be an exact integer).



P.S. this is from 61964.exe from the RA website; @Lare may be asking for 71508.exe.

rockwell_tank_volume.png
 
Last edited:
Yah, just a sec; although it's essentially the same formula from post #2 of this thread, using (1-ASIN(...)) instead of arccosine ... here it is (print screen => PNG; I hope that is close enough to a PDF); the double-.ZIP (.ZIP inside self-extracting .EXE) from the RA website (Access: Everyone) has a .L5X, which has the formula in plain text.


The 0.004329 a conversion factor from cubic inches to USgal, i.e. 1USgal = 231in**3 (btw, that 231in**3/USgal conversion used to be an exact integer).



P.S. this is from 61964.exe from the RA website; @Lare may be asking for 71508.exe.


Thanks!
 
I am curious how fast the AOI runs on real hardware, so if anyone would be willing to run the .ACD in the attached .ZIP, then many thanks!


It is set up to run on RSLogix Emulate 5000, I assume it can be configured work anywhere.


10s after Download and Run, the [ms] tag will give a rough idea of the time per scan.


Changing a_vertical to 1, then b_j101 to -1, will initiate another run using the vertical tank model, which does not use arcsine, so it might be noticeably faster. But maybe not.


On the emulator I get 20ms for anything; I assume that is the max speed of the emulator.
 

Similar Topics

Hello, We have a mechanical packaging machine ( horizontal flow pack machine ), which the OEM is no longer supporting the spare parts. The...
Replies
3
Views
2,218
Greetings from all the way down here in New Zealand:-) I have a challenge for you all..... I have a need for a PLC to run a Doser pump to pump...
Replies
34
Views
11,127
Hello All, Looking to see if it is possible to move an image across the screen and back based on tag value? I have a traversing head assembly...
Replies
7
Views
1,510
What keyboard shortcut(s) draw horizontal/vertical lines in the LD environment in GE Machine edition Logic developer?
Replies
0
Views
1,672
Hello all, I'm new to wonderware so please bear with me, I'm currently working on InTouch 9.5 and I wanted to know how I can do a Horizontal...
Replies
0
Views
1,658
Back
Top Bottom