Shop OBEX P1 Docs P2 Docs Learn Events
mouse guts as a dual rotary encoders — Parallax Forums

mouse guts as a dual rotary encoders

hinvhinv Posts: 1,255
edited 2009-01-17 12:07 in Propeller 1
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 burger.gif
My guess though is that the serial interface in the mouse will limit the RPMs that can be read.

Any thoughts?

Doug

Comments

  • JoeBoticsJoeBotics Posts: 17
    edited 2009-01-15 15:14
    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
  • hinvhinv Posts: 1,255
    edited 2009-01-15 23:48
    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?
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-01-16 00:08
    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 SwannMark Swann Posts: 124
    edited 2009-01-16 00:13
    Mouse guts? 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)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-16 00:23
    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 , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • Mark SwannMark Swann Posts: 124
    edited 2009-01-16 00:31
    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?
  • JoeBoticsJoeBotics Posts: 17
    edited 2009-01-16 18:48
    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
  • evanhevanh Posts: 16,106
    edited 2009-01-17 12:07
    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.
Sign In or Register to comment.