LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder giving different count in opposite direction

I am using an E series DAQ board, BNC-2090 and a linear magnetic encoder. I am trying to count to measure diastance travelled. I am trying out the BNC 2120 Quadrature Encoder.vi just to test this out, and it works. I have channel A connected to PFI8 and Channel B connected to DIO6 for up and down. Here are my questions. This is working, but when I move 1 inch in 1 direction it gives me 220 clk counts. Move the same distance in the opposite direction and it gives me 110. Why could this be? I need to measure distance in both directions. Is there a better way to do this? I also looked up the information on NI.com concerning Quadrature Encoders with E-series DAQ boards. It talks about a vi in there called How to
Count. I can't find this vi anywhere. Any idea where I might find this? Thanks for any assistance.
0 Kudos
Message 1 of 4
(3,790 Views)
I tried to find that VI, How to Count.vi, and I am under the impression that it is for older versions of DAQ. I have 7.0 installed with DAQmx, and I was unable to find it in the Example Finder. However, I wouldn't worry too much about that; I believe the example was using Traditional DAQ, which is a little bit more complicated to configure for counter operations.
I was reviewing that example you mentioned. Maybe you are getting that count because of the way the code was done; that code is supposed to be used for the quad encoder that comes on the BNC-2120. Here's a KnowledgeBase that links to a couple of examples that should be useful:
Making a Position Measurement with an STC Board and NI-DAQmx
http://digital.ni.com/public.nsf/websearch/A34ACBA6904D619486256E5
C006E5618?OpenDocument
I hope this helps!

GValdes
Applications Engineer
0 Kudos
Message 2 of 4
(3,790 Views)
Working on upgrading to V7.1, but for now only 6.1 is available to me. It seems that the quad encoder works, just counting differently in opposite directions. I have it connected so that PFI8 is the clock and DIO6 is the up and down pin. Works pretty slick and I am now trying to break it down so I can tell when it is going in the different directions. Basically I have to figure out which phase the two signals are in which is giving me fits. I can't wait to get my hands on 7.1 so I can possibly make these tasks easier. Thanks for the links.
0 Kudos
Message 3 of 4
(3,790 Views)
I had the same problem. the reason for that is you didn't wire the digital ground of the encoder signal to the digital ground of the card. I had the same problem which was that the encoder reading at one side was half of the value on the other side.
Try this...
0 Kudos
Message 4 of 4
(3,790 Views)