•

# Optical mouse as CHEAP encoder?

12 replies to this topic

### #1 Nathan Carlie

Nathan Carlie

Lift Off

• topic starter
• Posts: 9
• Joined: 20 Dec 2012

Posted 08 January 2013 - 11:50 AM

Hi All,
I'm working on motorizing my 12" LB for go-to, and was lamenting the cost of everything needed to do so. IN particular is the cost of the encoders, and that got me thinking of ways to do it better for cheaper.

So here was my thought... Drill a hole in the base and insert a disassembled a cheap optical mouse into it so that it looks at the top of the ground board as if it were the top of a desk. As the base is turned, the mouse will see the ground board go by as if it were moving vertically. A bit of quick math here... Lets say a cheapo 400 DPI mouse, placed 6" out from the axis gives 9.55 inches of movement per degree rotation, or 1.4 arc minutes per count... plenty of precision for goto. The same setup could be used to watch the rim of the Alt axis bearing.

If we change to 2000 dpi laser mouse, and use a larger radius, say 12 inches we get a value of 8.6 arcseconds per count... equivalent to a 150k PPR optical encoder on the axis.

Then hook the two mice to the computer by USB and do the math to convert position to angle, and you're done.

This sounds very nice and easy to me, but I am no programmer. The fact it isn't done already makes me think there's a problem. Has anyone heard of this?

### #2 Starhawk

Starhawk

Space Ranger

• Posts: 6189
• Joined: 16 Sep 2008
• Loc: Tucson, Arizona

Posted 08 January 2013 - 12:04 PM

That's been proposed before. I don't know of any examples in the wild, though. It would need the right surface to measure against, and I am not sure how well it can work in practice since you get relative position instead of true position, so errors will accumulate as it drives around.

With that said, if it were able to read a barcode as it went along to correct its true position at regular intervals, that might make this practical since that would make the relative position errors stay small.

-Rich

### #3 Starhawk

Starhawk

Space Ranger

• Posts: 6189
• Joined: 16 Sep 2008
• Loc: Tucson, Arizona

Posted 08 January 2013 - 12:24 PM

Also, you need to work on your math a bit. A 400 dpi encoder might give 400 ticks per inch of movement, but at a 6" radius, there is only .103" of travel per degree. Though that is 1.45 minutes of arc per tick, assuming you get a tick for every unit of dpi.

However, try this experiment: Take a mouse and move it to a reference point on your screen, so your cursor is next to a good reference like a spot you can remember on a picture. Brace it against two of your fingers then move it back and forth with your thumb while looking at the mouse, not the screen. move the mouse back and forth for a few dozen cycles. Look back at the screen and you will notice the cursor is several inches from where you started.

-Rich

### #4 Nathan Carlie

Nathan Carlie

Lift Off

• topic starter
• Posts: 9
• Joined: 20 Dec 2012

Posted 08 January 2013 - 01:14 PM

OK yeah, I see what you mean about the mouse on the screen thing. I wonder if that has anything to do with the way the position information is communicated to the PC. Might be a fixable problem.

Remember that all those optical encoders are just as "relative" as the optical sensor on a mouse, and it's perfectly possible to miss codes and have errors accumulate. The electronics used to decode them are just usually very fast to help make up for this problem and reduce the chance to miss one.

They are made that way because the application requires it, but a mouse doesn't need it because it has your eyes telling it "no, you're not quite there yet, move a little more" and this extra feed back eliminates the need.

I would imagine the polling frequency is not huge, which makes high speed accuracy poor especially on cheapo mice. I would bet the "gaming" mice are much better at speed and accuracy.

As for the surface, I would bet that the standard laminate finish on most mass-produced dob bases if perfect for a modern optical mouse, especially the laser types.

### #5 Jon Isaacs

Jon Isaacs

ISS

• Posts: 54946
• Joined: 16 Jun 2004
• Loc: San Diego and Boulevard, CA

Posted 08 January 2013 - 01:23 PM

At one time I was interested in using optical encoders from a mouse for DSCs but I did some simple tests that lead me to believe the results were not repeatable. Maybe with careful attention to the surface it might work and with two usb mice and the proper drivers, it could be quite simple to implement.

