LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count edges and quadrature encoder

I need to read a quadrature encoder on a motor. I have very little experience with this sort of thing. I have a PCI-MIO-16E-4 and a SCB-68. I have been tinkering around with the counter inputs and counting edges. any suggestions?
0 Kudos
Message 1 of 27
(5,135 Views)
i have been playing around with the "Count Digital Events.vi" and trying to use the externally controlled count direction but no matter which way i turn the encoder, it always counts up. it nevers counts down.
0 Kudos
Message 2 of 27
(5,117 Views)
I think that the following should help here

Its "Using Quadrature Encoders with E Series DAQ Boards"
http://zone.ni.com/devzone%5Cconceptd.nsf/webmain/6F25CBA2CD73417786256869005E5FC3?opendocument
0 Kudos
Message 3 of 27
(5,112 Views)
i have read this document a few times and it doesnt help me with my problem as to why my count wont go down when i rotate the encoder the other way. i think i might also need some sort of filter between the encoder and the DAQ board, as I am getting some pretty irregular numbers in my count.
0 Kudos
Message 4 of 27
(5,108 Views)
You should be able to test the system without the second encoder channel by setting the states of the direction manually.

You could hard wire the GP_UP_DOWN pin in each state and then rotate the encoder, it should then count in one direction. Reversing the state on the GP_UP_DOWN should then cause the count in the reverse direction.

I tested this out using the COUNT DIGITAL EVENTS.VI using a quadrature encoder with phase A connected to counter 0 and phase B connected to DIO6 which is the UP/DOWN line for counter 0. Make sure the counter is set for EXTERNALLY CONTROLLED Count Direction.

Hope this helps
Labview 7.1 hardware 6052 I/O card 5V encoder.
0 Kudos
Message 5 of 27
(5,100 Views)

A thought occured to me about the encoder ouput circuit.

Is it possible that the encoder is configured for a differntial line output drive (RS422 style)?  This could make it difficult to connect to the inputs on the DAQ card. Quite often you need to either build or buy a convertor to get a TTL signal suitable for a counter circuit such as found on the DAQ card. The interface chip is not expensive but it needs a bit of engineering into place to work well.

So I guess the question is..... what type of encoder is it, perhaps you have a data sheet on it that will tell you?

0 Kudos
Message 6 of 27
(5,092 Views)
Something odd happened. I left the setup powered up over the last day and a half. I ran the Count Digital Events.vi again and left my setup exactly as it was and now it works. I will have to see if I experience this problem again. It may be an encoder issue. We have had plenty of encoders go bad on us.
0 Kudos
Message 7 of 27
(5,083 Views)
Would you care to indicate the type of encoder, manufacturer, interface type etc.

Glad it worked for you, but I really hate stuff that works intermittently, that's the rare occasion when I start throwing things (normally in the dustbin).
Message 8 of 27
(5,080 Views)
I am using an encoder from US Digital. The model number is E2-400-250-IHT.
I am using a PCI-MIO-16E-4 and SCB-68 for my data aquisition. I am also trying to sample and Analog Input with a loadcell and realized my DAQ card wasnt seated all the way into my computer's motherboard. I adjusted the card and now I can get data from my loadcell but my encoder is back to only counting upward....very frustrating.
0 Kudos
Message 9 of 27
(5,076 Views)
I wonder if I can't do these two things in the same program.
0 Kudos
Message 10 of 27
(5,076 Views)