PDA

View Full Version : mouse guts as a dual rotary encoders



hinv
01-15-2009, 10:54 PM
Howdy,

Has anybody tried to use the rotary encoders out of a cheap mouse to monitor speed/position/direction of a motor?
Anybody know what the limitations are?

The cool thing is it is easy to interface, in fact there is already a plug on my demo board http://forums.parallax.com/images/smilies/burger.gif
My guess though is that the serial interface in the mouse will limit the RPMs that can be read.

Any thoughts?

Doug

JoeBotics
01-15-2009, 11:14 PM
Hey Hinv... sure, I have done it and it is fairly simple, please look here:

http://forums.parallax.com/forums/default.aspx?f=10&m=201078&p=1&ord=a

This one also has information about the Controller IC on those old mice:

http://forums.parallax.com/forums/default.aspx?f=25&m=159746&p=1&ord=d


I hope this helps.. Happy Roboting!... JoeBotics

hinv
01-16-2009, 07:48 AM
Thanks, that hits the spot!

How many RPMs were you able to measure? Did you use the encoder wheel from the mouse, or make your own?

sylvie369
01-16-2009, 08:08 AM
Thanks for posting this. I went down to the old hardware dungeon at work and scored a half dozen old mechanical mice (HP, Microsoft, Logitech), took 'em apart and found the small treasure troves of buttons and encoders. It should be pretty straightforward to repurpose them.

Mark Swann
01-16-2009, 08:13 AM
Mouse guts? http://forums.parallax.com/images/smilies/shocked.gif·
I'm sorry, but I just can't get past that image in my mind of all those mice that we sacrifice·in the name of·progress.

Oldbitcollector (Jeff)
01-16-2009, 08:23 AM
From the "been there, done that" file..

In order to score a large contract with a school system for computers, I once had to locate replacement mouse balls to replace the ones the kids were stealing. It gets worse.. I had to call mouse manufacturers' to purchase 50 mouse balls.

Mouse encoders are a great idea! Cheap and readily available.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Check out: Protoboard Introduction (http://jeffledger.googlepages.com/Protoboard_Introduction.pdf) , Propeller Cookbook 1.4 (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf) & Software Index (http://forums.parallax.com/showthread.php?p=770318)
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us (http://propeller.warrantyvoid.us)
Got an SD card connected? - PropDOS (http://www.orrtech.net/propdos/)

Mark Swann
01-16-2009, 08:31 AM
Oldbitcollector said...
From the "been there, done that" file..

In order to score a large contract with a school system for computers, I once had to locate replacement mouse balls to replace the ones the kids were stealing. It gets worse.. I had to call mouse manufacturers' to purchase 50 mouse balls.

Mouse encoders are a great idea! Cheap and readily available.


Didn't you know that the kids only did that to the mice so they could hear their little voices change to a higher pitch?

JoeBotics
01-17-2009, 02:48 AM
Hey Doug, here is an excerpt of my calculations for RPM measurement using the mouse.spin: "the mouse IC controller actually buffers the count of the pulses, so, at 8 bits per encoder, that means it can count 255 pulses before the information is read by, let's say mouse.spin, otherwise it overflows the counter and generates an overflow error, I saw that the mouse.spin objects states that it samples the readings at 200 samples per second, so that would be around 255 x 200 = 51000 pulses per minute maximum, I am probably wrong on this estimate, but I am certain this idea can still count a whole lot of pulses per second without missing pulses.."

in reference to the encoder wheel, I have tried printing my own version using transparencies and the original encoder wheel, but the original encoder wheel is tricky depending on where you are going to attach it, it cannot wobble much or deviate from the center, the IR receiver assembly has little room for error, I prefer the transparency option, but the issue is that it is difficult to obtain a dark printout on laser, you should try ink jet printer instead, I am trying to find one and test printing on it. I will let you know... as to how to generate them:

http://www.softpedia.com/get/Others/Miscellaneous/Codewheel-Generator.shtml

http://www.bushytails.net/~randyg/encoder/encoderwheel.html

I hope this helps... Happy Roboting!!.. JoeBotics

evanh
01-17-2009, 08:07 PM
If you are wanting fast response and/or high update rate then ditching the poorly performing mouse ICs and reading the quadratures directly with the Prop is easy enough to do. There is even a flexible driver sitting in the Obex - Quadrature Encoder (http://obex.parallax.com/objects/24/).