Welcome! Log In Create A New Profile

Advanced

Cheapo mouse as shaft encoder

Posted by ErikDeBruijn 
Re: Cheapo mouse as shaft encoder
July 18, 2008 05:24PM
Yeah, I bought some Schmitt triggers to do just that, as the logic is all in one chip, straight from the photodetectors to PS2. I have a Happ trackball from an arcade game that has separate buffer circuits, but I like using it too much to sacrifice it on the Reprap altar. Might be able to wire the quadrature straight to the Arduino too, let the software debounce it.

I'll use Zach's magnetic boards as soon as they arrive, but I just wanted something to mess with in the meantime.
Re: Cheapo mouse as shaft encoder
July 18, 2008 05:59PM
You shouldn't have much in the way of bounce if at all.

Bounce is usually a feature of mechanical switches.

If you take the logical and of your A & B data stream (Schmitt or op amp conditioning is good) and sample the B stream on the or preferably very shortly after the falling (trailing edge) you can then use the value of the B stream to indicate direction ie 1 = one way, 0 = the other and the pulse you used for the sample is your clock.

similarly you can do the same trick with the not or inverse of A OR B and sample the falling (Trailing edge) of A to get the same.

If you add both techniques together you actually get twice the resolution of using just one or the other.

Sketch the waveforms out on paper and you will see what I mean.

Where you have microcontroler ports that will generate interrupts on a change the whole thing is very easy to implement in microcontroler code once you use the above techniques and uses very few components.

AKA47


Necessity hopefully becomes the absentee parent of successfully invented children.
Re: Cheapo mouse as shaft encoder
July 19, 2008 05:00AM
Wade:

put the quadrature encoder on the motor shaft, rather than the output of the gearbox and see how you go
Sorry, only registered users may post in this forum.

Click here to login