go_away

Author Topic: Optical Mouse as XY Encoder  (Read 6639 times)

0 Members and 1 Guest are viewing this topic.

Offline hamzamanTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 1
Optical Mouse as XY Encoder
« on: October 18, 2011, 07:55:27 AM »
Why do people not use an optical mouse as an XY encoder for a robot that has to work on standard robot arenas?
It should be pretty accurate no?
If you can find a way to interface a microcontroller with an optical mouse, it should give good XY measurements with respect to the initial position. Theoretically.

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: Optical Mouse as XY Encoder
« Reply #1 on: October 18, 2011, 08:22:03 AM »
While theoretically, this is a good idea, it is often unusable in practice: optical mouse sensors have different tracking characteristics on different surfaces, so you can't get a reliable count. If you use a trackball, or some other medium of transfer (perhaps a wheel), to maintain a consistent surface, it is possible to use an optical mouse sensor as an encoder, but it brings little benefit as compared to using a standard optical encoder.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Optical Mouse as XY Encoder
« Reply #2 on: October 18, 2011, 04:53:58 PM »
Hi,

Why do people not use an optical mouse as an XY encoder for a robot that has to work on standard robot arenas?

Had you spent less than a second on Google you would have seen that they do - depending on your search terms, you get from 200,000 to more than 4 million hits on the subject.
One of the people that have been hacking around with mice is benji and I have seen a number of different different implementations of the idea.

I'm tempted to ask in return "Why don't you use an optical mouse for XY"  ;D


It should be pretty accurate no?

Like with most sensors, a good deal of the success (or otherwise) lies in the implementation of both hardware and software - Even the best sensor can be F'd up completely by bad hard- and/or software, while even very crude sensors can be used with precision if  used right.

As an example, just consider the Wii Fit, which really is nothing more than a body scale, but with clever interfacing and programming it can deduce the slightest change in your posture, your 2D CoG and a host of other things - that's smooth interfacing.


If you can find a way to interface a microcontroller with an optical mouse, it should give good XY measurements with respect to the initial position. Theoretically.

I have only seen one implementation that relied in the mouse itelf (with just the optics changed) to sort out the optical flow. Usually, people interface the camera chip directly and write their own decoding, suitable for the surface(s) they want to read.

There is a huge difference in how well optical mice works though. Some have a hard time with black surfaces, some with white, some don't like glass, some don't like skin (don''t use a mouse while having body tequilas ;))  etc. and that's an important factor as well, so don't just grab the cheapest mouse - test friends mice (and your own) on different "difficult" surfaces and test how much you can vary the distance upwards and angular while still getting a good reading.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline hamzamanTopic starter

  • Jr. Member
  • **
  • Posts: 9
  • Helpful? 1
Re: Optical Mouse as XY Encoder
« Reply #3 on: October 19, 2011, 05:05:04 AM »
Soeren your post though stingy, was really helpful.

I did google it but it took me towards it's use for scanner and stuff. Well maybe I was having a bad googling day. :p

I'l be testing different mice from the computer labs at school :D

Thanks again.

Also i found this:
http://ferretrobotics.blogspot.com/2011/01/interfacing-optical-mouse-usb-with-pic.html
in case anyone else needs it.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Optical Mouse as XY Encoder
« Reply #4 on: October 19, 2011, 09:18:18 AM »
Hi,

Other links that may be helpful (in no particular order)...
http://spritesmods.com/?art=mouseeye  (2 pages)
and/or http://areciv.com/index.php?aid=18
(one seems to be more or less cloned from the other)

Then there's...
http://www.gurulib.com/_project/optical_mouse_hack_files/optical_mouse_hack.htm
http://matz-make.posterous.com/experimenting-with-using-a-mouse-sensor-for-g
and
http://www.robotshop.com/gorobotics/the-news/latest-news/hacked-mouse-as-a-mini-sumo-sensor

and an overall informative page is:
http://home.roadrunner.com/~maccody/robotics/croms-1/croms-1.html

All in all, they cover more than one optical sensor, but certainly not all of them, so may or may not be usable.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline beautifulsmall

  • Jr. Member
  • **
  • Posts: 7
  • Helpful? 2
Re: Optical Mouse as XY Encoder
« Reply #5 on: October 21, 2011, 04:25:45 PM »
I have tested the 7550 laser mouse sensor on various surfaces but but never got a good absolute position, for rough velocity its good but for integrating all mice are poor. I tested my desk mouse by moving it to a corner several times and the offsett accumulated each time is large. error is ~ 10 to 15% . all mice sensors did it in when i looked in mid 2011. the latest 9500 sensor may be better ? I have one but not tested it yet.
The advantage of the mouse sensor is to measure ground speed so a skid can be recognised which they could do.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Optical Mouse as XY Encoder
« Reply #6 on: October 21, 2011, 07:21:58 PM »
Hi,

I have tested the 7550 laser mouse sensor on various surfaces but but never got a good absolute position,
At what range of speeds?
Moved by hand?


for rough velocity its good but for integrating all mice are poor.
It's up to your software (and it is not a hard task), as long as you extract the raw pixel data,


I tested my desk mouse by moving it to a corner several times and the offsett accumulated each time is large. error is ~ 10 to 15% . all mice sensors did it in when i looked in mid 2011. the latest 9500 sensor may be better ? I have one but not tested it yet.
The advantage of the mouse sensor is to measure ground speed so a skid can be recognised which they could do.
Moving a mouse around by hand means a vast range of speeds and acceleration (which matters a lot, if you use the firmware of the mouse and/or your PC's mouse driver)
Mouse-ware gets optimized for "mousing", not for precise coordinate date use.

The pixels doesn't change size during use (although mouse-ware make it seem so). Reading the raw pixel data at a sensible high speed and using your own algorithms is the way to go for precise X-Y positioning.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here

data_list