Pages: [1]   Go Down
Author Topic: multiplexing 2-channel quadrature encoder together into 1 channel?  (Read 886 times)
0 Members and 1 Guest are viewing this topic.
Dallas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 337
nephew as a kittens
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since I do not care about motor direction, I want to multiplex  both channels of my quadrature encoder together so that I get 1 channel of double/total resolution. This is because I only want to use one interrupt pin on my microcontroller, and not have to use two interrupt pins to get max resolution. Any tips on what kind of hardware I could use to do this?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If it's a mechanical encoder, then I don't recommend that, because the quadrature format provides an easy way to eliminate the effects of contact bounce. If it's an optical encoder, then you need to pass the two signals into the inputs of an exclusive OR gate (e.g. 74HC86) and connect the output of that gate to the Arduino pin.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Dallas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 337
nephew as a kittens
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's a hall effect encoder, actually.

I didn't realize it would be as simple as a XOR gate; thanks.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 222
Posts: 13857
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


It could be that the delta t between the pulses will not have a 50% duty cycle anymore if you combine the signals. Depends on the distance between sensors.
Just for counting this is no problem, just be aware of it.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tieing but encoder signals together will give you no more information that using just one of the signals. Because of the nature of a quadrature signal you would wind up with a 25/75% duty cycle signal (00,10,11,01) which would not improve on the nice 50% duty cycle of 1 signal.
Logged

Pages: [1]   Go Up
Jump to: