LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase angle and other power measurements using zero crossing?

I realize this is drifting off topic but can someone point me to (or give a brief explanation of) what we're doing to the waveforms in the first example.
 
The procedure I see is as follows:
 
1) Normalize each set of data. I'm guessing this is done to make the next equations correct, but I'm not real clear as to why.
2) Multiply the waveforms. What does this actually do in terms of the two waveforms? What is the result?
3) Take the DC value of the result. What "value" do I end up with here? What is it's significance?
3) Multiply that result by 2.  Why is this done?
 
Before taking the arccosine, am I correct to assume that the above procedure would give me power factor (Which is the cosine of the angle) ?
 
Sorry for my ignorance. I realize I need to brush up on my math. 😞
 
I now have two techniques. Since I'll be using this for calculating phase angle of some measured circuits I will need to prove to my boss that this is correct. From what I've done so far, using my original "zero crossing" method works ok but numbers start jumping around as I decrease my window size (less than 2 cycles).

The second method (from the first example of Randalls) seems to work really well. I just want to understand it better.
 
I would try the third method, I just don't know if it's necessary. Using labview icons, is there a way to compare resolution or accuracy as compared to an instrument?
 
Sorry for so many questions.
 
Jeff
0 Kudos
Message 21 of 40
(3,205 Views)
This is based on the two trig identities where a and b are time varying signals.  These equations only work if the two signals are normalized (have the same amplitude).

sin(a)sin(b) = 0.5*cos(a-b) - 0.5*cos(a+b)
sin(a)cos(b) = 0.5*sin(a-b) + 0.5*sin(a+b)

We need the Hilbert transform the derive cos(b) from sin(b).

In this case a = b+phi where phi is a constant phase shift.  So the equations become

sin(b+phi)sin(b) = 0.5*cos(phi) - 0.5*cos(2b+phi)
sin(b+phi)cos(b) = 0.5*sin(phi) + 0.5*sin(2b+phi)

The first term is a DC term, since phi is a constant phase shift, and the second term is an AC term, at twice the frequency you started with so you can use the AC/DC function to pull out the DC term

So then you find the phase, phi,  which is essentially arctan(sin(phi)/cos(phi)).  I think you are correct that cos(phi) should be the power factor.

Obviously the multiply by two is not needed for the final result, but when I originally started that function I was making sure it worked by comparing it to the above identities and I forgot to leave them out in the final vi.

Message Edited by rpursley8 on 03-09-2006 09:09 AM

Randall Pursley
Message 22 of 40
(3,211 Views)
Jeff,

Randall is correct.

Use some caution with your SCR derived waveforms. As the voltage will no longer be sinusoidal and the current waveform may be different from the voltage waveform, the definitions of relative phase and power factor get complicated. There is a body of literature on this subject and different authors use different definitions, sometimes driven by the practical limitation of their measurement systems. Recall that the non-sinusoidal waveforms have harmonic content at frequencies well above the fundamental line frequency. Any frequency components above the Nyquist freqeuncy must be filtered out before digitizing and the removed information will have an effect on the accuracy of your measurement.

Lynn
Message 23 of 40
(3,199 Views)

Thanks again for all of the responses. Now things seem a little more clear.

If my signals are not pure sine waves (as Lynn indicated with a speed control Triac or similar), would this make that calculation invalid?
I can see my waveforms possibly having some harmonics.
What if I digitally (with Labview) both waveforms at around 100HZ or something like this? Would that solve the problem?

I'm only interested in the phase angle and rms values.

0 Kudos
Message 24 of 40
(3,193 Views)

Like Lynn said, use a low pass filter to filter out the harmonics.  If you are looking at AC signals (60Hz), set the cutoff frequency to something between the fundamental (60) and the second harmonic (120).  After filtering higher frequencies, the signal should be closer to a sine wave.  If there is noise at lower frequencies, you may have to filter those out too with a high pass filter.  I don't know if there is a bandpass function in Labview, but a low pass filter output going thru a high pass filter will achieve the same effect.

- tbob

Inventor of the WORM Global
0 Kudos
Message 25 of 40
(3,184 Views)
Jeff,

With a traic or SCR phase control the turn on time is delayed. Thus you do not have a well defined zero crossing to detect. See the attached Traic.vi for a typical waveform. With an inductive load the current will ramp up slowly at the voltage turn on, so it is not easy to use the vertical edge as a reference either. It is also difficult to measure the phase shift. Perhaps you could fit a sine wave to the non-zero portion of the waveform and calculate the phase shift from that, but it would be a messy calculation.

Your 10000 samples per second rate will include harmonics up to the 83rd so your should be OK. The AC/DC Estimator returns the rms value of the input.

Lynn
0 Kudos
Message 26 of 40
(3,185 Views)
Another way that might work is to take an FFT of each waveform and then find the phase for the point in each waveform that corresponds to 60 Hz (if that is the frequency of interest).  Take the difference between the two measurments and you will have it (phi).
Randall Pursley
0 Kudos
Message 27 of 40
(3,179 Views)

Wow thanks again for the great answers! I'm learning alot!
Yes Lynn, I see now that zero crossing is a bad idea. That was a nice VI by the way.

I had an interesting afternoon, calling a couple of well known power analyzer manufacturers and I got two different answers on how to measure power factor.

Bob, I will put a low pass filter in and try that. I worry that the more VIs or functions I add, the slower the code gets and thus it can't keep up with the FIFO from the FPGA.

Just out of curiosity, do you think this application couuld be done completely on the FPGA?

 

Jeff

0 Kudos
Message 28 of 40
(3,178 Views)
Jeff,

Here are some references to recent publications in the field.

All were published in the IEEE Transactions on Instrumentation and Measurement.
"Reactive Power Measurement Using the Wavelet Transform," W.-K. Yoon and M. J. Devaney, April 2000
"Average Power Estimation under Nonsinusoidal Conditions," P. Carbone and D. Petri, April 2000
DSP Implementation of Power Measurements According to the IEEE Trial-Use Standard 1459," C. Gherasim, J. Van den Keybus, J. Driesen, and R. Belmans, August 2004
"An Algorithm for Accurately Estimating the Harmonic Magnitudes and Phase shifts of Periodic Signals with Asynchronous Sampling," G. A. Kyriazis and M. L. R. de Campos, April 2005

Lynn
0 Kudos
Message 29 of 40
(3,168 Views)

Thanks again for all the input. After looking things over again, I've decided to use the "extract single tone" function.It appears to clean everything up and works nicely. That same function gives me frequency and phase. Again, I haven't yet tested this on a "noisy" signal. This is my next step.

The strange thing is I don't understand how labview sees frequency. For example, the frequency reported is .006 when I sample at 100 uS. (If I divide .006 by .0001 I get 60 HZ). I just don't understand what they're doing. Also, when using a digital filter, it's as if they're using the term "frequency" inversely. The default high cutoff frequency is .125. This makes no sense to me.

My plan is to start the FPGA FIFO on two channels, read the voltage and amps in 20 ms chunks. I will do five of these reads and have 5 rms, phase, etc.. values. I'll then average them and report an  average of these values over 100 ms. (Of course I could also just sample over 100 ms but I want to show that we can also see the peaks of every cycle).

 

Anyway, I've joined IEEE and I'm going to do some more research. This has been a fun adventure for me. I'm learning alot and I appreciate the help you all have given me!

 

Jeff

0 Kudos
Message 30 of 40
(3,154 Views)