Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Optical Mouse Navigation (http://www.chiefdelphi.com/forums/showthread.php?t=31999)

seanwitte 02-01-2005 11:44

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by phrontist
Hmmm...

I don't think bit banging is nessicary at all. In fact, I don't plan to use interrupts at all. If you look at David Flowerday's post above, he links to the incredibly useful aligent site which has information on all of their chips. Many of the chips have quaderature output, which is really really easy to interface to! But the following issues came up in a discussion between Max and I:
  1. The mouse would generate interrupts way to fast when the robot was at top speed, even with optics and such
  2. You need three optical axis's, which means six pins to take quaderature input. Some of the digital inputs on the RC and grouped together, so while possibly doable, it becomes harder.

The solution is to use an accumulator chip, which will take in quaderature input and count "rotations" of the pattern, outputting it in as 8 binary outputs, which can in turn be read by the RC without issue. But no! I hear you cry... you need 8 digital inputs per axis! Well this is where the clever bit come in, once again courtesy of Max. The output of these chips can be turned on and off (and their counts can be reset), through one of the digital outs on the RC. So you connect all three accumulators to the same 8 pins, and than you poll them every so often (as long as its fast enough that the accumulators don't overflow). So you just turn each chip's output on in turn and read the values in!

Pretty cool, huh?

Another option is to use a counter with synchronous serial output. You can tie the data and clock lines from all of the accumulators to two RC pins, then have one dedicated RC pin for the Chip Select on each accumulator. The code to shift in the bits would be easy to implement but I think Kevin Watson has already written it.

Alan Anderson 02-01-2005 13:14

Re: Optical Mouse Navigation
 
Vertical bounce is a severe problem for an "optical mouse" robot position tracking system. It's not a matter of focus, it's a matter of scale. When the distance from floor to sensor is not absolutely constant, the measured travel is not sufficiently repeatable for a reliable result.

Collaborating loosely with Wildstang, we worked on making it function well for much of last season. I eventually concluded that the distance problem is a showstopper, and gave up on it. I spent a lot of time working out the trigonometry for full position/rotation tracking using a pair of modified mice, and even implemented most of the code using CORDIC, but the system wasn't going to be physically capable of being any more useful than a more standard wheel/shaft encoder.

phrontist 02-01-2005 13:49

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by Alan Anderson
Vertical bounce is a severe problem for an "optical mouse" robot position tracking system. It's not a matter of focus, it's a matter of scale. When the distance from floor to sensor is not absolutely constant, the measured travel is not sufficiently repeatable for a reliable result.

Collaborating loosely with Wildstang, we worked on making it function well for much of last season. I eventually concluded that the distance problem is a showstopper, and gave up on it. I spent a lot of time working out the trigonometry for full position/rotation tracking using a pair of modified mice, and even implemented most of the code using CORDIC, but the system wasn't going to be physically capable of being any more useful than a more standard wheel/shaft encoder.

Could you be more specific? What tolerance are we talking about here? A centimeter, a few milimeters, or more like 3 centimeters? How much distortion are we actually talking about here? Thank you very much for pointing this out, and preventing us from repeating mistakes. You may have found the fatal flaw in this plan. C'est la vie.

Alan Anderson 02-01-2005 15:17

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by phrontist
What tolerance are we talking about here? A centimeter, a few milimeters, or more like 3 centimeters?

We used a test jig with adjustable height and a strip of carpet on a moving platform. During one trial, after I adjusted it for the best focus (as determined by the reported image quality from the sensor), the measured travel from one end of the platform's range to the other was on the order of 400 counts. As long as nothing disturbed the height of the mouse it was very repeatable, with the cumulative distance returning to zero over many cycles back and forth. However, raising the mouse by a couple of millimeters decreased the measurement to about 380 counts. Lowering it a similar amount increased it to about 440. That much variation is probably what you'd get just driving across a smooth carpet, and pretty much wipes out any chance of using the system to get an accurate reading of the robot's position on the field.

To improve things much, you'd have to employ three-dimensional imaging. I doubt there are any cheap devices available to do that.

phrontist 02-01-2005 16:26

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by Alan Anderson
We used a test jig with adjustable height and a strip of carpet on a moving platform. During one trial, after I adjusted it for the best focus (as determined by the reported image quality from the sensor), the measured travel from one end of the platform's range to the other was on the order of 400 counts. As long as nothing disturbed the height of the mouse it was very repeatable, with the cumulative distance returning to zero over many cycles back and forth. However, raising the mouse by a couple of millimeters decreased the measurement to about 380 counts. Lowering it a similar amount increased it to about 440. That much variation is probably what you'd get just driving across a smooth carpet, and pretty much wipes out any chance of using the system to get an accurate reading of the robot's position on the field.

To improve things much, you'd have to employ three-dimensional imaging. I doubt there are any cheap devices available to do that.

Could an ultrasonic or infrared range sensor be used to read height, and scale input values accoordingly?

Jizvonius 02-01-2005 16:26

Re: Optical Mouse Navigation
 
If you guys don’t mind a little mechanical system involved in your navigation, you can control the surface quality that your optical system sees and the distance to that surface.

The system requires an interface between the carpet and your optical sensors. Say, a ball with a textured surface (ball size and material must take into account carpet properties). The sensors and ball are a fixed distance from each other by attaching the sensors to the ball cradle. Now to minimize slippage on the ground, have the entire apparatus slide up and down on a track with downward force provided by a constant tension spring.

This isn’t a completely thought through design yet, and yes, it is just a higher resolution encoder. But it is free spinning (deals with pushing and drive train slippage), much higher resolution, and with a little math you may be able to calculate yaw (depending on the placement of the ball and sensors).

It seems that we will either have to deal with mechanical or optical slop either way, so instead of having your sensors losing focus, you can just have the minimized slippage of a free spinning ball (and yell at your mechanical team if it’s not working). Anyway let me know what you guys think.

phrontist 02-01-2005 16:32

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by Jizvonius
If you guys don’t mind a little mechanical system involved in your navigation, you can control the surface quality that your optical system sees and the distance to that surface.

The system requires an interface between the carpet and your optical sensors. Say, a ball with a textured surface (ball size and material must take into account carpet properties). The sensors and ball are a fixed distance from each other by attaching the sensors to the ball cradle. Now to minimize slippage on the ground, have the entire apparatus slide up and down on a track with downward force provided by a constant tension spring.

This isn’t a completely thought through design yet, and yes, it is just a higher resolution encoder. But it is free spinning (deals with pushing and drive train slippage), much higher resolution, and with a little math you may be able to calculate yaw (depending on the placement of the ball and sensors).

It seems that we will either have to deal with mechanical or optical slop either way, so instead of having your sensors losing focus, you can just have the minimized slippage of a free spinning ball (and yell at your mechanical team if it’s not working). Anyway let me know what you guys think.

Bah! If I get that desperate I'd just make a really low friction housing for the assembly and put it in direct contact with the ground, with the ability to retract up into the robot's body. I'm no where near that desperate yet.

Jizvonius 02-01-2005 16:44

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by phrontist
Bah! If I get that desperate I'd just make a really low friction housing for the assembly and put it in direct contact with the ground, with the ability to retract up into the robot's body. I'm no where near that desperate yet.


Thats not a bad idea as long as the carpet won't mess up the surface of your housing and you have a low slung robot. But in terms of controlling the surface quality and distance to the surface, I'm not sure that it will be as effective. Either way, it might have been a joke but don't rule it out.

Craig Putnam 02-01-2005 17:54

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by Alan Anderson
... However, raising the mouse by a couple of millimeters decreased the measurement to about 380 counts. Lowering it a similar amount increased it to about 440. ...

It sounds to me as though you had very little depth of field. Think of a completely manual camera (I know - that sets a lower boundary on my age!). You have to set the f-stop & shutter speed to get a correct exposure. You can trade them off back and forth as necessary to get the effect you desire.

Want more depth of field? Then stop down the lens (increase the f-stop). Because there is less light coming through the smaller aperature, you need to more brightly illuminate your subject (if you can) or decrease the shutter speed (and risk camera shake).

I suspect I've got a much smaller aperature (higher f-stop) and therefore more depth of field than you had in your setup. Now, I don't have a *lot* of headroom vertically - perhaps +/- 5 mm at the moment, but I can increase it if I need to by stopping down further (I have more light than I need and can always add more if necessary).

phrontist 02-01-2005 18:15

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by Craig Putnam
It sounds to me as though you had very little depth of field. Think of a completely manual camera (I know - that sets a lower boundary on my age!). You have to set the f-stop & shutter speed to get a correct exposure. You can trade them off back and forth as necessary to get the effect you desire.

Want more depth of field? Then stop down the lens (increase the f-stop). Because there is less light coming through the smaller aperature, you need to more brightly illuminate your subject (if you can) or decrease the shutter speed (and risk camera shake).

I suspect I've got a much smaller aperature (higher f-stop) and therefore more depth of field than you had in your setup. Now, I don't have a *lot* of headroom vertically - perhaps +/- 5 mm at the moment, but I can increase it if I need to by stopping down further (I have more light than I need and can always add more if necessary).

Mr. Putnam, you made my day! I was just thinking about this, but not being as ancient^H^H^H^H^H^H^H experienced as you I couldn't put it into words. ;)

Speaking of which, where did you get your lense(s)? I presume you are using a single biconvex lens...

I haven't talked to our optics guy in a week or so (it's winter break), so I don't know what he's got planned, but I'm curious to hear about your optics implementation

Gdeaver 02-01-2005 19:26

Re: Optical Mouse Navigation
 
I've done some more testing today and noticed that if there are 2 different texture surfaces the mouse changes scale and it isn't the same each time.
today I put a stripped down mouse assemble on a 3/4" drive shaft. Took some work to get the distance right. Wow, instant encoder and the accuracy and repeatability look good. The real nice thing is no interrupts. I also noticed that there is a software SPI library included with pic c. If the terrain following doesn't work out then use it as a 400dpi encoder.

Craig Putnam 02-01-2005 19:35

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by phrontist
... Speaking of which, where did you get your lense(s)? I presume you are using a single biconvex lens...

Correct - it is a single bi-convex lens that I purchased from Edmund Industrial Optics (a division of Edmund Scientific) . See www.edmundoptics.com for details. I don't have the records here of exactly which one it was, but as I recall there weren't all *that* many to choose from.

Conor Ryan 02-01-2005 19:57

Re: Optical Mouse Navigation
 
has anyone ever had a steering wheel as a control system, kind of like the kind of wheel you'd use in a racing game of sort, with a pedal for an accelerator

Alan Anderson 02-01-2005 22:48

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by Craig Putnam
It sounds to me as though you had very little depth of field...

No, as I said before, it's not a focus problem.

The "telephoto mouse" we constructed has a bit more than a centimeter of variation in range where it will still track the carpet if appropriately illuminated. But it won't track it consistently if the distance isn't kept absolutely constant.

phrontist 02-01-2005 23:20

Re: Optical Mouse Navigation
 
Quote:

Originally Posted by Alan Anderson
No, as I said before, it's not a focus problem.

The "telephoto mouse" we constructed has a bit more than a centimeter of variation in range where it will still track the carpet if appropriately illuminated. But it won't track it consistently if the distance isn't kept absolutely constant.

I'm sorry, I don't know that much about optics, please explain how this is not a focus problem. Logically, if you move the mouse up and down it will be tracking larger and smaller patches of carpet. Why would a sudden jump in registered distance occur if it were getting a clear image? If it didn't have a large enough depth of field, it would make sense if a sudden jump occured, for that would indicate the sensors loss of focus. Please clarify.


All times are GMT -5. The time now is 16:12.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi