LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase difference calculation

Hi All
 
How to calculate Phase shift between two square waves (without using express VIs)
 
Regards
J
0 Kudos
Message 1 of 11
(5,592 Views)
Simply find the difference between the phases of the 2 Sq waves, thats it. Smiley Wink
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 2 of 11
(5,584 Views)
Thanks for reply...
 
I have tried with using Dual Channel Spectral Measurement.VI . But I am not getting the correct phase shift.
Is there any method to calculate the phase difference between two square waves without using the express VIs.
 
Regards
J
0 Kudos
Message 3 of 11
(5,577 Views)
See the attached VI, if this is what you need. It is in LV 7.1.
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 4 of 11
(5,572 Views)
Hi
 
In my application, i have to read the quadrature encoder output. that will be two square waves with 90 Degree phase shift. i am able to read the quadrature encoder output and also count the pulses. But i am not able to read or calculate the phase shift between the two quadrature encoder outputs.
 
Regards
J
0 Kudos
Message 5 of 11
(5,542 Views)
If the encoder rotational speed changes fast enough that the period varies measurably from one pulse to the next, it can be quite tricky to get the phase angle. You would need to wait until the pulse is complete to determine the period and the fraction represented by the other channel.

Encoder phase angles are fixed by the construction of the device and cannot change during operation. Are you doing a manufacturing inspection type of measurement? If so, I would spin the device at a fixed speed and measure the time of each transition. Then calculate the phase angles from that.

Lynn
0 Kudos
Message 6 of 11
(5,525 Views)
Hi,
In Theory you should be a able to compare the data array against a threshold constant (Say >=1V) and take note of the time when a positive crossing occurs for both signal A and Signal B.  The difference between these values in time as a percentage of the period would be phase.
How to implement in realtime? Not sure, depends how quick your acquisition is, might be able to put it inside you acquisition loop?
Craig
LabVIEW 2012
0 Kudos
Message 7 of 11
(5,521 Views)

Hi J,

Take a look at this document and see if this works for you.  For calculating the phase shift between square waves, you will need to use the Pulse Measurements VI.

Regards,

Clint M

Message 8 of 11
(5,510 Views)

Hi Clint

I am not able to open the attached Phase Diff.vi . Please attach it again.

regards

J

0 Kudos
Message 9 of 11
(5,495 Views)

Clint,

I tried to download the VI from the link you provided, but it failed.

Can you upload that Phase Diff.vi here ?

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 10 of 11
(5,493 Views)