Welcome! Log In Create A New Profile

Advanced

Optical position measurement

Posted by Jared Harvey 
Jared Harvey
Optical position measurement
December 05, 2007 06:15AM
This topic is about the use optical mouse parts used as a low cost position measurement device. This ideas was brought up by blerik in this topic.

[forums.reprap.org] where he notes this web page.

[spritesmods.com]

I saw this topic as a little off topic for servos so before it got buried with a less noticeable topic subject, I'm bringing it up here.

Positions should be obtainable in the .1mm range and it sounds like the Arduino may have the horse power to make it happen.

Things I'm curious about include the physical size of the image that can be scanned, source of parts (optics, chip, housings, ect) and algorithm theories.

Any one found sources for parts other then in a mouse?
VDX
Re: Optical position measurement
December 05, 2007 07:00AM
Hi Jared,

... here is the German source for single parts and PCB's as used in the c't-bot:

[cgi.segor.de]

As said in the old thread, you can modify the optical properties of the visible area freely with lenses, so it's no problem to scan an area of 1x1 mm or even smaller with the 19x19-pixel-cam to get higher accuracy ...

Viktor
Anonymous User
Re: Optical position measurement
December 05, 2007 11:29PM
When I talked with HP about their optical mice, they discouraged trying to use them as position encoders because the hardware drops bits. Said another way when the camera logic gets confused (which it does), the output doesn't track the exact position. When used as a mouse this is fine as the user simply corrects for this error and doesn't even notice that it happened. Trying to use this hardware as an absolute or even a relative encoder is quite another thing.

Best,
Dan
Anonymous User
Re: Optical position measurement
December 06, 2007 03:33AM
@Dan:

You assume using the tracking firmware of the mouse itself. I assume the mouse sensor is on top of a metric measuring tape. The camera on a typical optical mouse can see an area of about 400cpi/18pels/25.4 = 0.9 by 0.9 mm, so it can just see the mm marks on the measuring tape (worst case is right between two marks, it should still see the edges since the markings are about .25mm wide). If you position the camera right you can see the difference between the major and minor marks and get an absolute reference within each centimeter. That is good enough to compensate for any lost steps in a stepper and course enough to keep track with a fast servo.

--Blerik

Edited 1 time(s). Last edit at 12/06/2007 03:51AM by blerik.
Jared Harvey
Re: Optical position measurement
December 06, 2007 05:00AM
One thing I can't help but notice is the X and Y measure potential. There has to be a clever way to get both measurements with one sensor. I haven't thought of a practical way yet.

About the confused sensor, I suspect with a controlled image we'll find this is minimized. A mouse is often lifted off the surface a bit causing it to be out of focus, and goes over several unknown surfaces making it hard to track. If we try to use just the CCD info, I'm a bit concerned about what might happen with misc debris. The tape is sure to get dust, plastic, coffee and other debris on it from time to time. I'm sure the algorithm in the chips DSP is quite good and well tested. I think the use of the CCD for calibration might be the best approach.
Re: Optical position measurement
December 06, 2007 08:19AM
Well, 25.4 mm/inch, 400 dpi and 18 pixels give a total field size of 1.143mm.

The sensor has 18 x 18 pixels. If we print a position encoding at 100 dpi we could use 4 * 4 = 16 bits per scanned image plus one pixel row / column as separator. If we use 8 bits for x and 8 bits for y we could encode a total square of 292.608 mm.

If we only use it for a single axis then limits would probably be large enough to suite every reprapper's needs. Regarding precision, we would get 1/400" = 0.0635mm < 1/15mm by simple digital encoding. However, our sensor gives an intensity resolution of 6bit which we could use to detect passing of corners to increase accuracy to sub-pixel level.

Preconditions for this idea are clean borders on the encoder print and a good lens for sub-pixel accuracy.

Howie


--
Airspace V - international hangar flying!
[www.airspace-v.com] for tools and toys
Anonymous User
Re: Optical position measurement
December 06, 2007 08:43AM
@Dan: Why try to use 1 sensor for both X and Y when the sensors are only 1 or 2 bucks apiece? (adnb-2611 is $1.73 apiece, $0.96 bulk) You also need two printing surfaces for simultaneous tracking of both X and Y, since you cannot both track and print on the same surface (the mouse sensors have a depth of field of only 0.1mm).

As for using the mouse tracking firmware and recalibrate using raw ccd data every once in a while... I don't know how repeatable the mouse tracking is. But that is easy to check. Just tape a mouse to a working axis and make the axis go back and forth a couple of hundred times and log the mouse positions on your computer. X and Y together is even easier, make the head do a circle, and put the mouse cursor in paint or another drawing program. Tape down button 1 and after a hundred circles check the image for tracking.

