DC Offset and distortion problems in ADC front end - Page 1
Forum section: electronics / beginners

author: Bruno_PT
author_rank: Contributor
timestamp: May 07, 2022, 12:10:08 am
content: Hi guys, this my first post so go easy on me,BackgroundI am Bruno, and i am studding EECS, and because feature creep is my middle name i increased the complexity ofa course's project, in which one needed to build a simple adc front end with a few opamps for a current transformer sensor on a breadboard, then read it with an arduino uno/nanoas fast as possible (2kS/s), with the idea of doing an fft on the adc data to detect motor problems (read a single phase).board designInstead i went looking for 3 channel adcs, as the motors to be tested were 3 phase, found a couple good ones (ADS131M03), and with a raspberry pico for brains,and both a esp01 and a nrf24 for wireless connections, i had my main hardware chosen.I have never worked with a analog front end before so first step was to bench-watch TI's precision labs one youtube and what ever other sources i couldfind on the matter. As the adc is differential i went with a FDA, added a RC filter to the inputs and a extra burden resistor to lower the voltage to valueswithin my adc's range, and help set the DC offset of the signal as i was afraid they would be close to floating without it.The FDA is rail to rail so to maintain the adc safe even with the amp saturated i set Vdd to 3.3v and Vss to -1.5v.tested it on spice and it seemed to work well. designed the PCB, stock ran out, had to move to a scary (never had done smt before) qfn package, boardtested fine initially to say that the static dc offsets of the FDAs where below 1mv, board was using 200mA in total, life was good.The problem:After coding enough to stream the adc data @4Khz i tried to calibrate the board (int -> Amps) by exporting the data to a csv file and running a root meansquare on it and compare the results to my only meter a AN8009, got it good enough within 1% ( @3.86A ).But as i tried to increase the current i noticed that it had a massive DC offset, and asymmetrical wave form, which was so bad i first thought the grill i wasusing had diode in it, tried with an older oil heater and a similar result happened though much less severe, now i am afraid something is wrong with myfront end design, all i have is a multimeter so until monday went i get to uni there isn't much i can do test wise.PS: one of the sensors is inverted just so i had data with the opposite polarity so try to detect where the asymmetry came from.the only thing i can think of is that i connected Vocm of the FDA directly to ground as having a capacitor there in the case of gnd being the reference didn't seem right.This last one is the oil heater at full power a bit over 2000w, things are really bad massive distortions, almost as if negative voltages have a different gain.TL;DR:ADC (ADS131M03) front end using a FDA (MCP6D11T) for a 3 phase current meter, the DC offset of the read signal is increasing significantly at higher sensed currents, and there also seems to be some distortion, at 10A rms the signal is mostly positive and significantly distorted,(don't have a clean signal source to check against), any help in finding out what's happening is appreciated.Sensor: 3x SCT-013-30ATVS:UCLAMP2511TFDA:MCP6D11TADC:ADS131M03micro: Raspberry picoThanks for reading.I will edit this as i do more tests.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 07, 2022, 12:28:35 am
content: You've drawn so many boxes and colored back grounds that it's hard to find a schematic in between it.It also helps if you use an amplifier symbol for an amplifier instead of an IC look alike thing.From your "gonewrong" picture, it looks like you have a slewrate, saturation or oscillation problem in your circuit and that makes it asymmetrical, and not only a DC offset problem.It's also quite possible that your input signal is severely distorted and just looks like that.You write you sample at 4ksps and I count about 80samples in a period, so that would make your input 50HzAfter reading it again, some kind of saturation effect on the sensor seems most likely.What happens if you swap the two inputs at the audio plugs?If this inverts your waveform, then the problem is before this plug.If it stays the same, then the problem is after the plug.

author: Bruno_PT
author_rank: Contributor
timestamp: May 07, 2022, 01:10:45 am
content: Sorry for the readability, the signal that is 180 degrees out of phase with the other ones was inserted facing the opposite side of the other two to see if it as the board or not,as one can see it looks just like the others so the problem seems to be on the front end,yes the signal is a 50hz current signal from a electrical grill.trying right now the oil heater at full power to see if it makes the same graph as the grill, the grillThe oil heater at full power is basically only positive, should be somewhere around 10A rms, so for sure its not the grill being a weird load,seems to be the boardthe grill shows a less severe but still pretty damn bad chart

author: Kleinstein
author_rank: Super Contributor
timestamp: May 07, 2022, 04:34:49 am
content: The AC signal is a bit tricky for testing. The mains waveform may not be a pure sine and may also change over time. As the circuit is DC coupled, there is not need to do the calibration with AC.The charge pump circuit may have a limited current capacity and may not deliver more than a few mA.The input amplifiers are quite low in impedance and with a larger input signal would also consume more current.The input stages anyway have a problem: the differential amplifier part is sensitive to the source resistance. The rather low input resistance can also be a problem with loads different from a low value shunt or current transformer.

author: Bruno_PT
author_rank: Contributor
timestamp: May 07, 2022, 09:51:15 am
content: Quote from: Kleinstein on May 07, 2022, 04:34:49 amWell the charge pump and the negative voltage regulator both are rated for 200mA, which should have been more than enough, but i will try to measure the negative rail during measurement to see if something is wrong.

author: Bruno_PT
author_rank: Contributor
timestamp: May 07, 2022, 11:17:32 am
content: Well i measured the -1.5 rail, the 3.3v rail and dc offset of each channel while a base ~3.8A current was passing through the 3rd channel, twice as much through the 2nd channel, and 3 times as much through the 1st channel ( 1 turn, 2 and 3 turns respectively)-1.5v rail: -1.49V3.3v rail: 2.84VR (1st) - ~20mv dc offset, 70mV AC (differential, half as much to ground)S (2nd) - 2mv dc offset, 12mV AC (differential, half as much to ground)T (3rd) - too small to measure, 2.6mV AC (differential, half as much to ground)(all measured with the an8009, not sure if there could be some shenanigans affecting measurement)with R channel in the second Y axis to better see the other two

author: Bruno_PT
author_rank: Contributor
timestamp: May 07, 2022, 01:25:30 pm
content: Well there is a good chance i found the problem, it seems like even after quadruple checking, i got a connector upside down (error is in the schematic symbol) pins 4 and 5 of the STX3120 should be the ones on top and not the 2 and 3 pairs. will try to invert the connector and report back.

author: Kleinstein
author_rank: Super Contributor
timestamp: May 07, 2022, 01:26:18 pm
content: A current transformer by design should give out a pure AC signal and not DC. If the actual current has a DC component this can effect the magentics of the core and worst case can drive the core to saturation and cause a nonlinear response.A current transformer can become nonlinear if the resistance on the output is too small and the voltage gets to large.

author: Bruno_PT
author_rank: Contributor
timestamp: May 10, 2022, 03:14:54 am
content: So a small update, changed the connectors to the other side fixing the issue and things look much better,calibrating for the 3.8A current, the 3 other channels with much higher currents showed little to no non linearity, i am quite pleased.The only "problem" is that the maximum current i can read seems to be 19.5A peak, which is nearly half of what i was expecting,but it should be more than enough for what i am doing.