Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Method to Calculate True RMS Power, Will it work??

Status
Not open for further replies.

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Hi,

I am probably missing something obvious but i am looking to design a circuit to calculate true RMS power for an AC mains supply,

Would i be correct in saying the following would work,

1) Measure true RMS voltage for one complete cycle using resistor divider

2) Measure true RMS current for next cycle using Current Transformer

3) Multiply these values together to then give True RMS Power??

The mains frequency is 50Hz and i only want an updated value every 25 cycles so would the above work or does the voltage and current have to be sampled at the same time??

Thanks in advance,
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,789
Helped
903
Reputation
1,804
Reaction score
888
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,353
Hi,

I am probably missing something obvious but i am looking to design a circuit to calculate true RMS power for an AC mains supply,

Would i be correct in saying the following would work,

1) Measure true RMS voltage for one complete cycle using resistor divider

2) Measure true RMS current for next cycle using Current Transformer

3) Multiply these values together to then give True RMS Power??
As The Electrician noted you need to multiply them together simultaneously to get true RMS power. The reason is that your method doesn't take into account any phase shift between the voltage and the current caused by any reactive loads, which causes reactive power.

If you are only updating every 25 cycles than you can average the value for exactly 25 cycles (500ms) to minimize the effects of line noise and get better accuracy.
 

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Thanks for the replies guys, really helpful, The only reason i was going to do this was that as far as i am aware the current transformer will introduce its own phase shift which will alter the true result, am i correct??

If so any ideas how to compensate for this phase shift caused by the CT?

When you say instantaneous voltage & current would taking the values say 500uS apart have any impact on a 50Hz AC reading?

Thanks again
 

The Electrician

Full Member level 5
Joined
Jul 13, 2010
Messages
256
Helped
130
Reputation
260
Reaction score
123
Trophy points
1,323
Location
Pacific NW
Activity points
3,656
Thanks for the replies guys, really helpful, The only reason i was going to do this was that as far as i am aware the current transformer will introduce its own phase shift which will alter the true result, am i correct??

If so any ideas how to compensate for this phase shift caused by the CT?
A good quality CT should have negligible phase shift. If extreme accuracy is needed, you could measure the phase shift and take it into account.

When you say instantaneous voltage & current would taking the values say 500uS apart have any impact on a 50Hz AC reading?

Thanks again
The error will depend on the waveforms of the current and voltage. Imagine that your load was a periodic current pulse lasting 500 uS, with 500 uS off time between pulses. Depending on just when you were measuring the current, you might get a result of zero for the power. Your measurements should be as near simultaneous as possible.
 

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Ok thanks,

So the way to go is as follows (correct me if im wrong)

1) start at zero crossing point of signal

2) Instantaneously measure voltage and current say 250 samples along one full cycle (is 250 cycles enough)

3) square all of the voltages and square all of the currents

4) add everything together

5) Square Route of the Result is true my true RMS Wattage??

The above sounds like a lot of work, what is the procedure to measure the average RMS, Is it just take the peak voltage of each and multiply by 0.707??

Is there any way to measure the RMS Wattage with a meter to see how accurate my circuit is??

Thanks,
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,789
Helped
903
Reputation
1,804
Reaction score
888
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,353
So the way to go is as follows (correct me if im wrong)

1) start at zero crossing point of signal

2) Instantaneously measure voltage and current say 250 samples along one full cycle (is 250 cycles enough)

3) square all of the voltages and square all of the currents

4) add everything together

5) Square Route of the Result is true my true RMS Wattage??

The above sounds like a lot of work, what is the procedure to measure the average RMS, Is it just take the peak voltage of each and multiply by 0.707??

Is there any way to measure the RMS Wattage with a meter to see how accurate my circuit is??
That won't work since you still calculating the voltage and current independently, it doesn't account for any phase shift. You need to multiply the instantaneous voltage by the instantaneous current at each measurement point and then average the result of these multiplications as stated earlier. You don't need to square or take the square root of anything since volts times current equals real power at any point in time.

The number of samples you take depends upon the amount of harmonics in the waveform. 250 samples/waveform allows detection of up to a 6.25KHz harmonic which should be more than enough.

You need a wattmeter to measure the true power such as the Kill-A-Watt meter.
 

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
ok thanks for this, nearly there now,

Everything i have previously read on true RMS states that i need to take all of the values, square them and square root of the sum of all of the values, but what you are saying makes sense alright, where does the square and square root come in??

When you say average the results do you mean add them all together and divide by the number of samples i took?

Is this method not the exact same as taking normal RMS??
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,789
Helped
903
Reputation
1,804
Reaction score
888
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,353
Everything i have previously read on true RMS states that i need to take all of the values, square them and square root of the sum of all of the values, but what you are saying makes sense alright, where does the square and square root come in??

