Problems reading digital encoder
danielreis
Posts: 16
Hello guys,
I'm with a problem to read a digital contacting encoder.
It's an incremental encoder, with quadrature output.
I tried to use some codes, including the one that Chris posted here: http://forums.parallax.com/showthread.php?p=893416
But all codes I tried didn't work.
I don't have any other idea to make it works, can anybody help me?
Bye,
Daniel
I'm with a problem to read a digital contacting encoder.
It's an incremental encoder, with quadrature output.
I tried to use some codes, including the one that Chris posted here: http://forums.parallax.com/showthread.php?p=893416
But all codes I tried didn't work.
I don't have any other idea to make it works, can anybody help me?
Bye,
Daniel
Comments
Is encoder itself working? - check with voltmeter while turning the shaft VERY slowly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Can you please describe the encoder in more detail, and also what you mean by "didn't work". First check the hardware, to be sure each channel, "A" and "B" are outputting full 0 to 5 Volt swings. Maybe it needs a pullup resistor? Also that it puts out the expected pattern of 0 and 1 by running the following simple program and observing the pattern on the debug screen. It should be something like...
00
01
11
10
00....
and so on, running either forward or backward.
See also www.emesystems.com/BS2fsm.htm#twobit
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 5/5/2010 4:17:05 PM GMT
I had already tried the code that it's in your website, about the two-bit quadrature encoder, but without success.
I tested the code you just posted, but the sequence that appears at debug screen doesn't make any sense.
The result on the screen change without rotating the encoder, and when I rotate the encoder, the result doesn't change.
I also tried using the pull-up resistor 10k to 5V in channel "A" and "B", but doesn't work too.
The encoder I'm using is ECW1J-B24-BC0024L
We use that encoder in another product and it works normally, but I tested with the voltimeter while shafting and it didin't present any output.
I will attach the encoder datasheet.