Measure distance traveled

Hello

I know near to nothing regarding robots/sensors etc, but I am working on a project where I need a sensor so I figured that you guys might be the ones to ask. I can’t go into to much detail about my application, but what I can tell you is that I need a sensor that is similar to the sensor on the bottom of a mouse. The sensor needs to output how much of a surface has moved past the sensor in both X and Y directions and then input that data into a computer to be read. I have a prototype with a mouse already, however there are a couple of problems with a mouse as the sensor:

1.) I need the ability to use 1 mouse as the computer mouse, and then also have a sensor and use both at the same time. Right now I am using 2 mice, one for the computer mouse, and one for the distance sensor. I am reading the distance sensor mouse as raw input into the computer, but I can’t seem to distinguish between the 2 mice.

2.) A mouse is not accurate enough. It is not designed to be use as a true position sensor. I wrote a program to calibrate my mouse units into millimeters however every time I move the mouse 150 millimeters (in 1 of the dimensions) I get a largely varying number of mouse units. The mouse units are not consistent each time I do the calibration (with the same mouse). It is not just off by a couple mouse units either. It is a largely varying number of mouse units. I am working in a domain where millimeters make a large difference so I can’t have a sensor that is less precise than that. The mouse that I am currently using is a laser precision mouse (not just and optical mouse).

So basically I need a better solution. I need a sensor that is actually designed to give true position. In my problem, my sensor will be able to stay stationary (near a computer) and a surface will be moved across the sensor (with 2 degrees of freedom). Since the sensor is stationary and near a computer, it is possible for a wire to be connected from the sensor to the computer to read the data values into the computer. Also, I will need some sort of c++ library that will be able to read the data in real time. If it is possible, the surface should not touch the sensor. The surface that needs to be read is sort of shiny. It is sort of like a slightly shinier version of the surface on a coaxial cable. I need to have sub-millimeter accuracy if possible.

I figured that you guys might have some suggestions because I’m sure that robots get sensors mounted to their undersides to determine how far it has traveled over the ground (and that is essentially the same problem as mine).

I am not sure what type of sensor it is that I need. Is it called a “linear position sensor”, or a “optical encoder” or “laser/infered”, or something else?

Here is a little further information that you may need to know. My surface is moving perpendicular to the direction that the sensor is pointing. The surface will not be moving closer or further to the sensor. I will not need to port this to a microcontroller/ or microprocessor, the final product will be used on a desktop computer.

In reality, my surface is a thin cylindrical shape and I want to measure how much of the cylinder has been inserted past the sensor, and also measure the rotation of the cylinder. I was planning on just calibrating one of the sensors to millimeters and the other to degrees.

Any help would be greatly appreciated.

Thanks,

Thank you both for your input. I had not thought of the fact that the distance of the surface from the sensor could have made a difference. Obviously on a larger scale it makes a difference since the sensor only works within a certain range, but I assumed that inside that range a mouse unit is a mouse unit. I’ll look into this. Also, the surface that I’m trying to read is relatively reflective so I may need to do something about that - Or a trackball may be the way to go.

Thanks!

Have you considered using a trackball instead of a mouse?

Hi,

This is what I know :

1 pixel is near 0,53 mm and 0,21 mm (depending on the size of the screen and the resolution). It’s possible to make a program that calculates a distance using a mouse. An optical mouse moves pixel by pixel and a simple program is reading the distances in enough refreshing rate to be efficient. Using a mouse on a reflective object, with the sunlight on it, will not work…

Maybe there is a problem with the calibration of your mouse. Or maybe the surface your trying to read is too far from the mouse. The result of calculating the measure distance of 1 pixel depends on the distance of your your mouse and the object in motion. And I think there is a factor about the luminosity where your doing your test. Try doing it in the dark with a very short distance between your mouse and the cylinder.

After all, maybe you’ll need a luminosity sensor. Else, a trackball with a contact on the surface will work.

Good luck.

Jeff