logo Welcome, Guest. Please Login or Register.
August 17, 2017, 05:19:03 PM
Home Help Search Login Register
 News: You can search the forum for answers to your question in a previous discussion. Please click on the "Search" button above and enter the keyword to search. To get to the full discussion of a listed message, please click on the TITLE of the message listed in the search listing.

  Internet PLC Forum
  General
  Frequently Asked Questions
(Moderator: support)
  How to scale an analog input data
? previous next ?
Pages: [1] Go Down Reply Notify of replies Send the topic Print
   Author  Topic: How to scale an analog input data  (Read 51766 times)
support
Global Moderator
*****

Posts: 3028





View Profile WWW E-Mail
How to scale an analog input data
« on: February 15, 2004, 10:03:23 PM »
Reply with quote

The built-in analog ports on all the M-series PLC return data in the range of 0 to 4092 which corresponds to the full range of voltage input presented at the analog pin. However, very often a user needs a formula to translate this numeric data into units meaningful to the process (e.g. degree C or F, psi etc).  To do so, you need to know at least two reference points of how the native unit map to the PLC's ADC reading.

Reference Point              ADC Reading     
===========            ==========
      x1                                  a1
      x2                                  a2

Hence, for any reading A = ADC(1), the corresponding X is derived from:
 
  X - x1          A - a1
---------  =  -----------
x2 - x1          a2 - a1

==>  X = (x2 - x1)*(A - a1)/(a2 - a1) + x1

Note that since x1,x2,a1, and a2 are all constants the actual formula is much simpler then it appears above.

E.g. Temperature measurement
========================

    Temp            ADC(n)
        30              200
      100              3000

So for any ADC readings A, the temperature is:

  X = 70*(A - 200)/2800 + 30

Note: To get better resolution , you can represent 30 degree as 300 and 100 degree as 1000 so if X = 123 it means 12.3 degree.

[Edit 2014/7]: If you are using Fx PLC or the SmartTILE-Fx then you can use floating point operation directly without having to use integer to emulate the decimal point. So the formula could be:

X# = 70.0*(A-200.0)/2800.0 + 30.0

« Last Edit: March 16, 2016, 12:09:08 PM by support » Report to moderator   Logged

Email: support@triplc.com
Tel: 1-877-TRI-PLCS
Fernandz
Newbie
*

Posts: 10





View Profile
Re:How to scale an analog input data
« Reply #1 on: March 12, 2004, 11:56:15 PM »
Reply with quote

I just posted in "Technical" about a sensor that has a 32 to 200 Deg. F range. This is what I know about scaling I hope it helps.
We know that our ADC is 0-5volts and will send a count of 0 to 4092
So a 5 volt signal will be counted as 4092, and 0 volts will be a count of 0. Lets say our sensor outputs a signal thats proportional to temp. say .010v per'F and at 32 DegF we have an output of .32 volts.......... (.32 / .010v)=32'F and 200'F is an output, from the sensor, as 2 volts.......(2/.010v)=200'F

    |---|---|---|---|---|---|---|---|---|---|---|---|---|
    0      .32v              2v                              5v  ' ADC volts
              |                  |
    0      261              1637                            4092 ' Converter count
            [-- Our Sensor--]

In order to get the Converter count of 261 and 1637 I use the formula
    count=4092/5*ADC(voltage)

So count=4092/5*.32
    count=818*.32
    count=261

Once you have your converter counts then use the above formulas to read temps. EG.  temp=168*(ADC(n)-261)/1376+32

This is how I do it, keep in mind I'm no engineer and self taught.


Report to moderator   Logged
DAlgie
Newbie
*

Posts: 16



Using PLC for aircraft controller

View Profile
Re:How to scale an analog input data
« Reply #2 on: July 26, 2004, 12:23:30 AM »
Reply with quote

I have a nice Excel program for doing just this, scaling an analog input. I'll send it to anyone who wants it.
« Last Edit: January 17, 2005, 01:10:46 PM by support » Report to moderator   Logged
Ruaidhri
Newbie
*

Posts: 2



I'm a llama!

View Profile
Re:How to scale an analog input data
« Reply #3 on: June 20, 2014, 11:42:14 AM »
Reply with quote

@DAlgie
could you send me a copy of this im starting to struggle with these adc's
thanks in advance
Ruaidhri
Report to moderator   Logged
Pages: [1] Go Up Reply Notify of replies Send the topic Print 
? previous next ?
Jump to: 


Login with username, password and session length

Powered by MySQL Powered by PHP Internet PLC Forum | Powered by YaBB SE
© 2001-2004, YaBB SE Dev Team. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!