INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

ADC lag at specific values

ADC lag at specific values

(OP)
Hello,

I have an odd issue and am welcome to any ideas. My ADC seems to lag at specific values and I would like to know why, or better yet, how to fix it. Lags are shown in attached pic.

Occurrence:
Unit 1 lags at ADC value 1638.
Unit 2 lags this at ADC value 1365.

Hardware:
Analog sensor ~10mV full scale
op amp - amplifies sensor output
ADC - ADS1110 reads output of op amp
MCU - reads ADC value
PC - reads and graphs MCU data

http://files.engineering.com/getfile.aspx?folder=7...

RE: ADC lag at specific values

Signal is an oxygen sensor?

Looks like it, and the image file named o2Flats...

RE: ADC lag at specific values

TI's website refers to latency issues, but in the microseconds.

Your flat spots appear to in be the milliseconds.

RE: ADC lag at specific values

(OP)
Good detective work there. It is an oxygen sensor, with analog output based on chemical reaction. I am assuming the sensor is not the cause because I find it hard to imagine a chemical reaction acting like that.

The lag time varies, in the pic there it is ~100ms, ~5 MCU samples and that is pretty typical.

RE: ADC lag at specific values

Have a look here: Maxim The ABCs of ADCs...

Specifically:
Differential Nonlinearity (DNL) No Missing Codes
Figure 1a, the gap or delay in the red line

Perhaps looks like this sort of issue.

Maybe...

RE: ADC lag at specific values

However, you also have an apparent "lag" or similar step behavior at the other end of the sinusoidal form, particularly near 19.04V. You mention an "MCU," so you need to perhaps explain the process by which this data is actually processed/transferred to the point where you got the data into the graphs. I can easily imagine there are little hiccups in the MCU processing that might create the semblance of what you are seeing. The fact that your "lags" are on the order of 5 MCU samples seems worth exploring.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers

RE: ADC lag at specific values

Can you give us a blow by blow of how you get clear to that picture?

Keith Cress
kcress - http://www.flaminsystems.com

RE: ADC lag at specific values

To me this looks a lot like a calculation problem in the software the converts the ADC binary into the value on the graph.
The resolution appears to be about 0.05 units on the graph's Y scale, making the flattened peak at 3772 sec look like normal data, if it weren't for the blips in the rest of the data.
To diagnose the software, we need the ADC resolution (bit rate) the sampling rate, and the formula that generates the output value.
Knowing the types of variables (floating, double, etc.) specified in the program would be important, too.

STF

RE: ADC lag at specific values

(OP)
Thank you all for the help.

VE1BLL, I had a feeling it might be something like that but I think every unit would have lags at the same points if that was the case.

IRstuff, these lags do happen at other values but the values I listed are the majority. Most of the MCU processing happens at peaks and valleys shown in the graph. While the lag is happening, the MCU still saves the data at the expected time intervals. In the data file when there is a lag, there are about 5 points with the same value. '5' is not fixed though, sometimes it's 3, sometimes it's 10.

itsmoked, chemical reaction causes sensor to output analog voltage which is amplified by op amp. Op amp output is read by ADC. ADC is read by MCU with I2C. MCU is read by PC over USB in real time. PC saves data in csv and graphs it. Csv shows multiple points with same values.

RE: ADC lag at specific values

(OP)
Sparweb, I changed the y-axis to show ADC values. Since the ADC values also lag I don't think the problem is in the conversion from ADC to oxygen percentage.

Attached new pic which is zoomed in on 3775s with y-axis = ADC value
Attached csv to show times and ADC values.

http://files.engineering.com/getfile.aspx?folder=9...
http://files.engineering.com/getfile.aspx?folder=f...

RE: ADC lag at specific values

Are you doing the conversion in the micro, or after via post-processing? If inside the micro, what is the equation you're using? If the equation is long and complicated, I can see a timeslip happening during conversion at specific input values. I'm assuming you've already discounted missing codes.

