calculating reactive power from i(t) and u(t)

Started by August 20, 2010
Hello.

I am sampling the current and voltage simultaniously. Right now I am
calculating reactive power in two ways:

1). delay the current samples by a quarter of a period and then
multiplying:

Q=i(n+pi/2)*u(n)

2). or using the following procedure:

P=1/(num. samples)*sum( i(n)*u(n) ) -> active power

S=Irms*Urms -> apparent power

Q=sqrt(P^2 - Q^2) -> reactive power

Unfortunatelly neither give me good results. Is there a nother way to
compute reactive power? I can't use any complicated FFt algorithm as the
processor isn't very browny.

Let me add that the i(n) and u(n) ared 12bit, unsigned.

On 08/20/2010 07:14 AM, iggy wrote:
> Hello. > > > I am sampling the current and voltage simultaniously. Right now I am > calculating reactive power in two ways: > > > 1). delay the current samples by a quarter of a period and then > multiplying: > > Q=i(n+pi/2)*u(n) > > > 2). or using the following procedure: > > P=1/(num. samples)*sum( i(n)*u(n) ) -> active power > > S=Irms*Urms -> apparent power > > Q=sqrt(P^2 - Q^2) -> reactive power > > > Unfortunatelly neither give me good results. Is there a nother way to > compute reactive power? I can't use any complicated FFt algorithm as the > processor isn't very browny. > > > Let me add that the i(n) and u(n) ared 12bit, unsigned.
Define good results. For a signal with a single known, steady frequency and a linear time-invariant load (i.e. if there's no harmonics or mixing products in the voltage or current) then your delay-and-multiply should work OK. You're getting confused in your apparent vs. real power -- you want to subtract the real power from the apparent power directly, the left over "power" is reactive. So after calculating P and S, Q = S - P -- all the squaring and square rooting is taken care of elsewhere. Using an FFT to do this job would be like using a cut and thread water pipes for your house -- it can be done, but you're putting a lot of effort and expensive machinery into a job that can be done with a hand tool or two. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
>Hello. > > >I am sampling the current and voltage simultaniously. Right now I am >calculating reactive power in two ways: > > >1). delay the current samples by a quarter of a period and then >multiplying: > >Q=i(n+pi/2)*u(n) > > >2). or using the following procedure: > >P=1/(num. samples)*sum( i(n)*u(n) ) -> active power > >S=Irms*Urms -> apparent power > >Q=sqrt(P^2 - Q^2) -> reactive power > > >Unfortunatelly neither give me good results. Is there a nother way to >compute reactive power? I can't use any complicated FFt algorithm as the >processor isn't very browny.
>Let me add that the i(n) and u(n) ared 12bit, unsigned. > > >Any advice wellcome.
Isn't that a drug company? Steve
>2). or using the following procedure: > >P=1/(num. samples)*sum( i(n)*u(n) ) -> active power > >S=Irms*Urms -> apparent power > >Q=sqrt(P^2 - Q^2) -> reactive power
Oops, I missed something. You have Q and P swapped over here, so you will be taking the root of a negative number. You're making life complex. :-) Steve
On 08/20/2010 11:15 AM, steveu wrote:
>> 2). or using the following procedure: >> >> P=1/(num. samples)*sum( i(n)*u(n) ) -> active power >> >> S=Irms*Urms -> apparent power >> >> Q=sqrt(P^2 - Q^2) -> reactive power > > Oops, I missed something. You have Q and P swapped over here, so you will > be taking the root of a negative number. You're making life complex. :-)
Worse than that -- look at the last equation. Q = sqrt(P^2 - Q^2) This implies that Q^2 = P^2 - Q^2, or 2 * Q^2 = P^2, or Q = +/- sqrt(2) * P Or maybe it implies a typo... -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
steveu <steveu@n_o_s_p_a_m.coppice.org> wrote:
(snip)

