cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F100C4T6B Optimizing ADC Sample Time to Reject Noise

dcharlantini
Associate
Posted on April 10, 2013 at 16:29

Hello all,

I am using an STM32F100C4T6B in the battery pack of an uninterruptible power system for the purpose of measuring the battery voltage, current, and temperature. When the UPS is operating from battery it’s dc-dc converter produces high frequency repetitive noise which is induced on the battery current ADC measurement input of the STM32F100C4T6B.

The noise induced on the battery current ADC input has the characteristic of a 20MHz ringing type noise event which has a duration of approximately 200nS, and this event repeats at approximately regular intervals of 4uS.  See the attached pdf file showing the noise waveform.

So, my question is: Is there an optimal setting for the STM32F100C4T6B’s ADC that would help to better filter out this noise ?

Does the ADC’s sample-hold internal circuitry peak charge an internal capacitor, thus capturing the peak of the ringing noise event, or will the the internal sample-hold capacitor integrate the input noise over the sampling time ?

I presently have the sampling time configured for the maximum of 239 clocks, which is approximately 20uS.  So, will this in theory integrate the noise event over a longer sampling time, thus integrating out the peaks and minimums, or would it be better to configure the ADC to sample as fast as possible, i.e. 125nS sampling time, so as to attempt to sample the peaks and minimums of the noise event on separate conversions and then apply additional filtering using a firmware averaging type filter to eliminate the noise ?

My present code has a 20uS sampling time and measures 3-channels, battery voltage, current, and temperature, in a multi-channel continuous scan mode.  The DMA controller automatically pushes the ADC conversion result data to an array in ram.  A 177 sample coherent averaging filter is applied in the firmware so as to smooth the measurements, thus eliminating most of the effect of the noise.

I’m really looking to see if anyone has suggestions or recommendations for a more optimal method of rejecting the noise I’m experiencing on the battery current measurement ADC input in my UPS application.  I want to know more details of how the STM32F100C4T6B’s internal ADC and sample-hold circuitry actually functions.

Thanks,

Don
2 REPLIES 2
frankmeyer9
Associate II
Posted on April 10, 2013 at 17:04

Choosing a 20us sampling time sounds reasonable.

Does the ADC’s sample-hold internal circuitry peak charge an internal capacitor, thus capturing the peak of the ringing noise event, or will the the internal sample-hold capacitor integrate the input noise over the sampling time ?

 

It integrates in the usual way, were Cs forms a RC element with the input impedance.

I’m really looking to see if anyone has suggestions or recommendations for a more optimal method of rejecting the noise I’m experiencing on the battery current measurement ADC input in my UPS application.  I want to know more details of how the STM32F100C4T6B’s internal ADC and sample-hold circuitry actually functions.

 

More details about the ADC can be found in the Reference Manual for the F10x series.

You did not reveal much about the bandwith requirements for the measured signals, but I would consider a LC or RC lowpass filter at the inputs, and possibly some shielding.

raptorhal2
Lead
Posted on April 10, 2013 at 17:05

The ADC sample and hold is basically an RC circuit with a characteristic first order lag response time chasing the input signal. So it doesn't average over the sample time.

By averaging after sampling, you may get folding of the high frequency noise into low frequency noise below your sampling rate. If you have the board real estate, the best solution is to prefilter. Since your data is changing very slowly, you can probably use a simple resistance/capacitive lag network without an operational amplifier, and use a maximum ADC sample time to so the sample and hold value is accurate. The ST web site has a publication on ADC accuracy that explains this well.

If you are an all digital person and this seems mysterious, talk to an electronics circuit geek for assistance.

Cheers, Hal