AC Current Measurment Strategy

Thread Starter

mmitton

Joined Apr 2, 2023
2
Hi All,

We are busy with a project that takes measurements from a Current Transformer (CT) to track current usage in attached appliances. The CT is connected through an amplifier circuit to a micro-controller ADC pin. The AC wave (positive cycle only) is sampled at 100us intervals (there are a few channels to sample) and a snapshot of the positive half of a wave is recorded. From this snapshot we hope to calculate the current usage of the attached load.

We understand that in order to get an accurate power reading of the attached load we need to get an RMS current value from the CT, an RMS voltage value of the supply and the power factor (measure the phase angle difference between the supply voltage and load current).

Step 1 is to convert the ADC reading from the CT to a current value that is consistent with a Digital Multimeter (DMM) or within a small margin of error.

We believe that it should be possible to take snapshots (ADC values) of various types of loads with similar current ratings and the calculation employed should yield values that correspond to DMM readings. ie. If the DMM measures 2 different types of 15W loads and sees a current of 69mA and 58mA respectively (ratio of 1.19), then our calculation using ADC values should yield a similar ratio between the 2 loads.

Here are the values recorded for each load, 15W Incandescent and 15W LED lighting. (see graph)

The various measurement strategies yield the following results and ratios: (see table)
Where we calculate these values using the following formulas:

ADC sum = sum of all values
ADC Ave = average of all values
ADC RMS = peak * 0.707
ADC True RMS = Square root of the average of the sum of the squares

As you can see the sum/ave have a similar ratio but in the opposite direction and the RMS / True RMS calculations are way off.

Is the strategy to get the AC current employed here correct or valid?
What is the DMM using (Doesn't say it's a True RMS meter)?
Is the phase angle difference the issue here and do we need it for an accurate current measurement?
What are we missing?

Thank you for any insights.
Mark
 

Attachments

Ian0

Joined Aug 7, 2020
9,846
1. Bias the CT to half supply, so you can read both sides of the waveform. Do the same with the voltage measurement.
2. Sample at approx 1600 samples/second, sample both voltage and current.
3. Square each voltage sample, square each current sample, multiply each voltage sample by each current to get instantaneous power.
4. IIR filter all the values
5. Take the square root of the voltage and current to get the rms values. Power needs no further processing.
6.Divide power by (rms voltage multiplied by rms current). That's your power factor.
You don't need to measure the phase angle, and, unless you were measuring the power factor of a inductive load, it wouldn't help you to know it.
 

MrAl

Joined Jun 17, 2014
11,496
Hi All,

We are busy with a project that takes measurements from a Current Transformer (CT) to track current usage in attached appliances. The CT is connected through an amplifier circuit to a micro-controller ADC pin. The AC wave (positive cycle only) is sampled at 100us intervals (there are a few channels to sample) and a snapshot of the positive half of a wave is recorded. From this snapshot we hope to calculate the current usage of the attached load.

We understand that in order to get an accurate power reading of the attached load we need to get an RMS current value from the CT, an RMS voltage value of the supply and the power factor (measure the phase angle difference between the supply voltage and load current).

Step 1 is to convert the ADC reading from the CT to a current value that is consistent with a Digital Multimeter (DMM) or within a small margin of error.

We believe that it should be possible to take snapshots (ADC values) of various types of loads with similar current ratings and the calculation employed should yield values that correspond to DMM readings. ie. If the DMM measures 2 different types of 15W loads and sees a current of 69mA and 58mA respectively (ratio of 1.19), then our calculation using ADC values should yield a similar ratio between the 2 loads.

Here are the values recorded for each load, 15W Incandescent and 15W LED lighting. (see graph)

The various measurement strategies yield the following results and ratios: (see table)
Where we calculate these values using the following formulas:

ADC sum = sum of all values
ADC Ave = average of all values
ADC RMS = peak * 0.707
ADC True RMS = Square root of the average of the sum of the squares

As you can see the sum/ave have a similar ratio but in the opposite direction and the RMS / True RMS calculations are way off.

Is the strategy to get the AC current employed here correct or valid?
What is the DMM using (Doesn't say it's a True RMS meter)?
Is the phase angle difference the issue here and do we need it for an accurate current measurement?
What are we missing?

Thank you for any insights.
Mark

One of the first things i see that probably doesnt work well is the RMS value calculation. You cant really multiply the peak by 0.707 unless the waveform is a perfect sine wave. That could be true for the bulb but not true for the LED, but in general you have to sample at least the half wave a lot of times, i would say min 10 times per half cycle but more is better.
The phase angle is very important for the power calculation, but should not be important for the current calculation. The true power for true sine waves is:
P=E*I*cos(angle)
where angle is the angle between E and I (voltage and current waves).

The RMS voltage value is:
sqrt(integrate(v(t)^2,t,0,T)/T)
(or v(t) can be i(t) instead for RMS current)
which is simply the root of the mean of the square, and the v(t) are at least 10 samples of the half wave, and T is the half wave period and is sync'd to the calculation so that the first sample is at the zero crossing and the last sample is at the next zero crossing.
Whether or not you use 5 samples, 10 samples, or 100 samples depends on the complexity of the expected waveforms. As you know, for a pure sine wave you only need 1 sample at the peak, but as the waveform deviates from pure sine you need more samples. If you have scope snapshots of your waveforms we can determine how many samples, or experimentally you could just increase if the accuracy is not good enough.

For a power calculation you would use:
P=integrate(v(t)*i(t),t,0,T)/T
where v(t) and i(t) are the samples of voltage and current respectively. For this you need enough samples to be able to render the phase angle with enough resolution to get an accurate measurement. That means if the expected phase angle can be small you need more samples.

In the above "integrate(y,t,0,T)" simply means integrate the wave vertical (y) for t (time) from time 0 (zero) to T where T is one half cycle and 0 is the start of the half cycle.
Also, to integrate here means to 'sum' each sample. I believe Ian described this.
So if you have 5 samples 1,2,3,2,1 over a half cycle you sum them and that gives you 9. Very simple. In this case T is really the number of samples which is 5.
If you want better accuracy there are other move advanced formulas for that which include a sort of interpolation between samples.
 
Last edited:

Thread Starter

mmitton

Joined Apr 2, 2023
2
1. Bias the CT to half supply, so you can read both sides of the waveform. Do the same with the voltage measurement.
2. Sample at approx 1600 samples/second, sample both voltage and current.
3. Square each voltage sample, square each current sample, multiply each voltage sample by each current to get instantaneous power.
4. IIR filter all the values
5. Take the square root of the voltage and current to get the rms values. Power needs no further processing.
6.Divide power by (rms voltage multiplied by rms current). That's your power factor.
You don't need to measure the phase angle, and, unless you were measuring the power factor of a inductive load, it wouldn't help you to know it.
Thank you for your reply, we are going to look full wave rectification to flip the negative side of the wave positive, as well as move the zero point higher away from the adc minimum and noise floor.
 

Ian0

Joined Aug 7, 2020
9,846
You need it as AC, so you can get the correct answer for instantaneous power, when the current is negative and the voltage is positive, and vice versa.
 
Top