Analog input scaling ?

jcraft

Member
Join Date
Dec 2006
Location
Niagara falls
Posts
91
Looking for some direction here as to how to scale an AI input. We have an analog level sensor that is 4-20 ma out to a plc 12 bit analog current input card. The level sensor is mounted 15.8" above the bottom of the tank so 0" = 4ma and 15.8" = 20ma. I have the signal coming into the plc which is presently showing approx. 32,000 ( level about 4" away from sensor. Now I need to scale to see how many inches this count is and also how many inches each count is ( Ex. if the count in AI drops from 32,000 to 31,999 then how far did the level drop in inches). Please help. Thanks
 
begfore we can anwer that you need to supply the make and model of the PLC but essentially the process is look at the manual for the analog input card or processor under the heading of 4-20 ma it will provide a range of values then you need to devide the direct ratio those values to determine what value = 1 ma. Without the range for yuor processor I'm not generating any numbers for you just expalining the process
 
Are you sure you don't mean 16-bit? Most cards I've seen are 16-bit, plus, it would be impossible to show 32,000 only using 12-bits. If all 12 bits were in the on state (meaning they are ones) then the decimal equivalent would be 4,095.
 
I was looking for the manuals as we speak. It is a GE 90-30 CPU363 with an IC693ALG221 4-channel card. Once I find the manual I'll advise more if needed
 
Well you have 15.8" over your number range of 0 - 32000 so when the number reads 0 you have 0" and when the number reads 32000 you have 15.8".

Halfway in between (16000) you have 7.9"

I don't know if GE has a function like the AB SLC and Micrologix called SCP but if they do, you're in like Flynn.
 
It is important to understand how to calculate scaling on your own rather then just relying on a PLC instruction to do it for you.

That being said, scaling is as simple as y = mx + b. Yes that simple algebra equation you've done over and over.

Simply draw your coordinate plan:


y
|
|
|
|
|
|
|
|
--------------------------------- X



X axis is the independent variable, which would be the PLC RAW units. 0 - 32000 (HOMEWORK QUESTION: Is this the case for output scaling?)

Y axis is the dependent variable, which would be the scaled engineering unit, in this case 0 - 15.8 in.

The scaling is linear, so plot the two end points and draw a line. Calculate the equation of the line.

m = rise/run = (15.8 - 0)/(32000-0) (HOMEWORK QUESTION: When do you need to pay attention to positive/negative slope?)
b = 0 in this case. Otherwise calculate it out b = y - mx

Because b = 0 the scaling math is quite easy:
y = mx

Simply multiply the raw (x) value by m and the result is the scaled (y) value.
 
Last edited:
For the manuals, go here:
http://support.gefanuc.com/support/index?page=home&view=AUTOMATION
Type the part number IC693ALG221 into the search field. That will bring up two pages of documents with that part number. You want GFK-0898F which will be found on the second page.
The level sensor is mounted 15.8" above the bottom of the tank so 0" = 4ma and 15.8" = 20ma. I have the signal coming into the plc which is presently showing approx. 32,000 ( level about 4" away from sensor.
I think your span is somewhat less than 15.8 inches. The maximum value you can expect to see in the %AI register in the PLC is around 32000. You may find that the raw value doesn't start to go down until the level drops even lower. At any rate, don't expect the raw value to go any higher as the level increases. Also, you might find that you don't see a signal level of 4 mA with an empty tank. It all depends on how the sensor was initially calibrated. Your best bet would be to record the analog value at as low a level as you can to work out the scaling.
if the count in AI drops from 32,000 to 31,999 then how far did the level drop in inches
As Norm pointed out, the value is shifted by 3 bits so your range of 0 to 32000 is handled in 4000 steps of 8 counts. You won't ever see a value of 31999. The values will drop 32000, 31992, 31984, ..... 24, 16, 8, 0. Each increment of 8 counts in the raw data value will correspond to a step size of the span (in inches) divided by 4000.
 
Jcraft.

One of our forum members, Ron Beaufort, posted a super informational thread about scaling. He reduces it to a simple problem and covers it so well that I dont' think we can really add much to it. While Ron's example uses an AB PLC, he also covers the math behind it so well that it can be translated to any other PLC.

That thread can be found here:
http://www.plctalk.net/qanda/showthread.php?p=101766&postcount=1
 

Similar Topics

Dear all Iam using three load cells connected in parallel to calibrate the weight of a product but in don't have a weighting module in my...
Replies
4
Views
3,457
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
8
Views
3,605
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
2
Views
1,827
Hello! I am new at PLC programming. I am using TM221CE16R PLC with TM3AI8 analog input module and SoMachine Basic v1.6. I am trying to scale...
Replies
8
Views
7,041
Hello, I have a Micrologix 1400 PLC and using RSLogix 500. Using a Multi Ranger Ultra Sonic Level Sensor and the input is moved to N7:11, then...
Replies
15
Views
3,857
Back
Top Bottom