@Howie: There are also 800 dpi and even 1600 dpi sensors. And If you use the sensor for 1 axis only, you can get about 10 times the resolution by slightly rotating the sensor. This way the top row of pixels sees the lines earlier than the bottom row, so you can use the row with the highest contrast for subpixel detection.

--Blerik
VDX
Re: Optical position measurement
December 06, 2007 09:32AM
... for good optical measures you can salvage old printers, as they mostly have a plastic-ribbon with printed lines.

I remember a thread with optical encoders and measure-ribbons as topic with some vendors for ordering the single components, so this kind of measuring should do ...

Viktor
Re: Optical position measurement
December 06, 2007 03:56PM
The printed tape measure seems redundant. Your mouse gets proportional movement without it. You just need to know how far your sensor is away from your surface.

Demented
VDX
Re: Optical position measurement
December 06, 2007 04:28PM
Hi Demented,

... the 'normal' mouse-driver isn't so accurate and loose steps over the travelling range, so you have often to recalibrate your position.

The idea was to use the mouse-sensor as 18x18-pixel-camera and extract the outlines and moving of the lines on the ribbon wit ImageRecognition-software as error-resistant position-info ...

Viktor
Re: Optical position measurement
December 07, 2007 01:33AM
Viktor,

I understand that but it seems to me that the position sensor looses steps, etc because of on-the-fly processing limitations inherent in the cheap mouse design. We aren't limited to using their firmware. We can make our own. A higher sample rate would, I'm sure, go a long way toward clearing those problems up.

Demented
Jared Harvey
Re: Optical position measurement
December 07, 2007 04:39AM
The web page that has the parts is in a foreign language. Any one found a local supplier for those of us in the USA? Or at least something natively in English.

I see Newark carries the parts but has a min quantity of 1000 pieces.
Re: Optical position measurement
December 07, 2007 05:18PM
I am going to have to say that this seems to be a pretty complex route to travel for some simple feedback for the motors. And probably in the end will not provide the necessary resolution.

Here is a device I am thinking of [www.pololu.com]
It requires an optical encoder input and basically transform any DC gear motor into a servo motor.

The encoder could end up driving up costs but with the switch from steppers to less expensive permanent magnet gearmotors it should equal out. I am thinking of designing a four or five axis servo driver like the one from Pololu. It would have 5 PWM H-Bridges for the motors and 5 inputs for the Encoders and probably a parallel to serial IC for the end of travel sensors. Oh and a USB or serial connection to the PC. It would all be based on a PIC microcontroller or I guess it could be based on the arduino also. The component costs for the board would not be too bad. All movement commands would be generated in the computer and sent to the servo driver board.

Well just an idea, I dont know,

Joe McKibben
Re: Optical position measurement
December 07, 2007 05:33PM
I see that Zach is already working on something like this. On the "Arduino as simplified comm/controller board" thread.

Joe McKibben
Re: Optical position measurement
December 07, 2007 05:34PM
So I could hook up several of these sensors up to a microsope, create a really small ruler, write a bunch of software, and be in buisness?
Re: Optical position measurement
December 08, 2007 07:40AM
Joe.McKibben Wrote:
-------------------------------------------------------
> I am going to have to say that this seems to be a
> pretty complex route to travel for some simple
> feedback for the motors. And probably in the end
> will not provide the necessary resolution.

Oddly enough, I feel the PID type controllers with the search and destroy or search and hold features are often much more complicated and difficult to tune. When you use these types of systems you need to consider tau and if you tune it incorrectly, theres also a chance you can make the system a third order system. They get real nasty to constrain. Granted they are nice, You can tune them to get to point B as fast as possible with out overshooting and most will correct for unpredicted influences, but they are expensive and contain hidden problems.

Measuring directly from the head (or nearly from the head) offers simplicity and extra features. It is and will be a second order system that will operate in a manner that the average person would have a gut feel for. Making it easier to trouble shoot and less prone to problems.

I do have to admit I would prefer finding some of that magnetic strip that is often found in calipers and such devices, I feel that kind of system would prove even better then optical, but I haven't had success in finding the strip yet.
Re: Optical position measurement
December 16, 2007 08:52PM
check this out: hackzine has a whole slew of links on people using these for cheap x/y feedback for robotics projects.

[www.hackszine.com]

can i get a hell yeah?
Sorry, only registered users may post in this forum.

Click here to login