Author Topic: Stable analogue input reading  (Read 15293 times)

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Stable analogue input reading
« on: January 22, 2014, 12:57:16 AM »
Hi. Is it possible to have a stable analogue input reading from ADC? Seems like the readings are always fluctuating.


Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Stable analogue input reading
« Reply #1 on: January 22, 2014, 11:35:47 AM »
Which PLC are you using. What is the range of fluctuation?

For FMD, Nano-10 and F-series the ADC resolution is 12 bit which means the value fluctuates for voltage variation as low as 5/4096 = 0.00122V.

Electrical noise imposed by the environment via electromagnetic coupling or even component white noise, switching power supply noise etc can cause the fluctuation in readings. A well setup system may still observe some fluctuation around +/- 3LSB which is quite normal. You can turn on the moving average settings in the ADC configuration which will smoothen the readings somewhat. Another way is to take a lot of readings and get the average which will even out the fluctuation and give you the average readings.

E.g.

A = 0
For I = 1 to 100
    A  = A + ADC(1)
NEXT

A = A/100

A is the average reading of 100 samples.
 
« Last Edit: January 22, 2014, 11:36:41 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Stable analogue input reading
« Reply #2 on: January 22, 2014, 07:40:23 PM »
Hi. Your method works like a charm. Thanks. Encountered another problem. What should be done in order to get a value similar to the device if the ADC readings is not linear to my device?

Device             ADC        
0.412VDC           328      
0.948VDC           770      
1.898VDC    1544   
2.926VDC    2388   

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Stable analogue input reading
« Reply #3 on: January 23, 2014, 09:44:52 PM »
Use a look up table. You can follow the example we provide for the lookup table for thermistor:

http://www.triplc.com/appnotes_hvac.htm
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Stable analogue input reading
« Reply #4 on: January 26, 2014, 08:03:27 PM »
Hi. Thanks for the suggestion. I'm wondering since my output voltage is 0.412VDC to FMD88, why is the ADC reading 328 instead of 337. 0.948VDC should return 776 instead of 770. Any idea?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Stable analogue input reading
« Reply #5 on: January 26, 2014, 11:19:51 PM »
You should check your reference voltage. ADC returns a proportional reading to the reference voltage and not absolute voltage. There reference voltage on your PLC is the AVcc output.

You can use the i-TRiLOGI Ethernet & ADC Configuration function to calibrate the ADC reading for each analog channel so that you get the desired output. Please refer to the PLC's User Manual for the calibration procedure.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Stable analogue input reading
« Reply #6 on: January 27, 2014, 07:11:23 PM »
Hi. My device currently needs a power source of 24VDC. It will output an analogue voltage of 0-5VDC. Since I cannot get the reference voltage of 5VDC from FMD88 to the device, does it mean that FMD88 is not suitable to be used with the device? A look-up table is needed if I want to use the device and FMD88 together?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Stable analogue input reading
« Reply #7 on: January 27, 2014, 10:29:36 PM »
FMD has its own reference voltage used by its ADC. You still can use it with your analog system but you have to tie the 0V of your analog device to the 0V of the PLC's power supply in order to get a common ground reference.

Since the analog reference voltage is not identical between the PLC and your device you can then use the ADC calibration tool to calibrate the analog readings with respect to the measured voltage.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Stable analogue input reading
« Reply #8 on: February 25, 2014, 05:12:41 PM »
Hi. Got it sorted out. Seems like there's some problem with my formula. Great job with the support. Thx