LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase difference from 2 signals(HELP!)

I see.. What can I do to read the full period? The input signal is a continuous sine wave and I aligned both the signal and then minus the phase to find the phase difference.

The phase keeps changing making the phase difference to change too.

0 Kudos
Message 11 of 29
(2,488 Views)

Sorry, they are both different frequency. If I change the frequency of the simulated signal to be the same, the phase will still change. What should I do? 

I want to make sure the phase difference is working so when I implement another input signal for voltage, I can find a definite phase difference between the voltage and current signal.

How do I solve this?

0 Kudos
Message 12 of 29
(2,455 Views)

I've tried removing the align 2 signals continuous function and just using the single tone measurement for each signal to find the phase then minus to find the phase difference, with one frequency 50hz and the other 43hz, the phase and phase difference value stayed and did not change. Is it supposed to be like this? Do I have to include the alignment of 2 signals and must the frequency be the same? Sorry, I'm still new and unclear about this.

0 Kudos
Message 13 of 29
(2,414 Views)

Hi lamela,

 

Is it supposed to be like this?

Usually you compare phases of two signal with same frequency…

 

What about attaching the current state of your VI with some meaningful data set to default?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 29
(2,407 Views)

Here is it! My AC power supply is 50-60hz but I'm getting 16hz from the input signal in labview?

0 Kudos
Message 15 of 29
(2,384 Views)

Hi lamela,

 

what's the point of this VI?

 

- You compare a sine wave consisting of 100 samples with a signal, where you get one (1) sample per iteration. What exactly do you want to compare?

- This one sample is read with max. 20Hz sample rate due to your time delay. Nyquist says: you can detect frequencies up to 10Hz with such a signal. What's the expected frequency of your signal to be measured?

Have you had any lessons on "how to do measurements" at all?

 

On your VI:

- After all those threads you still aren't able to upload VIs with atleast a little attempt to clean them up…

- All those datatype conversion in your VI look awful…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 29
(2,320 Views)

Thanks! I think there is still much for me to learn!

The delay will affect the frequency? If I use another input signal and I compare both the signals, will it work? Because ultimately I'll compare both the input signals to find the phase difference. 

The frequency should be 50hz.. How can I fix it?

0 Kudos
Message 17 of 29
(2,274 Views)
You have much to learn. The sample rate is set by your sketch for the arduino. How often you read the serial is not related to the frequency of this captured signal. You just have to read the serial faster than the arduino transmits. You must use the sample rate from the arduino to set the dt of the captured sine wave. To ignore this will result in a default dt of 1 second and the frequency calculations will be incorrect. Converting to dynamic data is pointless without being aware of what that means.
Message 18 of 29
(2,261 Views)

Doing phase difference measurements using two completely separate sets of hardware is in general a bad idea. You need to think carefully about how to synchronize the acquisition clocks of the computer vs. the Arduino. Better would be to measure your signal and generate your reference using one system, i.e. every time through the Arduino's outer loop, have it measure the voltage and also generate a reference level based on the internal clock, and transfer both to the computer.

 

That said, unless you know the signal frequency very precisely a priori, the phase difference between a synthetic reference and a measured signal will inevitably drift with time, at a rate proportional to the difference between the nominal and actual frequencies of the sample signal. 

0 Kudos
Message 19 of 29
(2,251 Views)

I'm now using two analog input signals for current & voltage and the phase is still changing? Since it is a resistive load, I should be getting around 0 phase difference and it should be in phase?

I don't think there is anything wrong with the signal but how do I get a definite value for the phase difference? The phase is sometimes changing between the positive and negative. What should I do?

Download All
0 Kudos
Message 20 of 29
(2,204 Views)