> Your first equation will only behave properly if the signal you delay is a > pure sine wave. If you delay a signal by 90 degree at the fundamental, it > will be delayed the wrong amount at all the harmonics. Typically a mains > voltage signal doesn't have a lot of harmonic content, but the current > signal does. That means this approach is an OKish approximation in most > cases. Note that the delay needs to be pretty accurate to ensure good > results across the power factor range. At 0.5PF, just a 0.1 degree phase > error will give you about 0.3% error in the power measurement.
There used to be a popular line of voltage regulating transformers that had a large amount of third harmonic in the output. Enough in many cases that there was a dip where the peak would normally be. Otherwise, yes, the current requirement of many switching power supplies and discharge lamp ballasts can be very non-linear. One non-obvious place this comes in is running lamp ballasts off the three legs of three-phase wye. Normally the neutral current should not exceed the largest of the leg currents, but that isn't the case with the third harmonic. -- glen
On 08/20/2010 11:13 AM, steveu wrote:
>> Hello. >> >> >> I am sampling the current and voltage simultaniously. Right now I am >> calculating reactive power in two ways: >> >> >> 1). delay the current samples by a quarter of a period and then >> multiplying: >> >> Q=i(n+pi/2)*u(n) >> >> >> 2). or using the following procedure: >> >> P=1/(num. samples)*sum( i(n)*u(n) ) -> active power >> >> S=Irms*Urms -> apparent power >> >> Q=sqrt(P^2 - Q^2) -> reactive power >> >> >> Unfortunatelly neither give me good results. Is there a nother way to >> compute reactive power? I can't use any complicated FFt algorithm as the >> processor isn't very browny. > > I presume browny == fast. If you are measuring something slow, I guess we > are talking about measuring mains power consumption. > > Both your equations are capable of high accuracy in the right > circumstances, but fall apart in the wrong ones. You will want to > accumulate your signals over a whole number of cycles for stable results. > If you don't, the long term average of your results will be fine, but > adjacent readings will jitter. > > Your first equation will only behave properly if the signal you delay is a > pure sine wave. If you delay a signal by 90 degree at the fundamental, it > will be delayed the wrong amount at all the harmonics. Typically a mains > voltage signal doesn't have a lot of harmonic content, but the current > signal does. That means this approach is an OKish approximation in most > cases. Note that the delay needs to be pretty accurate to ensure good > results across the power factor range. At 0.5PF, just a 0.1 degree phase > error will give you about 0.3% error in the power measurement. > > Your second equation requires both signals be pure sine waves.
(snip) Exactly how so? I would say that the second equation removes any such restriction at all, which is the exact opposite of what you're saying here. Real instantaneous power is, by definition, instantaneous current times instantaneous voltage. So if the OP is capturing current and voltage adequately* then averaging the instantaneous power would give average power quite handily -- regardless of waveforms. Similarly, apparent power is, by definition, RMS voltage times RMS current. Again assuming adequate capture of current and voltage, calculating RMS power is conceptually straightforward (with all due respect for the pitfalls). What's left is reactive power, and to my mind the only real barrier to defining it as what's left after you take real power away from apparent power is how one defines "reactive" -- but if you define it as "any power that swishes back and forth without doing anything real" then you're done. * And yes, that's a big "if", and subject to much interpretation depending on how the OP defines adequacy. But in a perfect world... -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
> > Similarly, apparent power is, by definition, RMS voltage times RMS > current. &#4294967295;Again assuming adequate capture of current and voltage, > calculating RMS power is conceptually straightforward (with all due > respect for the pitfalls). > >
RMS power???? I would call (in this context) RMS Volts x RMS Amps = average VA's or average apparent power Mark
On 08/20/2010 06:10 PM, Mark wrote:
> >> >> Similarly, apparent power is, by definition, RMS voltage times RMS >> current. Again assuming adequate capture of current and voltage, >> calculating RMS power is conceptually straightforward (with all due >> respect for the pitfalls). >> >> > > RMS power???? > > I would call (in this context) RMS Volts x RMS Amps = average VA's or > average apparent power
Now how did that slip out? "RMS equivalent power"? Apparent power is probably best, I shoulda stuck to it. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
Mark <makolber@yahoo.com> wrote:
(snip)

> RMS power????
RMS power exists, defined by the FTC, for audio power amplifiers. -- glen