From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase angle and other power measurements using zero crossing?

I forgot to ask, how do I normalize two waveforms so they have the same amplitude? (My signals will not have the same amplitude).

 

Jeff

0 Kudos
Message 11 of 40
(3,138 Views)
Find the peak value of each and divide by that number.  They should be normalized to a peak value of 1 at that point.

Are you filtering your data at all? 

What version of LV are you using?

Message Edited by rpursley8 on 03-08-2006 02:30 PM

Randall Pursley
0 Kudos
Message 12 of 40
(3,134 Views)
Thanks for the response Randall.
At this point I'm not filtering anything. I'm reading two channels from the FPGA FIFO of a cRIO using Labiew 8 and the DMA feature.
These two channels will come from signal transducers and so will have to be rescaled to represent some usable values. (120VAC and AMPS AC).
 
I do appreciate the help you've given me so far.
 
My overall goal in all this is to build a simple power analyzer so we don't have to buy one. Since we'll be using the cRIO anyway for other test functions and control, I figured we might as well use it to provide such things as power factor, phase angle, volts rms and amps rms rather than buy an instrument.
 
 
Jeff
0 Kudos
Message 13 of 40
(3,131 Views)


@rpursley8 wrote:
   
Essentially a Hilbert transform in the frequency domain is performed by changing the sign of the negative frequency components.  All cosines become sines and all sines become cosines.  I use this to convert one of the sine signal to a cosine signal and then use the trig identities to get the result in the for cos (w) +jsin(w) where w=the phase difference between the two signals.



~~~ Currently mass compiling to version 8.0.1, hour 3

Message Edited by rpursley8 on 03-08-2006 01:12 PM


So that is why my first attempt wouldn't work.  I was using arcsine and should have been using arccosine.  Thanx a bunch Randall.


 

- tbob

Inventor of the WORM Global
0 Kudos
Message 14 of 40
(3,132 Views)

I found this vi in my library.  I think Randall was the originator.  It uses a slightly different method for finding phase differences.  Correct me if I'm wrong Randall, but it looks like it uses the Hilbert Transform to shift the reference signal by 90 degress (like I and Q modulation).  Then it multiplies the input signal by the unshifted reference to get the real part (I), and multiplies the input by the shifted reference to get the imaginary part (Q).  The phase angle is then extracted from the x+jy signal and converted from radians to degrees.

What I don't understand is why do you multiply the DC component by 2?

- tbob

Inventor of the WORM Global
0 Kudos
Message 15 of 40
(3,123 Views)

Great thread everyone.

Boy now I have many options.

I also did not understand the multiply by 2 but I'm sure you have a reason.

Also, what is the icon or vi that's in the middle, right after the waves are multiplied together?

 

Jeff

0 Kudos
Message 16 of 40
(3,124 Views)
That icon is called Re/Im to Complex.  It converts rectangular scalar coordinates (Real and Imaginary components) into a complex number of the form x+jy.  Did you know that j is equal to the square root of -1?  Since there is no square root of negative numbers, that part is called an imaginary number (hence the Im part of Re/Im, Re stands for real).  Whoever came up with the square root of -1 must not have had any kind of social life.  Somehow it works and is widely used in describing signals.  Maybe Randall can shed more light on j.  Also, sometimes it is called i instead of j.
In case you are wondering, the next icon is a Complex to Polar conversion.  It takes a complex number (x+jy) and converts it into two numbers, the first representing the signal amplitude, and the second representing the signal phase angle.
So by multiplying two out of phase signals (same freq), you create one signal whose phase angle is equal to the difference between the two input signals phase angles.
- tbob

Inventor of the WORM Global
0 Kudos
Message 17 of 40
(3,115 Views)
Actually I was talking about the symbol on the first jpeg that Randall posted.
Yes I know what complex numbers are 🙂
 
I was going to try Randalls first option (Phase Measure.jpg), then if I can't get that to work I'll try the VI you just posted.
 
 
Jeff
0 Kudos
Message 18 of 40
(3,115 Views)
Sorry, that icon is the AC/DC Estimator.  It takes a signal and separates it into an AC component and a DC component.  The outputs are the amplitudes of the AC part and the level (volatge) of the DC part, which is like a DC offset.
- tbob

Inventor of the WORM Global
0 Kudos
Message 19 of 40
(3,112 Views)

Thanks my icon is totally different lol.

But this seems to work just fine. I will test it with some "noisier" signals to see how it works but my guess is that this is a better method than what I was doing with the zero crossing thing.

 

Thanks again for all the help!

Jeff

0 Kudos
Message 20 of 40
(3,109 Views)