LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

phase measurement

Hi All
 
How to measure quadrature encoder phase using counters.
 
In my application, I have to measure the phase difference between the quadrature encoder outputs.
 
Regards
J
0 Kudos
Message 1 of 6
(3,341 Views)

Hey J,

It would be very helpfull to know which hardware you are using.

However, you can take a constant pulsed signal (e.g. internal timebase) for both counters as source signal. Then you configure both counters for buffered edge counting and use the two lines of the quadrature encoder als trigger signals. So every time you getting an edge of your quadratur endcoder you get the value of pulses from the source signal. So you can calculate the phase shift beetween this signals out of the counted edges between both counters.

Hope this helps, Christian

0 Kudos
Message 2 of 6
(3,333 Views)
Hi Christian
 
Thanxs for the quick reply
 
I am using PCI 6221 card. I shall be very thankfull if you send an example or a document on phase measurement.
 
Regards
0 Kudos
Message 3 of 6
(3,328 Views)

Hey J,

Just look for the "Count Digital Events - Pause Trigger example".

There you can use as source signal for the counter the internal 20MHz timebase and the signal from your quadrature encoder to trigger the counting. So e.g. every time the trigger is high the counter value increases.

BR, Christian

0 Kudos
Message 4 of 6
(3,316 Views)
Duplicate post.

Poster: Please keep the same discussion to the same thread. Creating multiple threads makes people suggest the same things if they don't know you've already asked the question, and have already received numerous answers.
0 Kudos
Message 5 of 6
(3,308 Views)

Hello J,

Thanks for contacting National Instruments.

As Clint mentioned in your other post, the easiest option would be to use the pulse measurement VIs referenced in this knowledge base.  This option has the encoder pulses read in as analog inputs and the pulse measurement VIs are used to determine phase separation. 

Another option would be to use a two edge two signal separation measurement with a counter task.  This type of task uses a triggering and a counter to find the number of ticks of a specified timebase between the specified edges of two different signals.  Page 7-18 of the M Series DAQ Manual shows a timing diagram of this type of measurement. 

This task can be created in Measurement and Automation Explorer by creating a new DAQmx Task and then choosing two edge separation under counter input.  The configuration window indicates required PFI lines that the encoder signals should be connected to and also allows you to set the edge type for both signals.  The Meas Two Edge Separation-Buffered-Continuous in the example finder for LabVIEW will acquire edge separation data continuously.  This will give you the amount of time between encoder output pulses.  From there you can use the encoder frequency to determine the phase delay between encoder outputs. 

Please post back if you have any further questions.

Regards,
Browning G
FlexRIO R&D
0 Kudos
Message 6 of 6
(3,283 Views)