When you say average the results do you mean add them all together and divide by the number of samples i took?
You take sum of the squares when you are calculating the RMS voltage or RMS current. You don't do that when calculating instantaneous power.

Yes, that's how you average the results.
Is this method not the exact same as taking normal RMS??
True RMS power is not a proper term. RMS really applies only to voltage or current, not a true or real power calculation. The three types of AC power are real(true), reactive, and apparent (average RMS voltage times average RMS current or the combination of the real and reactive).

Students are often not clearly taught the distinction between these.
 
Last edited:

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Thanks Crutschow thats brilliant, I have a much clearer idea now of the terms,

My last question that i am still getting confused with is if i want real power i sample the signal (say from a current transformer) at a high sample rate and square and square root the results to account for non Sine Waves (Switch Mode PSU) but what is the method then to get normal RMS (assuming i have a heater and an ideal Sine Wave??

Your help has been brill so far,
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,789
Helped
903
Reputation
1,804
Reaction score
888
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,353
.....................................

My last question that i am still getting confused with is if i want real power i sample the signal (say from a current transformer) at a high sample rate and square and square root the results to account for non Sine Waves (Switch Mode PSU) but what is the method then to get normal RMS (assuming i have a heater and an ideal Sine Wave??
Why do you want to do this? Multiplying the sample voltage by the sample current to get real power works for any type of waveform.

You only get real power by RMSing the current for a non Sinewave if you assume the voltage is an ideal sinewave with no phase shift between voltage and current. You use the same calculation for an ideal sinewave load. RMS is RMS. Not sure what you mean by "normal RMS".
 

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Sorry to confuse things, I suppose you just hear of RMS and True RMS, (Normal RMS is non true)

I have been looking at the Microhip MCP3901 and this looks like it would fit the bill perfectly,

Have you any bright advice to determine the phase shift between voltage and current to compensate? Is it really necessary to compensate for it if im only looking for between 2 & 5% accuracy??

Thanks
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,789
Helped
903
Reputation
1,804
Reaction score
888
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,353
Sorry to confuse things, I suppose you just hear of RMS and True RMS, (Normal RMS is non true)

I have been looking at the Microhip MCP3901 and this looks like it would fit the bill perfectly,

Have you any bright advice to determine the phase shift between voltage and current to compensate? Is it really necessary to compensate for it if im only looking for between 2 & 5% accuracy??
True RMS and RMS are only different if you are talking about a voltmeter. Many voltmeters measure the average value of the voltage and display the RMS value by multiplying the average value by ratio of the RMS to Average value of a sine-wave (.707/.637 = 1.11). Thus they display the "true" RMS only for a sinewave. But if you are talking about waveforms in general, the calculated RMS value is the True RMS value.

Why are you still talking about the phase shift between the voltage and the current? :-? If you do simultaneous sampling of the voltage and current, multiply each pair of simultaneous samples, and then take their average of those calculations (including the sign of each calculation), you automatically include the effects of any phase shift. Each instantaneous sample pair measures the actual power at that point in time. If the multiplied value is positive, the power is real and if the multiplied value is negative the power is reactive. The average of the sum of all those values is the net real power. That's why the method measures "true" RMS. Is that still not clear?
 
Last edited:

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Yes Sorry it is, where the phase shift question comes in is that my CT will shift the phase of the current a little as opposed to probably a resistor divider network for the voltage with no shift, It was mentioned already though that a good CT should not shift the phase too much so i might just go with what iv mentioned above for now and see how i get on with it,

Sorry now again to be a bit stupid but have i got this correct

1) Calculate RMS Current
- Take say 250 samples of a cycle
- Square all samples individually
- Sum all of the results
- Square root of the Sum of all of the squared numbers
- This value is RMS of Current flowing

2) Calculate RMS Voltage
- Take say 250 samples of a cycle
- Square all samples individually
- Sum all of the results
- Square root of the Sum of all of the squared numbers
- This value is RMS of Voltage flowing

3) Calculate RMS Power (Watts)
- Take say 250 samples of a cycle instantaneously multiplying voltage & current
- Sum all of the results
- Divide the Sum of results by 250 samples
- This value is RMS Power

Is the above all correct? I really appreciate your patience here,

Without really specialized equipment have i any way to determine how accurate i am at different loads, a good meter will tell me voltage or current independently but not wattage,

Thanks
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,591
Helped
4,782
Reputation
9,581
Reaction score
4,562
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
124,351
Correct - but for best results do not do your steps in numerical order.

Take sample 1 of the voltage
Take sample 1 of the current
Take sample 2 of the voltage
Take sample 2 of the current
...
Take sample 250 of the voltage
Take sample 250 of the current.

