Author Topic: ADC input fluctuation issue  (Read 703 times)

0 Members and 1 Guest are viewing this topic.

Offline Veketti

  • Contributor
  • Posts: 20
  • Country: fi
ADC input fluctuation issue
« on: June 22, 2021, 05:56:14 am »
Dear All,

I'm banging my head on wall with issue of ADC fluctuating, I really don't understand why so, so I hope someone could help me. I'm trying to read 4-20mA sensor. As an ADC chip I’m using AD7992 and for that reference voltage REF195. This works well in breadboard when voltage passed by potentiometer.

For the ADC input I added BAT54S for over/undervoltage protection and low pass filter to filter out any fast oscillations. I wonder does this circuitry cause the fluctuation issue?
[attachimg=1]

Thank you in advance.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 3091
  • Country: ro
Re: ADC input fluctuation issue
« Reply #1 on: June 22, 2021, 06:10:39 am »
I don't think the diodes would create fluctuations, thought 20mA on 250 ohms is 5V, any voltage or current errors might open a diode.  Too few details to say what might be happening.

- What do you mean by "fluctuations"? 
- Is there a plot with those fluctuations in time, so to see their nature and amplitude? 
- Does the fluctuations appears on an oscilloscope, too, or are they seen only by the ADC?
- Is the ADC in an industrial environment, or in a lab?
- Is it properly shielded and isolated against interference?
- Are the 24V and 5V well stabilized?
- Is it all wired properly?
« Last Edit: June 22, 2021, 06:12:46 am by RoGeorge »
 

Offline Veketti

  • Contributor
  • Posts: 20
  • Country: fi
Re: ADC input fluctuation issue
« Reply #2 on: June 22, 2021, 08:06:29 am »
Good to hear that at least there is nothing inherently wrong with this part of circuitry. I’ve scoped the 4-20mA sensor separately with lab power and 250ohm resistor and it had noise ~9mV peak to peak. I’m supplying the 24V in this PCB with RO-0524S converter. I’ve scoped that also and it was ok. Next I’ll scope the AD7992 ADC input, whether it is stable or not.

From my calculations the fluctuations are around 19mV. What I mean by the fluctuations is that the voltage readings are not stable wandering up and down. I’m testing this in my “lab”, so no industrial environment. Isolation and shielding is bit gray area for me. At least the cable for the sensor is not shielded or twisted pair. Just standard M12 connector readymade commercial sensor cable. I’ve understood that these 4-20mA current sensors are relatively interference free due to the nature of current. And on the pcb I’ve tried to route the adc signal short and far from oscillating components, like crystal.

I’d like to hear some thoughts about the shielding and isolating, what should I take into account?

Anyhow, I’ll try to measure those things you mentioned and get back. Btw. what kind of performance should I expect from the voltage stability? I’ve no idea whether my expectations are too high..

For the software side, I’ve done averaging for 80 samples and then disregard + and – 5 readings from that ADC averaged value and latest now added filter which takes three of these averaged samples and compare that if all of these samples are gradually to same direction, only then take the value into account. Otherwise disregard readings which are up and down. Like said, readings are super stable on breadboard when ADC supplied through potentiometer. But on PCB and real sensor all over the place.. Wirings are properly seated.

Thank you and sorry for my ignorance..
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 15852
  • Country: gb
  • 0999
Re: ADC input fluctuation issue
« Reply #3 on: June 22, 2021, 10:29:58 am »
The only concern I have with the circuit is if the sensor does fail short circuit, a large current will flow via D2, into the 5V rail. If you're lucky, D2 will simply fail open circuit, but what's more likely to happen is the 5V rail's voltage will increase, destroying the ADC and microcontroller.

Put the protection diodes after R1, which will limit the current into the 5V rail, if anything bad happens, ancrease the value of R1 to something like 100k, in order to restrict the fault current to a sane level and reduce C1 to 100pF, to compensate. Connecting a 5.6V zener across the 5V rail might also be a good idea.
 

Offline Veketti

  • Contributor
  • Posts: 20
  • Country: fi
Re: ADC input fluctuation issue
« Reply #4 on: June 22, 2021, 07:09:14 pm »
I was wrong with the fluctuation amplitude. It's 137mV and frequency between 4.2-5.1kHz. This was measured from the R1 ADC pin side. So confusing, what might cause this? Attached is the picture of the scope shot.

[attachimg=1]
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 3091
  • Country: ro
Re: ADC input fluctuation issue
« Reply #5 on: June 22, 2021, 07:26:31 pm »
Might be the sensor itself acting like that.

Remove everything, except the sensor and the 250 ohm to ground, and see if the oscillations are still there.  If the sensor output is clean, then start adding the rest of the components one by one and see when the oscillation appears.

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1823
  • Country: ua
Re: ADC input fluctuation issue
« Reply #6 on: June 23, 2021, 12:45:34 am »
I was wrong with the fluctuation amplitude. It's 137mV and frequency between 4.2-5.1kHz. This was measured from the R1 ADC pin side. So confusing, what might cause this? Attached is the picture of the scope shot.

It may be interference from some electronic equipment received on a long wires which are used for a sensor connection. Or may be sensor itself produce such noise. Try to add low pass filter on ADC input to cutoff high frequency components from a measurement signal.
« Last Edit: June 23, 2021, 12:48:05 am by radiolistener »
 

Offline Veketti

  • Contributor
  • Posts: 20
  • Country: fi
Re: ADC input fluctuation issue
« Reply #7 on: June 23, 2021, 06:52:09 am »
I've narrowed down that the culprint is the Recom RO-0524S converter. Its output is not stable. It seems I did forgot to add the 10uf capacitor to input side like the datasheet shows but it made no difference when I added one. Should there be capacitor in output side as well? Here's the link to the datasheet:
https://recom-power.com/pdf/Econoline/RO.pdf

 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 2761
  • Country: gb
