dunc

linearisation on Q series?

11 posts in this topic

we have some storage tanks with coned bottoms. the levels are measured using radar. we wish to use some sort of linearisation table or function to account for the cone in the tank and acheive more accurate results.

my maths isnt the best, i was considering doing a rudementary offset table to achieve this, but i would like to do a nicer job if possible,

does the Q series (specifically a Q03UDE) have a function that could assist with doing a nice linearisation curve?

Edited by dunc

Share this post


Link to post
Share on other sites

Unfortunately I think you're going to have to use math, but it's nothing terrible.

I'm no math whizz, myself, but since no one else was providing a solution I thought I would try.

I may be wrong here.

You know the height of the liquid in the cone so you can figure out the volume using three math formulas.

Law of sines to figure out the distance on the angled length of the cone, so you'll need to go out to the tank and measure its angle or use math... but I think measuring it would be easier.

Once you have that angle(alpha) you will also know the second angle will always be 90 degrees(beta), because liquid level is flat.  You also know (side) because that's your height measurement.(See the formula below. Law of Sines.)

Pythagorean Theorem to calculate the radius of the cone as it changes when the height drops.

You previously calculated your hypotenuse and you know your height so just solve for the last distance.

Then volume of a cone.

Just make your height and radius D registers and use the simple math functions in GX Works to dynamically calculate the correct info.

I've never actually used the SIN and SQR functions in GX Works 2 but it should work for you in this case.

I used google to find all of these calculators.

Should be fun.

 

Law of Sines
Solve for 
side
 
 
 
 
a
=
b
 
sin
α
 
sin
β
   
α
Alpha
deg
 
b
Side
β
Beta
deg
 
abβαabβαabαβ

 

Pythagorean Theorem
Solve for 
hypotenuse
 
 
 
 
c
=
a
2
+
b
2
 
 
   
a
Leg
b
Leg
cbacbaabcPA

 

Right circular cone
Solve for 
volume
 
 
 
 
V
=
π
 
r
2
 
h
 
3
   
r
Radius
h
Height
rhlrhlrlhAb
1 person likes this

Share this post


Link to post
Share on other sites

Woops,

Looks like my formulas got scrambled,

 

Capture1.PNG

Capture2.PNG

Capture3.PNG

Capture4.PNG

Share this post


Link to post
Share on other sites

thanks for the input.

 

i had got to the point with the volume of a cone, but struggled to get my head round how to implement that within the PLC.

i have discussed with my colleague who is far better with maths than i am and he doesn't think it looks too bad!!!!

we have the added issue in this application of it being a coned bottom grain silo. we have issues as when it fills as it has a peak in the center, but when it empties we get a dip. we wanted to have an alternating linearisation curve which we would switch between depending on whether it is filling or emptying.

i will see how we get on with it and get back to you.

Share this post


Link to post
Share on other sites

thanks for your help.

managed to write a bit of code to calculate the volume of a cone and then switch to calculate the volume of a cylinder (and add the max volume of the cone too it)

i can now look to use this for different angles and then use this to proportion the tonnage readout accordingly. still needs a bit of work, but i have something to start with at least.

 

thanks again :-)

Share this post


Link to post
Share on other sites

LOL I ended up doing it too because I was curious.

Didn't need the whole Pythagorean theorem calculation, because I got the radius straight from the law of sines thingy.

Here's my example if anyone else needs it... only 14 lines of logic.

Tank Cone Calculation.gxw

Share this post


Link to post
Share on other sites

Posted (edited)

are you sure thats right?

i input the same figures into both yours and my code and we get different results?

is the further calculation using Pythagoras adding in some additional errors?

Edited by dunc

Share this post


Link to post
Share on other sites

Oh geez, you're right, I think I had divided my sines backwards.

I'm not much of a math guy... but I enjoy the challenge.

So I think this is right, with a tank that has a slope of 60 degrees and liquid level is 10 meters.... I get a radius of 8.66 meters and a volume of approx 785.

 

Is that close to what you came up with?

 

 

Tank Cone Calculation Revised.gxw

Share this post


Link to post
Share on other sites

Posted (edited)

when i run your original code with those figures i get a radius of 11.547 and a vlume of 1396?

with my code using your initial technique with law of sines then Pythagoras, i get 5.774m radius and a volume of 349.06 m3

using the modified version, just using the law of sines, but calculating the 3rd angle before using the law of sines, i get 17.375m radius and 3161.251m3 volume.

the volume calculation is done the same way on both.

i have passed this to my colleague who has far better maths skills than me to see if he can work out what is going wrong!

Edited by dunc

Share this post


Link to post
Share on other sites

right. my modified code had a mistake. they now both work.

speaking with my colleague he suggested using TAN rather than the rule of sines. as we have a 90 degree angle at all times, this works and is far simpler.

we divide the height by the tan of the slope angle to give us the radius. we then calculate the volume as before.

Share this post


Link to post
Share on other sites

final code has been done.

cone section has been calculated using the TAN function. i have also calculated the mound/hollow of grain using the same method (this is a grain silo).

the cylindrical section of the tank i elected to use linear interpolation. i have 2 tables setup, 1 for the fill and 1 for the empty. these switch between with a deadband to try and smooth the transition as best we can.

i just need to tidy it all up and put in the PLC to test once have the figures for the interpolation.

 

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