Sign in to follow this  
Followers 0
mhowasso

Horizontal Cylinder Tank Volume

35 posts in this topic

Well...like everyone else I like it to be as accurate as possible..but I know "as possible" might be off a little. And its not like we are selling jet fuel..its just for reporting. But the problem is still the coding in the ML1500...some people have siad I cant do this in a ML1500 while others say it can be done, but no one has shared a line of code that shows how its done. In a way Im more confused now than when I started. Thanks,

Share this post


Link to post
Share on other sites
I attached a file showing how I would do it in the MLX1500. The calculation proceeds step by step using something called Horner's method. Volume = -0.0187*h3 + 4.0443*h2 + 163.51*h - 368.98 First you multiply the first coefficient (-0.0187) by the height and store it in F8:0 Then you add the next coefficient (4.0443) and store in F8:0 Then multiply this result by the height again and store in F8:0 Then add the next coefficient (163.51) and store in F8:0 Then multiply this result by the height again and store in F8:0 Lastly, add the last coefficient (- 368.98) and store in F8:0 At this point, F8:0 contains the result of the equation. For good measure, I usually copy the value from what I call the working register (F8:0) to another register (F8:2 in my example) so that if the volume is displayed somewhere the screen numbers don't jump around as the calculation is occurring. Hope this makes sense. If the calculation is confusing, I recommend writing it out by hand step by step so you can see how it works. TANKVOLUME.pdf Edited by ndzied1

Share this post


Link to post
Share on other sites
Here you go ... Result in F8:7 BST MUL N7:0 N7:0 F8:0 NXB MUL F8:0 N7:0 F8:1 NXB MUL F8:1 -0.0187 F8:2 NXB MUL F8:0 4.0443 F8:3 NXB MUL N7:0 163.51 F8:4 NXB ADD F8:2 F8:3 F8:5 NXB ADD F8:5 F8:4 F8:6 NXB SUB F8:6 368.98 F8:7 BND

Share this post


Link to post
Share on other sites
Huh. Clearly the ML1500 is even more basic than I realised. Oh well, at least the rung above will make it look more complicated than a single CPT instruction. Makes you look smart ;)

Share this post


Link to post
Share on other sites
Hi All, I just wanted to say just how impressed I am with all this new information. I will try this soon and let you know how it works out..!!! This is kind of exciting..!!! IF this all works out I will post the program so someone else might benefit from it. Thanks again, Mark

Share this post


Link to post
Share on other sites
Hi... Exactly what are the values: -0.0187, 4.0443, 163.51 and -369.98 I need to know what these represent. Thanks

Share this post


Link to post
Share on other sites
If I understand correctly, these are just arbitrary numbers that ndzied arrived at by plotting a graph of the values from you tank, and then finding the line of best fit

Share this post


Link to post
Share on other sites
You are correct. First I found an online calculator that procured a table of tank volume for every inch of liquid height. Not sure if this was the site I used but something like this: http://www.odayequipment.com/Support/TankChart/tankchartcalculator.shtml Then I read the table into Excel and created an X-Y chart of height vs. volume. I had to do a little number parsing to separate the height and volume numbers. Depending on your familiarity with Excel this can be a 1 minute simple task or a confusing mountain. Next I used a little known feature in an excel chart to get an approximate function representing the data. You right click on the chart line and select trend line. This plots the trend line which gives you a visual BUT, and here's the cool part, you can also ask Excel to display the equation for the trend line. This is where I got the polynomial coefficients in question. They are numbers that Excel spit out after it used its internal routine to create a best fit trend line.

Share this post


Link to post
Share on other sites
Hi All, Well, I tried the logic in the ML1500 and while it works well and is closely accurate through out the full range (especially since before we had nothing) it is not accurate enough for our auditors. But using the original formula with arcsin in the HMI it works perfect. So that has been decided to be used. Thanks for all the advice and help...I truely appreciated it, and this has been very fun and educational for me. What seemed so simple in the beginning turned out not to be after all. I learned to be carefull assuming all PLCs can do everything, and not all tanks are simple to calculate volume. Thanks again, Mark Edited by mhowasso

Share this post


Link to post
Share on other sites
Clearly your auditors are also basing their judgement on the assumed tank dimensions and regularity, with little regard for the accuracy of those. But if you have found a solution that keeps them happy, all is good! Let us continue to hope that the figures they gather are a close enough match to delivered volumes, so that they don't come back later and ask why they don't match.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0