Re: ADC input fluctuation issue
« Reply #8 on: June 23, 2021, 08:07:06 am »
Those DC-DC converter modules can be horribly noisy, and they are not usually regulated either so the output voltage can change significantly over the specified load range.  Your 5kHz ripple seems very low though, these modules tend to have a switching frequency of around 100kHz.  Some decoupling on the output should help.  If this supplies only the 20mA sensor the unregulated voltage is likely high enough to add more comprehensive filtering.

Also check that the interference isn't being caused by poor ground layout on the input side of the converter.
 

Offline Veketti

  • Contributor
  • Posts: 20
  • Country: fi
Re: ADC input fluctuation issue
« Reply #9 on: June 23, 2021, 08:30:02 am »
Added 10uf MLCC to the output side and that got almost completely rid of the noise. I wonder why the datasheet doesn't mention anything about cap filtering on output side... Now I can maybe remove from software side the unnecessary filtering to make the readings more accurate.

Thank you all, love you Guys/Girls and love this forum. So happy.  :)
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1823
  • Country: ua
Re: ADC input fluctuation issue
« Reply #10 on: June 23, 2021, 09:39:01 am »
Now I can maybe remove from software side the unnecessary filtering to make the readings more accurate.

proper filtering on digital domain will be more accurate, it doesn't break accuracy. But it will take more time period for measurement.
 

Offline Terry Bites

  • Frequent Contributor
  • **
  • Posts: 426
  • Country: gb
  • Recovering Electrical Engineer
Re: ADC input fluctuation issue
« Reply #11 on: June 23, 2021, 04:12:34 pm »
Ever heard of a crystal set? Check for RFI. An indcutor in series with R1 may help or just increase R1. A little bypass cap across R2 wont hurt either.
see discussion https://e2e.ti.com/support/amplifiers-group/amplifiers/f/amplifiers-forum/963849/xtr115-4-20ma-current-loop-transient-spikes-resonant-oscillations-with-capacitor-across-input-output-per-datasheet-ref-design
« Last Edit: June 23, 2021, 04:14:54 pm by Terry Bites »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 9233
  • Country: de
Re: ADC input fluctuation issue
« Reply #12 on: June 24, 2021, 09:46:50 am »
The relative low frequency of the interference may be aliasing with the ripple caused by the DCDC converter. So the actual frequency can be higher by the sampling rate (or a multiple of it) used for the data.

Depending in the use it can still make sense to keep some digital filtering. Using more conversions and averaging reduces noise and may give additional resolution. There may also be mains hum in a more real use, that is not visible in the current test.
 

Offline Veketti

  • Contributor
  • Posts: 20
  • Country: fi
Re: ADC input fluctuation issue
« Reply #13 on: June 26, 2021, 09:18:31 am »
Taking into account Zero999 and Terry Bites comments to improve this circuitry, please see did I understood correctly what you meant? Except I didn't implement the inductor. Thank you.
[attachimg=1]
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 15852
  • Country: gb
  • 0999
Re: ADC input fluctuation issue
« Reply #14 on: June 26, 2021, 01:47:11 pm »
Taking into account Zero999 and Terry Bites comments to improve this circuitry, please see did I understood correctly what you meant? Except I didn't implement the inductor. Thank you.
[attachimg=1]
It's fine, apart from being drawn upside-down and back to front. I'd make one tiny modification and move the zener diode to the signal side. Oh and please use PNG, rather than JPG for schematics. JPG is designed for photographs. When used for line drawings, it introduces artefacts such as speckles and fuzziness, making editing more difficult. I had to mess around with image editing software to get rid of them.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 4134
  • Country: fi
Re: ADC input fluctuation issue
« Reply #15 on: June 26, 2021, 01:55:35 pm »
It's still lacking a low impedance source for the ADC. 100pF after 100k isn't enough.

If measured rarely (say, at some tens, maybe hundreds of Hz of sample rate), a 100nF or larger capacitor between the ADC input and ground does it.

If higher sample rate is required, an opamp follower does the trick.
« Last Edit: June 26, 2021, 02:12:58 pm by Siwastaja »
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 9233
  • Country: de
Re: ADC input fluctuation issue
« Reply #16 on: June 26, 2021, 03:46:29 pm »
The signal source is low enough in impedance. So the filter stage can be lower impedance too - like 10 nF and 1 K unstead of 100 pF and 100 K.
With already some low pass filtering in hardware it would also make sense to use some averaging in software - often a finite response FIR filter is more desireable than an anlog filter with exponential settling. In addition averaging can add mains hum suppresion.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 4134
  • Country: fi
Re: ADC input fluctuation issue
« Reply #17 on: June 26, 2021, 03:54:35 pm »
10nF and 1k might be still marginal but of course that depends on how you set the accuracy requirements and the sampling specifics (sampling time and Csampl) of the ADC. On some ADCs it's possible to increase sampling time so that 1kOhm input impedance can be accepted as-is; if this is the case then there is no minimum C requirement from ADC, so just select on based on analog filtering requirements.

But yes if 100kOhm + 100nF has a bandwidth problem then lower R (keeping C = 100nF) to increase BW but at some point (kHz range) you just need an opamp to drive the ADC.

If aliasing of noise is a real concern, remember RC filtration, while cheap and simple, is a crappy 1st order filter so you basically need to oversample then digitally filter + decimate to final sample rate.
« Last Edit: June 26, 2021, 03:56:47 pm by Siwastaja »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf