waterboy
Nov 29 2006, 12:05 PM
Can someone walk me through the Indirect Square root formula as it pertains to Differential Pressure transmitters?
I know this isn't strictly PLC related but this is a pretty smart group surely you have all dealt with this before?
This is for diff pressure transmitter calibration and I would to prepare a spreadsheet with multiple input points of pressure in whatever value (in. H20 or PSI ) and the expected mA output from the device.
panic mode
Nov 29 2006, 12:25 PM
i don't understand the question. it seams that you want to know how to linearize analog input.
if that is the case, try collecting few points (each point will have both sensor output and correct value).
use something like CurveExpert 1.3 (
http://curveexpert.webhop.net/) to find suitable fit
(square root, polinomial or whatever).
Mickey
Nov 29 2006, 12:34 PM
QUOTE(panic mode @ Nov 29 2006, 12:25 PM) [snapback]44723[/snapback]
i don't understand the question. it seams that you want to know how to linearize analog input.
if that is the case, try collecting few points (each point will have both sensor output and correct value).
use something like CurveExpert 1.3 (
http://curveexpert.webhop.net/) to find suitable fit
(square root, polinomial or whatever).
Like panic I'm not sure i understand your question.
Most transmitters have build-in the abilitiy to scale the output ( 4-20ma) to repersent H2O or to extract
the square root. Check your transmitter configuration setup.
waterboy
Nov 29 2006, 01:00 PM
QUOTE(Mickey @ Nov 29 2006, 09:34 AM) [snapback]44724[/snapback]
QUOTE(panic mode @ Nov 29 2006, 12:25 PM) [snapback]44723[/snapback]
i don't understand the question. it seams that you want to know how to linearize analog input.
if that is the case, try collecting few points (each point will have both sensor output and correct value).
use something like CurveExpert 1.3 (
http://curveexpert.webhop.net/) to find suitable fit
(square root, polinomial or whatever).
Like panic I'm not sure i understand your question.
Most transmitters have build-in the abilitiy to scale the output ( 4-20ma) to repersent H2O or to extract
the square root. Check your transmitter configuration setup.
I'm sure I'm mangling the question too.
I would like to measure the output of the device to see if fits what the mathmatical calculation comes up with.
Say I have an pressure input of 50% of the scale of the transmitter . Because the output in mA isn't linear,I won't get 12mA output, I have to use the Indirect Square root formula to calculate the expected mA output from the device.
If I understood the formula I could build the spreadsheet easily enough but the terms aren't yet familiar to me.
The bottom of this shows the formula:

It's going to be elementary once I get familar with what values to put into the terms but I can't get that part.
i.e. Out_Scale.EU0 is what value? same for Field_Val and Out_Scale.
panic mode
Nov 29 2006, 01:53 PM
well this should be obvious, let me see if I can explain it.
your help file screen shot seam to focus on 0-100% range (ti is everywhere
in your example).
EU is Engineering Units (V, A, gallons/min, psi, miles, whatever)
EU0 and EU100 are EI (engineering units) for 0 and 100%
So if your pressure is 30-75psi, then 30-75psi is 0-100%
or 0%=30psi and 75psi is 100%
so those values in this case are just the range limits (30 and 75).
Thise values are fixed (they normally don't change).
An output example they have shown is for temperature in degC, range -100...400degC,
Input range is +/-50mV (EU_0=-50, EU_100=+50).
Note that all of this is LINEAR. As an example there are three possible output types
and only the last formula (Indirect Square Root) is not linear. Is this what you
really have (L_TYPE= Indirect Square Root)?
newpageboba
Nov 29 2006, 01:55 PM
It is very basic, but remember the units.
use 0-100% and remember 100%=1 therefore 50% =.5
So,
if your pressure is 0% of input range, your square rooted output will be 0% of output range (4ma)
if your pressure is 25% of input range, your square rooted output will be 50% of output range (12ma)
if your pressure is 50% of input range, your square rooted output will be 70.7% of output range (15.3ma)
if your pressure is 75% of input range, your square rooted output will be 86.6% of output range (17.8ma)
if your pressure is 100% of input range, your square rooted output will be 100% of output range (20ma)
waterboy
Nov 29 2006, 02:00 PM
QUOTE(newpageboba @ Nov 29 2006, 10:55 AM) [snapback]44730[/snapback]
It is very basic, but remember the units.
use 0-100% and remember 100%=1 therefore 50% =.5
So,
if your pressure is 0% of input range, your square rooted output will be 0% of output range (4ma)
if your pressure is 25% of input range, your square rooted output will be 50% of output range (12ma)
if your pressure is 50% of input range, your square rooted output will be 70.7% of output range (15.3ma)
if your pressure is 75% of input range, your square rooted output will be 86.6% of output range (17.8ma)
if your pressure is 100% of input range, your square rooted output will be 100% of output range (20ma)
That is helpful. Can you show me the math you used. (and what is "indirect" about it?)
newpageboba
Nov 29 2006, 02:04 PM
QUOTE(waterboy @ Nov 29 2006, 02:00 PM) [snapback]44731[/snapback]
QUOTE(newpageboba @ Nov 29 2006, 10:55 AM) [snapback]44730[/snapback]
It is very basic, but remember the units.
use 0-100% and remember 100%=1 therefore 50% =.5
So,
if your pressure is 0% of input range, your square rooted output will be 0% of output range (4ma)
if your pressure is 25% of input range, your square rooted output will be 50% of output range (12ma)
if your pressure is 50% of input range, your square rooted output will be 70.7% of output range (15.3ma)
if your pressure is 75% of input range, your square rooted output will be 86.6% of output range (17.8ma)
if your pressure is 100% of input range, your square rooted output will be 100% of output range (20ma)
That is helpful. Can you show me the math you used. (and what is "indirect" about it?)
for 25% i took the square root of .25 which is .5 or 50%
for 50% - the square root of .5 is .707 or 70.7%
hope this helps.
Is this for a flow measurement?
If so, you would need to know what 100% Diff Press represents in flow.
It looks like indirect means not direct with square root added????
waterboy
Nov 29 2006, 02:13 PM
QUOTE(panic mode @ Nov 29 2006, 10:53 AM) [snapback]44729[/snapback]
well this should be obvious, let me see if I can explain it.
your help file screen shot seam to focus on 0-100% range (ti is everywhere
in your example).
EU is Engineering Units (V, A, gallons/min, psi, miles, whatever)
EU0 and EU100 are EI (engineering units) for 0 and 100%
So if your pressure is 30-75psi, then 30-75psi is 0-100%
or 0%=30psi and 75psi is 100%
so those values in this case are just the range limits (30 and 75).
Thise values are fixed (they normally don't change).
An example they have shown is for temperature in degC, range -100...400degC
Note that all of this is LINEAR. As an example there areh three possible output types
and only the last formula (Indirect Square Root) is not linear.
Is this what you really have?
yes indirect is what the instrument states (its a vortex flowmeter if that helps). If it were linear I would have a better vision of the charted values to expect, but like newpagebob showed, it's more exponential in it's output. it really climbs toward the middle and then tapers off toward 100%. That isnt' as easily absorbed to me. I need to see a graphed example.
QUOTE(newpageboba @ Nov 29 2006, 11:04 AM) [snapback]44732[/snapback]
QUOTE(waterboy @ Nov 29 2006, 02:00 PM) [snapback]44731[/snapback]
QUOTE(newpageboba @ Nov 29 2006, 10:55 AM) [snapback]44730[/snapback]
It is very basic, but remember the units.
use 0-100% and remember 100%=1 therefore 50% =.5
So,
if your pressure is 0% of input range, your square rooted output will be 0% of output range (4ma)
if your pressure is 25% of input range, your square rooted output will be 50% of output range (12ma)
if your pressure is 50% of input range, your square rooted output will be 70.7% of output range (15.3ma)
if your pressure is 75% of input range, your square rooted output will be 86.6% of output range (17.8ma)
if your pressure is 100% of input range, your square rooted output will be 100% of output range (20ma)
That is helpful. Can you show me the math you used. (and what is "indirect" about it?)
for 25% i took the square root of .25 which is .5 or 50%
for 50% - the square root of .5 is .707 or 70.7%
hope this helps.
Is this for a flow measurement?
If so, you would need to know what 100% Diff Press represents in flow.
It looks like indirect means not direct with square root added????
yes, a vortex flowmeter for plant influent
newpageboba
Nov 29 2006, 02:42 PM
Using Excel, put in the values from 0.00(0%) to 1.00(100%) using the increments you want. I used .05 (5%)
Use this formula - sqrt.
[attachmentid=3635]
[attachmentid=3636]
newpageboba
Nov 29 2006, 03:07 PM
Using your indirect squareroot formula,
XD_SCALE.EU0 = 4ma, XD_SCALE.EU100 = 20ma (or use what you scaled your analog input)
this make FIELD_VAL = 0 - 1 (or 0-100%)
OUT_SCALE.EU0 = 0 & OUT_SCALE.EU100 = 100 (or use the actual flow range)
the divisor of 100 in the square root does not make sense.(I think it is actually 100%, which is 1)
The FIELD_VAL formula gives a value of 0 to 1 (not 0 to 100).
If the divisor is actually 100, then the XD_SCALE.EU0 & EU100 values should be 100 times greater.
waterboy
Nov 29 2006, 03:11 PM
QUOTE(newpageboba @ Nov 29 2006, 11:42 AM) [snapback]44737[/snapback]
Using Excel, put in the values from 0.00(0%) to 1.00(100%) using the increments you want. I used .05 (5%)
Use this formula - sqrt.
[attachmentid=3635]
[attachmentid=3636]
Well now..... That certainly wasn't what I was building it up to be! Thank you for that.
What exactly makes it "Indirect". Square root is simple enough but throw the word "Indirect" at it and I just crawled into a corner and grabbed my teddy.
newpageboba
Nov 29 2006, 03:22 PM
I think what they meant by indirect is 'not direct'
JRoss
Nov 29 2006, 03:27 PM
QUOTE(newpageboba @ Nov 29 2006, 03:07 PM) [snapback]44738[/snapback]
the divisor of 100 in the square root does not make sense.(I think it is actually 100%, which is 1)
The FIELD_VAL formula gives a value of 0 to 1 (not 0 to 100).
If the divisor is actually 100, then the XD_SCALE.EU0 & EU100 values should be 100 times greater.
FIELD_VAL is a number from 0-100 (in percent, of course). The divisor of 100 simply converts it from percent to a numeric ratio.
waterboy
Nov 29 2006, 03:29 PM
QUOTE(newpageboba @ Nov 29 2006, 12:22 PM) [snapback]44740[/snapback]
I think what they meant by indirect is 'not direct'
Very funny

.
I see in some more reading that direct and indirect refer to the signal path and not to a particular math function. Would you agree?
newpageboba
Nov 29 2006, 03:43 PM
QUOTE(waterboy @ Nov 29 2006, 03:29 PM) [snapback]44742[/snapback]
QUOTE(newpageboba @ Nov 29 2006, 12:22 PM) [snapback]44740[/snapback]
I think what they meant by indirect is 'not direct'
Very funny

.
I see in some more reading that direct and indirect refer to the signal path and not to a particular math function. Would you agree?
That is what I meant. Direct is input directly to ouput and indirect is via some math, like square root and/or scaling.
QUOTE(JRoss @ Nov 29 2006, 03:27 PM) [snapback]44741[/snapback]
QUOTE(newpageboba @ Nov 29 2006, 03:07 PM) [snapback]44738[/snapback]
the divisor of 100 in the square root does not make sense.(I think it is actually 100%, which is 1)
The FIELD_VAL formula gives a value of 0 to 1 (not 0 to 100).
If the divisor is actually 100, then the XD_SCALE.EU0 & EU100 values should be 100 times greater.
FIELD_VAL is a number from 0-100 (in percent, of course). The divisor of 100 simply converts it from percent to a numeric ratio.
I am a stickler for engineering units in math formulas. I see many people get burnt in their calculation by not using engineering units.
0%-100% equals 0-1
0-100 does not equal 0-1 it equals 0-100
waterboy
Nov 29 2006, 03:43 PM
QUOTE(newpageboba @ Nov 29 2006, 12:39 PM) [snapback]44744[/snapback]
QUOTE(waterboy @ Nov 29 2006, 03:29 PM) [snapback]44742[/snapback]
QUOTE(newpageboba @ Nov 29 2006, 12:22 PM) [snapback]44740[/snapback]
I think what they meant by indirect is 'not direct'
Very funny

.
I see in some more reading that direct and indirect refer to the signal path and not to a particular math function. Would you agree?
That is what I meant. Direct is input directly to ouput and indirect is via some math, like square root and/or scaling.
That makes sense, It's starting to clear up now. Thank you very much for your help, all of you.
JRoss
Nov 30 2006, 08:29 AM
QUOTE(newpageboba @ Nov 29 2006, 03:43 PM) [snapback]44744[/snapback]
I am a stickler for engineering units in math formulas. I see many people get burnt in their calculation by not using engineering units.
0%-100% equals 0-1
0-100 does not equal 0-1 it equals 0-100
Good point! I remember the days. Physics, Statics, Dynamics, etc., etc., ad nauseum.
So that portion of the formula should read:
FIELD_VAL100%
newpageboba
Nov 30 2006, 08:52 AM
QUOTE(JRoss @ Nov 30 2006, 08:29 AM) [snapback]44810[/snapback]
QUOTE(newpageboba @ Nov 29 2006, 03:43 PM) [snapback]44744[/snapback]
I am a stickler for engineering units in math formulas. I see many people get burnt in their calculation by not using engineering units.
0%-100% equals 0-1
0-100 does not equal 0-1 it equals 0-100
Good point! I remember the days. Physics, Statics, Dynamics, etc., etc., ad nauseum.
So that portion of the formula should read:
FIELD_VAL100%
Yes, then the formulas make sense.
waterboy
Nov 30 2006, 06:44 PM
QUOTE(newpageboba @ Nov 30 2006, 05:52 AM) [snapback]44814[/snapback]
QUOTE(JRoss @ Nov 30 2006, 08:29 AM) [snapback]44810[/snapback]
QUOTE(newpageboba @ Nov 29 2006, 03:43 PM) [snapback]44744[/snapback]
I am a stickler for engineering units in math formulas. I see many people get burnt in their calculation by not using engineering units.
0%-100% equals 0-1
0-100 does not equal 0-1 it equals 0-100
Good point! I remember the days. Physics, Statics, Dynamics, etc., etc., ad nauseum.
So that portion of the formula should read:
FIELD_VAL100%
Yes, then the formulas make sense.
Just when I get the math, now the application gets me....How do you use this non-linear value in a PLC5 and convert it accurately?
The existing value that is received from this transmitter is currently treated in the PLC like it was a linear value. i.e. 12mA input to the module is treated as 50% of the scale of the instrument.
If I understand right, the real value for 12mA input to an analog module should be about 25% of the full scale of the instrument.
If this is right, how do I handle this non-linear value from the instrument?
panic mode
Nov 30 2006, 11:28 PM
read first reply
waterboy
Nov 30 2006, 11:39 PM
QUOTE(panic mode @ Nov 30 2006, 08:28 PM) [snapback]44916[/snapback]
read first reply
But there is no "curve fitting" in a PLC's language.
rpraveenkum
Dec 1 2006, 12:20 AM
QUOTE(waterboy @ Dec 1 2006, 09:39 AM) [snapback]44919[/snapback]
QUOTE(panic mode @ Nov 30 2006, 08:28 PM) [snapback]44916[/snapback]
read first reply
But there is no "curve fitting" in a PLC's language.
using the Function Generator (FGEN) inst in RSL5k you do linearisation
The FGEN instruction converts an input based on a piece-wise linear function.
panic mode
Dec 1 2006, 09:52 AM
:sigh: TGIF
one more time - read first reply...
the idea is to use your own math skills or help of a tool (excel, curvefit, mathlab or whatever) to find the formula which is close fit or good approximation and works for the application. not all solutions are accurate enough
and then, (once you know what the formula and parameters/coefficients are), you can use math instruction to implement it in language your controller supports (controller happens to be a PLC in this case). this may require series of rungs and ADD, MUL, DIV, CPT or whatever blocks your controller supports and furmula needs.
waterboy
Dec 1 2006, 10:10 AM
QUOTE(panic mode @ Dec 1 2006, 06:52 AM) [snapback]44996[/snapback]
:sigh: TGIF
one more time - read first reply...
the idea is to use your own math skills or help of a tool (excel, curvefit, mathlab or whatever) to find the formula which is close fit or good approximation and works for the application. not all solutions are accurate enough
and then, (once you know what the formula and parameters/coefficients are), you can use math instruction to implement it in language your controller supports (controller happens to be a PLC in this case). this may require series of rungs and ADD, MUL, DIV, CPT or whatever blocks your controller supports and furmula needs.
Ok I see what you mean now.
newpageboba
Dec 1 2006, 10:16 AM
There is no need for a curve fit. We already discussed the formula.
Use a SQR instruction. use floating point because the values will be from 0 to 1.
SQR F8:0 F8:1 (substitute in your own floating point addresses)
Don't forget to scale the input to be a Float point that ranges 0-1 (0-100%)
DIV input inrange (substitute in your own addresses)
and when you get the Square root result F8:1, scale(multiply) it by the flow range.
MUL F8:1 outrange (substitute in your own addresses)
**one other option is to set up the transmitter to squareroot it's output. Then you would not need any math in the PLC except to scale it.
waterboy
Dec 1 2006, 10:37 AM
QUOTE(newpageboba @ Dec 1 2006, 07:16 AM) [snapback]45001[/snapback]
There is no need for a curve fit. We already discussed the formula.
Use a SQR instruction. use floating point because the values will be from 0 to 1.
SQR F8:0 F8:1 (substitute in your own floating point addresses)
Don't forget to scale the input to be a Float point that ranges 0-1 (0-100%)
DIV input inrange (substitute in your own addresses)
and when you get the Square root result F8:1, scale(multiply) it by the flow range.
MUL F8:1 outrange (substitute in your own addresses)
**one other option is to set up the transmitter to squareroot it's output. Then you would not need any math in the PLC except to scale it.
That is what my boss told me too, set the transmitter to squareroot its output. And he also just showed me an old signal isolator which apparently does a similar function "back in the day".
I'm just not getting my mind around it, All I have ever had to do prior to this discovery is to take the 0-4096 counts from the analog module,multiply by a scaling factor and then display it. Works fine for a level transmitter. But this has taken an interesting turn.
I'll do some experiments with your instructions and the tranmitter and start another thread if I have more intelligent questions.
I am getting the "You should have this figured out by now" vibe.
It's probably justified.
Thanks again
panic mode
Dec 1 2006, 11:04 AM
fitting curves takes into account scaling as well (or can be used for scaling alone
for that matter). nice thing about it is that you get alternatives. most PLCs do have
more than basic math instructions but this is not always the case and PLC is not
the only controler ever used either.
i don't want to do your work, i'm just trying to point you in the right direction (universal solution).
i was tryng to show you this so you can get through any situation, not just your current project
which is extremly simple, formulas are known etc.
sometimes one function is represented or approximated by different function (this can be
very handy if your controller does not have some particular instruction built in). not all devices will
have output that follow simple mathematical function (linar or square root).
consider this. so far you struggled with basics (just a linear conversion and root function).
i'm not sure you will be able to find coefficients for inverse function to do your application.
curveexpert does it for you (yes it has square and square root functions as well, it has bunch
of others and it can make recommendations which fit to use) so you will not have to
come up with difficult answers if your boss or customer start asking quastions.
it's just a tool, not more not less. you can laugh at if you can do better job by hand or praise it
if it saves you time and headacke... good luck
waterboy
Dec 1 2006, 11:30 AM
QUOTE(panic mode @ Dec 1 2006, 08:04 AM) [snapback]45009[/snapback]
fitting curves takes into account scaling as well (or can be used for scaling alone
for that matter). nice thing about it is that you get alternatives. most PLCs do have
more than basic math instructions but this is not always the case and PLC is not
the only controler ever used either.
i don't want to do your work, i'm just trying to point you in the right direction (universal solution).
i was tryng to show you this so you can get through any situation, not just your current project
which is extremly simple, formulas are known etc.
sometimes one function is represented or approximated by different function (this can be
very handy if your controller does not have some particular instruction built in). not all devices will
have output that follow simple mathematical function (linar or square root).
consider this. so far you struggled with basics (just a linear conversion and root function).
i'm not sure you will be able to find coefficients for inverse function to do your application.
curveexpert does it for you (yes it has square and square root functions as well, it has bunch
of others and it can make recommendations which fit to use) so you will not have to
come up with difficult answers if your boss or customer start asking quastions.
it's just a tool, not more not less. you can laugh at if you can do better job by hand or praise it
if it saves you time and headacke... good luck
I get what you are saying ; Teach me to fish and feed myself.
I appreciate all the help and I will be looking at it till I get it.
newpageboba
Dec 1 2006, 01:24 PM
The easiest solution is to configure the transmitter for square root output and then all you have to do is scale the analog input. The value will be linear to flow (not pressure)
waterboy
Dec 1 2006, 02:05 PM
QUOTE(newpageboba @ Dec 1 2006, 10:24 AM) [snapback]45022[/snapback]
The easiest solution is to configure the transmitter for square root output and then all you have to do is scale the analog input. The value will be linear to flow (not pressure)
That would indeed solve it, and is what will happen, but I still will have to feed the neurons on this subject. Can't have the machine do all the work!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.