05-21-2009 04:35 PM
Hi,
I am using a Labview VI to control an array of servo motors, each receiving a sine wave input (with different phase offsets for each servo). I'm using a NI USB-6229 DAQ system to monitor their movement via a wire that I've soldered onto each servo's potentiometer. I've written another VI that recieves both the initial sent signal and the returned DAQ signal and plots both on a waveform chart. Both signals show up on the plot as expected, with an obvious phase shift between them. I'm having problems accurately measuring the phase shift, and I'd rather have an automatic method that gives accurate numerical values instead of a more qualitative visual method.
So far I've tried to use triggers and peak to peak comparisons, but I've been having problems getting results in real time. My incoming signals are time stamped, if that helps. Is there a quick and easy method to extract phase shift data from two sine waves on a waveform chart?
Thanks for the help...
05-21-2009 04:58 PM
This might do the trick. Especially if you know the frequency.
Do an FFT of both signals and get the phase values at the frequency of interest. Subtract them.
It may get a bit tricky above 180 degrees, but that's easy to take care of. IIRC, you can unwrap the phase on some of the FFT fns, but I may be confusing it with MatLab. Come to think of it, I'm sure you can unwrap the phase in LabVIEW and that probably is the best way to go.
If you don't know the frequency, use the FFT to find the max magnitude and figure out the frequency from that.
How's that sound?
05-22-2009 05:12 AM