Author Topic: Measuring wide range of currents with ADC  (Read 788 times)

0 Members and 1 Guest are viewing this topic.

Offline Red_MicroTopic starter

  • Regular Contributor
  • *
  • Posts: 121
  • Country: ca
Measuring wide range of currents with ADC
« on: April 16, 2020, 11:13:29 pm »
I'm designing an amplifier to read currents using a CT from 10 mA to 30A with a STM32 with no FPU. I have the following data:

CT turns ratio = 1000:1
Burden resistor = 10 ohms
ADC reference = 3.3 V
DC shift = 1.65V (2048 adc count)
Amplifier gain from 10 mA to 10A = 8
Amplifier gain from >10A to 30A = 2
Let's say I want to read 10 mA:

Secondary current = 10 mA/1000 = 10 uA
Vburden = 10 uA * 10 = 100 uV
Vpeak = 100uV * 1.41 = 141.42 uV
Vadc_in (amplified) = Vpeak * 8 = 141.42 uV * 8 = 1.13 mV
Vshifted = 1.13 mV + 1.65V = 1.65113V
Adc_count = (Vshifted*4095)/3.3 = 2048.90 = 2049
I can also say:

Vadc_in(pk-kp) = 1.13 mV * 2 = 2.26 mV (peak to peak)
Adc_span = (2.26 mV * 4095)/3.3 = 2.8 ~ 3
So if I have 3 counts for a 10 mA primary current,

1 count = 3.33 mA
OR 3.33 mA/ADC count
Now, let's say I want to read 15 mA

Secondary current = 15 mA/1000 = 15 uA
Vburden = 15 uA * 10 = 150 uV
Vpeak = 150uV * 1.41 = 211.5 uV
Vadc_in (amplified) = Vpeak * 8 = 211.5 uV * 8 = 1.692 mV
Vshifted = 1.692 mV + 1.65V = 1.651692V
Adc_count = (Vshifted*4095)/3.3 = 2049.6
Doing the same calculation for 10 A, I get 2.78V peak at the ADC input, and 2749 count.

Is this approach right? I don't need to do RMS, that's why I think I can get away with just finding the peaks. Also, look at the case of 10 mA and 15 mA, the ADC count is almost identical, i.e., 2049. If I do the DC shift subtraction by software, that is, 2049-2048 = 1. There would be a lack of precision I think. I would get the same values for 10 mA and 15 mA. Please, correct me where I'm wrong.
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 6389
  • Country: ca
  • Non-expert
Re: Measuring wide range of currents with ADC
« Reply #1 on: April 17, 2020, 08:17:24 pm »
As you said, ~3mA per count so trying to measure a difference of ~1 ADC count is going to be rough, its down in the noise.

Probably need to move to a higher bit ADC, 14-16bit, if you need more resolution than 10's of mA.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline Red_MicroTopic starter

  • Regular Contributor
  • *
  • Posts: 121
  • Country: ca
Re: Measuring wide range of currents with ADC
« Reply #2 on: April 17, 2020, 10:45:46 pm »
As you said, ~3mA per count so trying to measure a difference of ~1 ADC count is going to be rough, its down in the noise.

Probably need to move to a higher bit ADC, 14-16bit, if you need more resolution than 10's of mA.

I think I can get away with 12 bit ADC if I split my wide range (5 mA to 30A) in different ranges for different gains. It's easier for me to have different gains for certain ranges than switching to a 16 bits ADC. The thing is to have more counts, as 1 count difference will be hard to deal with.
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1641
  • Country: nl
Re: Measuring wide range of currents with ADC
« Reply #3 on: April 18, 2020, 07:56:25 am »
You're trying to resolve 10mA in a range of 10A. This means you try to engineer a 1000 count measurement.

You have a 12-bit ADC, so basically 4096 LSB's. But you have to drop 1/sqrt(2) range due to sinusoidal signals, and therefore only have 4096/sqrt(2)/1000 = 2.896 ADC LSB/count, which results in  approximately 3.45mA/LSB.
Edit: Also, I assume you will also measure the negative peaks. In that case you only have 2048 LSB of resolution for the positive half, and therefore only measure 6.9mA/LSB.

If you expect a regular ADC to have several bits of noise (say 1-2), you're really trying to resolve those 10mA into the noise floor. Since you're dealing with AC signals, oversampling is hard because you need accurate synchronization on your sinusoidal inputs.

I think the division between your current ranges is odd. You may get better results if you try to resolve 10mA in a range of say 2 to 4A, and then allow for a significant gain decrease in the 30A range.

Alternatively pick a higher resolution and low noise ADC.
« Last Edit: April 18, 2020, 07:58:51 am by hans »
 
The following users thanked this post: Red_Micro


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf