First of all, I would like to start by
apologizing for my casual use of language, I always thought language
was just a tool of communication but if the way I am using it is
offending somebody then I am really sorry for that.
Anyway, I am reframing the problem I am facing.
Basically I am set out to build a power analyzer,
which will include :-
-1 phase supply monitoring-
-Surge detection capabilities of the order of 10 microseconds
-Data logging at configurable intervals
-Current harmonics distortion calculation
-Measurement of parameters -True rms I & V, KVA, KVAR , cos(phi)
I need to find out how to measure the power factor
from the AC mains supply using a DSP microntroller and MATLAB for
demonstration purpose. So far I have reached a stage where I can
acquire data using a conditioning circuit which includes a CT and a PT,
followed by Instru. Amp. I tried looking for algorithms for measurement
of these factors over the internet but didn't get any threads on the PF
front.
I would be really grateful if somebody could help
me out with this.
Thanking you in anticipation.
Chetan.
If you periodically, simultaneously digitize the instantaneous voltage
and current (or nab them sequentially closely in time, 10's of
microseconds apart) and scale each into a signed integer or float, you
can multiply sample pairs to get instantaneous power points. If you
average or lowpass filter these, you get true, signed power in watts.
If you then separately compute the RMS voltage and the RMS current,
and multiply them, the result is apparent power, in volt-amps. Power
factor is then just true power divided by apparent power. Note that we
lost the leading/lagging phase information here, so we know the pf but
not whether it's in the capacitive or in the inductive sense.
(To get RMS volts, just square the voltage samples, average a bunch of
them, and square root the average. Ditto current.)
A more fun way to do this is to do real power like in paragraph 1, and
compute imaginary power by phase-shifting the voltage waveform 90
degrees before multiplying by the current samples. So we get signed
real power and signed imaginary power, and we can compute the true
phase angle vector, hence lead/lag power factor. The 90 degree shift
can be done in a DSP or FPGA as a Hilbert transform, as an IIR allpass
network simulation, or you could be really tacky and just use an
integrator.
All that's basic. What's interesting is implementing it with any sort
of accuracy. Doing this the most obvious way will tend to be mediocre.
Getting as good as a $20 mechanical electric meter is hard work.
The 10 usec transient thing is another issue, as is harmonics.
John