-18x ADC: required source impedance ?

bob weir

New Member
the signal source to be measured is the output of a AD626 diff'l instr' amp. and has an output impedance of an ohm or less. what value of series resistor should be placed between its 10k load resistor and the -18X adc input for a reading ? i.e. what value of impedance is the -18X expecting to see for the voltage signals to its adc's ?

the signal to sampled w/ the adc is at a nominal 2 volt level with about 400 mV of 8khz blur centered above and below this level. how well does the -18X adc handle moving signals like this ? is there some sort of a hold-time requirement for the adc during which the signal does not change ?

the signal can be smoothed no further.
is it the custom in cases like this to take say, 50 samples, and then average them and call that the signal sample to save ?

what is going on is taking the voltage off a 20 milliohm sense resistor with 5 to 10 amps passing thru it on its way to a brushless motor. the AD626 lets you amp this input signal by 10 and LP- filter it.

but even after doing that the signal is still pretty noisy.

 

womai

Senior Member
The maximum allowed source impedance according to the Microchip data sheet is a few kOhms (I believe around 10kOhms). But since your driver is low output impedance I'd use something lower, e.g. 1 kOhm sounds like a good number.

If you want to remove noise, you can do the filtering in analog land or in digital land. Averaging over several samples is equivalent to digital low-pass filtering. With a Picaxe you'll get a few 100 samples per second at beast (around 2000 Basic command per second unless you overclock, plus overhead for looping and math), so averaging over let's say 40 samples means your time constant is on the order of 0.1sec.

The analog solution would be a capacitor at the Picaxe ADC input. In combination with your R=1kOhm resistor (from above) this forms a somple one-pole low-pass filter which is sufficient for this application. It's time constant (not quite the same meaning as the time constant above for digital averaging) is T=RxC. To settle to steady state such a filter needs a few (around 5) time constants, so you'd shoot for T=0.02sec to more or less match you digital case from above. That results in

Cmax = 0.02 sec / 1000 Ohm = 20 uF

as an upper limit for your capacitor. On the other hand, you say you need to smoothen out your 8kHz noise so your time constant needs to be several times (e.g. 10x) larger than this period.

period = 1/8000 = 125 us.

This gives a lower limit for the capacitor of

Cmin = 125 nF

So for your application, a 1 kOhm resistor leading from you op-amp output to the picaxe, and a capacitor of somewhere between 125nF and 20 uF between the Picaxe input and ground will work fine for you. I'd go for something in the middle, e.g. 1uF.

As for the capacitor choice, don't use electrolytic capacitors because they are very inductive and can't react fast. Use a ceramic capacitor instead - 1uF is still easy to get in that type.

Wolfgang

 

bob weir

New Member
womai - you were spot on w/ the 1 uF value.
that value and a 1k resistor lowered the
noise amplitude to about 250 mV. adding a 2'd 1 uF cap did not improve so was left out.
so , now, instead of the noise being 25% of the nominal voltage it is down to about 13%. at this point would you try for more analog filtering ? or take a bunch of samples and average them digitally ?
thanks for your input. it was good of you to refer to the data sheet for the source impedance answer. i had forgot that these picaxe chips are microchip uC's that are well documented. your mention of that was my wake-up call.
by the way how did you come up with the time constant for the digital method ?
the analog one i follow ok.
bw
 

womai

Senior Member
Well, I'm a bit surprised the filtering does not make it better than 13%. If it is really 8 kHz noise, then 1uF behind 1kOhm should make it disappear almost completely. Maybe you could describe your circuit in more detail? Also, try to e.g. increase the resistor to 10 kOhm and see if the noise goes away. Maybe your scope input is not high impedance but is loading your probe point? Maybe you could double-check the capacitance value as well. And just to be on the safe side, the sequence of components in the circuit is

(1) signal source (your op-amp output)
(2) 1 kOhm resistor between source and capacitor
(3) 1 uF capacitor to ground
(4) Picaxe ADC input

The "digital time constant" is really just a rough number; actually it's more a rise time than a time constant (for the RC filter, rise time from 10% to 90% is about 2.2 times the time constant).

Imagine a sudden fast step (faster than your sample period) applied to your ADC input. The sampled value just before the step will be low (e.g. 0), the next sample will yield high (e.g. 255). But when you average e.g. 40 samples then the signal has to stay high for at least 40 sample periods in order for the average to yield a solid high (255). If you sample e.g. 40 times per second, that translates into a system rise time of 1 sec. I'm aware that my definition for analog and for digital time constant is not perfectly consistent, after all the exact filtering behavior of the two methods is not the same, but both give you at least the order of magnitude for your effective "reaction time" to a change in the signal.

Wolfgang


Edited by - womai on 26/05/2006 06:28:17
 

bob weir

New Member
womai - you read very thoroughly. your response-ability is appreciated.
a circuit is drawn up. and scanned and the file saved as a *.jpg. now tho i dont know how to post it with this reply. does this forum not accept photos or graphics ? if not and you are agreeable it can be sent to your e-mail address as an attachment. also it can be saved in *.pdf format. let me know
your sequence listing matches the circuit except for (4). the picaxe ADC -18x
chip was not attached. doing that is the next step planned for later today. however you raise some matters to be looked at that could delay that step.
off of the '626 pin 5 output pin is a 10k to gnd (to load it) , and in parallel with that is a .001 uF cap. this was added to fix a random problem of the pin 5 voltage floating to V+. nothing in the data warned of this occurrence.
and from the jct of (pin 5, the 10k and .001 uF) is one end of a 1k , with the other end connected to a 1.0uF to gnd.
this 1k-1.0uF jct is where the 1M scope probe was con'd. scope is a b+k 1560
the next action will be to try your 1k --> 10k change idea and see if the noise reduces. also will try varying the filter cap on pin 4 of the '626 for same reason.
the original ckt was laid out on a solder-less bread board with 6" wires going to the .020 sense resistor. once it was giving me some use-able ( but very noisy) output signal i didnt try to improve it any further. then the entire circuit was re-done on a 3/4" x 2" piece of copper clad to create a larger ground plane. now the leads to the sensor are only 2". by doing this i expected the noise to be greatly reduced.
the large CMRR of the '626 should have taken care of all the big-current magnetic fields circulating about. and so am puzzled too why it is still so large (13% i.e. 250 mV/1964 mV noise-to-signal ratio ... the 250mV is the scope measurement, the 1964 mV is the VOM reading, both taken at the 1k-1.0uF jct.) the 250 mV noise level was constant from 3.2 to 9.8 amps. the 1964mV is the 9.8 amp reading. (9.8amps)(.020 ohm)(gain = 10)
so, really the "13%" is true for only that 9.8 amp datum.
in summary going to a Cu -clad ground plane did not improve the noise at all.
one new idea i've had is to add a 0.1uF bypass cap to the V+ '626 pin 6. their ex. ckt's all show one, but i overlooked putting one in. my V+ is coming off a 4-cell nicad pack and i've always thought batteries dont require the cap like an AC source of V+ would.
ok, back to the adc. by 'sample period' do you mean some length of time the -18x's adc is taking a reading off its input pin ?
and you are citing a case where the signal is low when this 'window' opens and then rises during the space of time the 'window' is open ? or how successive sample windows see a different voltage ? are you getting at the size of this sample window having to be short enough for the least amount of signal voltage level change ?
this aspect of the circuit is something i want to get further into later. for instance i want to learn the sample window size of the -18x's adc input. and how to translate this into the 8-bit value of 5/256 = .020 volts. and how this all relates to accuracy when the signal is fast moving.

regards,
bw

bw
 
Top