With a large Dob altitude bearing, say a 20 inch diameter, a 400 dpi would be about 70 dots per degree...

Jon

### #6 rmollise

rmollise

Hubble

• Posts: 18517
• Joined: 06 Jul 2007

Posted 08 January 2013 - 04:48 PM

It has been done. I recall an article years ago in the magazine, Sky and Telescope, that is, about someone who'd done that for an AstroScan, I believe.

### #7 ccs_hello

ccs_hello

Cosmos

• Posts: 7992
• Joined: 03 Jul 2004

Posted 08 January 2013 - 06:29 PM

Mechanical mouse using optical interrupter (the one that has a ball rolling) has potential. Optical mouse which shines a (laser) beam cannot. The first category most likely will fail for multiple reasons.
(1) if the original mouse's IC is used, as opposed to just use the opto-interrupter with slotted wheel, the IC will only do guestimate and sometimes even add a "tint" (accleration rate based speed-up/dynamic resolution)
(2) the mouse is designed to use human brain as its "accurate positioning" feedback loop, how accurate itself can be really does not matter, as the original mouse designer said, and
(3) friction based coupling (the rubber ball) is not accurate enough.

Clear Skies!

ccs_hello

### #8 Nathan Carlie

Nathan Carlie

Lift Off

• topic starter
• Posts: 9
• Joined: 20 Dec 2012

Posted 08 January 2013 - 07:39 PM

Thanks everyone. Sounds like it's a no go. Can you tell I'm a cheapskate or what?

### #9 orlyandico

orlyandico

Fly Me to the Moon

• Posts: 7400
• Joined: 10 Aug 2009
• Loc: Singapore

Posted 08 January 2013 - 07:53 PM

You could use one of these encoders:

http://www.pololu.co...og/product/1217

notice it is designed to read the light and dark transitions inside the rubber wheel. I suspect you can use a printed light/dark pattern of appropriate spacing on both the ground board and altitude bearing.

also looks much easier to mount...

### #10 rmollise

rmollise

Hubble

• Posts: 18517
• Joined: 06 Jul 2007

Posted 09 January 2013 - 07:46 AM

Mechanical mouse using optical interrupter (the one that has a ball rolling) has potential. Optical mouse which shines a (laser) beam cannot. The first category most likely will fail for multiple reasons.
(1) if the original mouse's IC is used, as opposed to just use the opto-interrupter with slotted wheel, the IC will only do guestimate and sometimes even add a "tint" (accleration rate based speed-up/dynamic resolution)
(2) the mouse is designed to use human brain as its "accurate positioning" feedback loop, how accurate itself can be really does not matter, as the original mouse designer said, and
(3) friction based coupling (the rubber ball) is not accurate enough.

Clear Skies!

ccs_hello

Yeah, you are exactly right...that article from long ago used mice (mouses?) with mechanical encoders.

### #11 Jon Isaacs

Jon Isaacs

ISS

• Posts: 54946
• Joined: 16 Jun 2004
• Loc: San Diego and Boulevard, CA

Posted 09 January 2013 - 08:02 AM

Thanks everyone. Sounds like it's a no go. Can you tell I'm a cheapskate or what?

There are a few of us around here... The problem with being a cheapskate (or the more PC "thrifty") is that it is hard to pass up a bargain, as I like to say:

"It sure gets expensive saving all this money."

Jon

### #12 orlyandico

orlyandico

Fly Me to the Moon

• Posts: 7400
• Joined: 10 Aug 2009
• Loc: Singapore

Posted 09 January 2013 - 09:51 AM

people make encoders out of paper and phototransistors all the time...

http://thedenneys.or...robot/encoders/

i still think the pololu sensor board plus a printed paper ring with alternating white and black lines (of the right spacing) would make a pretty decent encoder..

that \$2 Omron sensor looks pretty good too. it already has 2 sensors in the package so is all set up for quadrature.

### #13 Geo.

Geo.

Soyuz

• Posts: 3707
• Joined: 01 Oct 2008
• Loc: Upstate NY

Posted 13 January 2013 - 02:10 PM

AMT102 encoders, upto 8192 ticks, about \$25 at Digikey.

## Recent Topics

 Cloudy Nights LLC Cloudy Nights Sponsor: Astronomics