Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How should I count the movement of linear scale(glass scale)?

My DAQcard is PCI-6024E with two 24-bit counter/timer channels.I try to measure the bidirected movements of linear scale but I can only count the single direction and the reverse can't be measured.The counts would always be increased while I moved the detect header casually and could't be decreased on the reverse direction.So somebody could tell me how to connect the actual external layout (PA,PB,PZ) and Vi program?
0 Kudos
Message 1 of 2
(3,283 Views)
Hi,

You will need to have two scales to detect direction of motion. If there is only one set of pulses (marks) then there is nothing by which the DAQ card can distinguish one direction from another.

If you refer to the link below for the 6602 Counter/Timer card, there is a description of quadrature position measurement on page 3-18. It describe the ways you can detect direction using 2 scales that are 90 degrees apart with 50% duty cycle. THe principles are similar to your application.

http://www.ni.com/pdf/manuals/322137a.pdf

If you have two scales keyed together and they are displaced so that one scale is half way between the marks of the other, then you may be able to use the Quadrature Measure Position VI's that ship with La
bVIEW. The essence of direction detection is to see if the rise of the B signal leads or lags the rise of the A signal.

BTW- "quadrature" refers to this geometric relationship, at least on a rotating scale (rotary encoder). For quadrature encoding/decoding, the A and B scalses are 90 degrees apart as the encoder rotates.

With rotary encoders the signals have a 50% duty cycle. So you would get the following sequence:

A rises, B rises, A falls, B falls, A rises....

Your signals may not have this duty cycle but you can still detect whether B leads or lags A. Your sequence might be:

A rises, A falls, B rises, B falls, A rises....

But you can still tell that direction has changed. Just don't ask me exactly how to do this.

I am curious - are you using LED optical sensors to read the marks of the glass scale?

Mike
0 Kudos
Message 2 of 2
(3,283 Views)