You can actually work out the real power by multiplying voltage sample 'n' by current sample 'n'. The idea is that it W = V x I and as long as the time between measurments is very short (ideally simultaneous) the reading will be correct. Averaging them will help to give a more consistent reading. I think I'm right in saying if you ignore the polarity and treat everything as positive, you can ignore the squaring and square rooting stages which are only there to ensure all measurements are positive anyway. (because squaring either polarity gives a postive result)

Brian.
 

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
Correct - but for best results do not do your steps in numerical order.

Take sample 1 of the voltage
Take sample 1 of the current
Take sample 2 of the voltage
Take sample 2 of the current
...
Take sample 250 of the voltage
Take sample 250 of the current.

You can actually work out the real power by multiplying voltage sample 'n' by current sample 'n'. The idea is that it W = V x I and as long as the time between measurments is very short (ideally simultaneous) the reading will be correct. Averaging them will help to give a more consistent reading. I think I'm right in saying if you ignore the polarity and treat everything as positive, you can ignore the squaring and square rooting stages which are only there to ensure all measurements are positive anyway. (because squaring either polarity gives a postive result)

Brian.
Thanks for your input, I was under the impression from the other posts that the square, square root was only for voltage and current and not for power,

I think taking everything as positive regarding power will work as multiplying minus by minus gives plus anyway,

Why do you say take all the samples first, just a speed thing is it??

Looking at my ADC it has two converters for exactly this purpose to take both reading at exactly the same time
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,789
Helped
903
Reputation
1,804
Reaction score
888
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,353
OK. We still have a failure to communicate. :???:

I agree that the current transformer should have negligible phase shift. Typically transformers have very little phase shift from input to output so I don't think you need to compensate for that.

As though I stated (but apparently I wasn't clear) you just multiply the voltage by the current of each sample individually, preserving the sign of each input and subsequent product value. Do not multiply and take the square root of any of the data at any time). Then you add that product (with its sign) to the previous product (it's not necessary to store all 250 products but you can if that's easier to do). When you have the sum of all the products then take the average. This gives the real power.

You can't ignore the signs and treat everything as positive as betwixt stated. If you do that you will be calculating the apparent power, not the real power. As I stated in post #13 "If the multiplied value is positive, the power is real and if the multiplied value is negative the power is reactive. The average of the sum of all those values is the net real power."

If you don't have a wattmeter to verify your measurements, than you would have to measure the voltage and current, and the phase shift between them with an oscilloscope. The calculate the power using the standard AC power equation.

Note that you must use isolation transformers for both the current and voltage measurement. It's very dangerous to measure either directly from the mains.

Is that all clearer now?
 

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
OK. We still have a failure to communicate. :???:

I agree that the current transformer should have negligible phase shift. Typically transformers have very little phase shift from input to output so I don't think you need to compensate for that.

As though I stated (but apparently I wasn't clear) you just multiply the voltage by the current of each sample individually, preserving the sign of each input and subsequent product value. Do not multiply and take the square root of any of the data at any time). Then you add that product (with its sign) to the previous product (it's not necessary to store all 250 products but you can if that's easier to do). When you have the sum of all the products then take the average. This gives the real power.

You can't ignore the signs and treat everything as positive as betwixt stated. If you do that you will be calculating the apparent power, not the real power. As I stated in post #13 "If the multiplied value is positive, the power is real and if the multiplied value is negative the power is reactive. The average of the sum of all those values is the net real power."

If you don't have a wattmeter to verify your measurements, than you would have to measure the voltage and current, and the phase shift between them with an oscilloscope. The calculate the power using the standard AC power equation.

Note that you must use isolation transformers for both the current and voltage measurement. It's very dangerous to measure either directly from the mains.

Is that all clearer now?
Yes that's fine, thanks for your help, I had not mentioned squaring for power calculation only for calculating RMS Voltage or RMS Current independantly,

You have been most patient, i am studying a little more on AC theory anyway before i finish this design and all will become clear :)

Thanks
 

crutschow

Advanced Member level 5
Joined
Feb 22, 2012
Messages
3,789
Helped
903
Reputation
1,804
Reaction score
888
Trophy points
1,393
Location
L.A. USA Zulu -8
Activity points
21,353
Yes that's fine, thanks for your help, I had not mentioned squaring for power calculation only for calculating RMS Voltage or RMS Current independantly,

You have been most patient, i am studying a little more on AC theory anyway before i finish this design and all will become clear :)

Thanks
After re-reading your post #14 I realize that you did have it all correct. I though you were using the calculated values for RMS voltage and current to calculate the power, but you weren't. :oops:

So good luck with the project.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top