Dan - Owner
http://www.Hi-TecDesigns.com

RE: ADC lag at specific values



What triggers the MCU to actually read a new value from the ADC?

What paces/triggers the ADC to make each conversion?

Is this the only thing the ADC is measuring?

BTW what ADC is it?

Keith Cress
kcress - http://www.flaminsystems.com

RE: ADC lag at specific values

Until you test with a known signal/voltage, I'd not rule out some physical phenomena (e.g. water desorption from the O2 sensor or similar chemical/physical processes).

" I am assuming the sensor is not the cause because I find it hard to imagine a chemical reaction acting like that."

I dunno, I can think of two, and it took me about 30 seconds.

RE: ADC lag at specific values

Note that the data is actually not "lagging;" it's actually leading. If the result is supposed to be a smooth curve, then the MCU output is higher than it's supposed to be, which is likely neither an ADC nor MCU problem. However, repeated output values usually is indicative of a serious latency problem in data processing; the new result isn't available, so the processor outputs the last valid data. So, it's possible that the process controller is having problems.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers

RE: ADC lag at specific values

(OP)
Thanks

RE: ADC lag at specific values

2
What op amp are you using? This could be zero-crossing distortion (but not around zero if your power supply isn't bipolar). It would typically be somewhere around half the supply voltage (but could be anywhere between 25 ~ 75% or so). Each unit would be a bit different, may drift with temperature...

RE: ADC lag at specific values

(OP)
Rewritting last post since most of it disappeared:
Thanks again for the help everyone.

IRstuff, good catch, I missed that.

RE: ADC lag at specific values

(OP)
jimkirk, I am using ADS1110 for ADC.

I think you might be right. It does seem to be the op amp causing this.

Replaced the o2 sensor with a capacitor and charged it slowly to test different parts of the circuit today.
Replaced MCU with Arduino.
Added 2nd ADC to measure same net as ADS1110 (original ADC).

ADC1: ADS1110 being read by Arduino I2C.
ADC2: Arduino ADC
Signal: Voltage across cap. Voltage increases slowly over time.

Test 1:
Signal location: ADC input
Result: no flat spots in either ADC

Test 2:
Signal location: op amp input
Result: same flat spots in both ADCs
Result shown here:
http://files.engineering.com/getfile.aspx?folder=8...

Note: op amp output is connected to ADC input.

Conclusion: I think the op amp is causing the problem. Now to figure out how to solve the problem...


RE: ADC lag at specific values

A simplified schematic might be in order. I'm not sure it's an op amp problem, per se, but not having the schematic makes it difficult. Unless you are running open loop on the op amp, you should not be seeing this. But, you've also ignored a previous request to disclose the op amp. It's more likely that someone has added something that sucks up extra current during zero crossings, which causes the distortion.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers

RE: ADC lag at specific values

(OP)
I listed the ADC by accident when the op amp part# was requested.

This is the op amp:
OPA330
http://www.digikey.ca/product-detail/en/OPA330AIDB...

Another thing to add is that the lag time is related to the rate of change of the signal. If the signal is changing quickly the lag doesn't last long, if it changes slowly, the lag lasts a while. Got the lag over 10 seconds with a signal that was changing very slowly.

RE: ADC lag at specific values

That specific symptom is typical of a zero crossing problem, but there shouldn't be an issue with that particular op amp, assuming that it's being operated per guidelines.

Given the symptoms, it would appear that there's a back-to-back diode structure that's being current starved for some reason.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers

RE: ADC lag at specific values

(OP)
I took some ohms out the resistor between the op amp output and the ADC input and that seems to have sorted it out. Thanks again for the help everyone.

RE: ADC lag at specific values

So... what does this make the problem? Some sort of capacitive shunt inside the A2D? Violation of the A2D input impedance?

Keith Cress
kcress - http://www.flaminsystems.com

RE: ADC lag at specific values

(OP)
I still think it was related to op amp, not A/D because 2 different A/D showed the same results.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close