Equation-linear table?

dginbuffalo

Member
Join Date
Dec 2010
Location
Buffalo,NY
Posts
630
I'm having a little trouble coming up with an equation to calculate in a PLC. i need to take current and pressure at 2 points. then i need to calculate what the current will be at different pressure points. The pressure and current should track linear between each other. i need to come up with the multiplier to find this current even if it's above or below my 2 reference points. How do i do this? i know there's a way that i have done it in the past, but i'm old now and stupid...o_O
 
Depending on your licenses, you could use a FGEN function if its in the 5000 platform.
Check the A-B help file for the instruction.
 
Sounds like you are coming up with a calibration curve.

In the old days we took the measurements wrote them down and then graphed the data. Drew a best fit line and used that. Then we measured rise to run and the offset from zero and derived the formula
Y = mX + B

Now in the age of computers you can have Excel do it all for you. Put in the data draw teh graph and ask for the linear regression curve.

All but one or two points will have an error. IF this error meets your needs all well and good. If not you need a better sensor.

Dan Bentler
 
I like to use two point linear equations in most industrial situations, then it is easy to build a learn/calibration screen.

In the odd case where you have one point and the slope, you can edit the calculation logic. I like to be able to "see" all four values easily on the screen too, so I will use simple math instructions grouped in series and parallel for ease of viewing, as opposed to one big simplified CPT.

If I add HMI or other form of remote teaching/editing of the scaling values, I also add extra checking to ensure a minimum resolution (counts between raw min and max) and direction (raw_max - raw_min > 0) exists on the input signal.

You want to make sure Bubba doesn't successfully re-calibrate a bad sensor or one that can't meet the needs of the controls system because Cletus forgot to tell Bubba that earlier, he turned the all the pots on the device at other end of the wire before he noticed it was unplugged....

So, to avoid doing the hand calcs, you can build your scaling math using tags for all sources, then teach two points using RSLogix to "poke" the raw and engineering values in manually.

Paul
 

Similar Topics

HI when using this piece of code "1".Expenential_resault := ("1".Expenential_cof )**(("1".linear_Rows) -1); i get an error (Pic 1) how to fix...
Replies
4
Views
1,450
Hi folks, I am upgrading a SLC to a ControlLogix platform. The goal of the project isn't simply to get the same program to run on different...
Replies
7
Views
2,809
Hey All! Using the HSC:0 for an unwind. Not high speed or anything. 50 PPR at fastest 800 FPM.using this math pulse count per second / 50 the...
Replies
9
Views
2,514
Any one know iso 1438 open channel Rectangular notch discharge equation
Replies
1
Views
1,575
Hi all, Have a job where we're using peristaltic pumps to dose CL2 for wastewater, pretty standard 4-20mA flow pacing signal being used, no PID...
Replies
3
Views
1,696
Back
Top Bottom