Tell us about yourself!

Complete Your Profile
  • Optical Mouse Odometer for (Arduino) Robot

    Thanks jazzycamel for doing this instructable!This post may be useful for some. And it may get response that is even more useful.I was able to easily move the mouse and loose data with the example code provided. It has a 1 second loop delay. Same for 10 ms delay. But not for 1 ms delay. My robot code loop time is 10 ms maximum including the mouse ps/2 code provided. I set the loop delay in the provided code to 4 ms to emulated 10 ms loop time. I can easily loose data moving the mouse by hand but I have to move fast. This will work for slower moving objects as described. I'm lucky in that my robot is slow enough this is not an issue. How fast the mouse can go before loosing data can be calculated.The minimum time to get position data is 5.83 milliseconds (measure in microseconds), 171.8 ...

    see more »

    Thanks jazzycamel for doing this instructable!This post may be useful for some. And it may get response that is even more useful.I was able to easily move the mouse and loose data with the example code provided. It has a 1 second loop delay. Same for 10 ms delay. But not for 1 ms delay. My robot code loop time is 10 ms maximum including the mouse ps/2 code provided. I set the loop delay in the provided code to 4 ms to emulated 10 ms loop time. I can easily loose data moving the mouse by hand but I have to move fast. This will work for slower moving objects as described. I'm lucky in that my robot is slow enough this is not an issue. How fast the mouse can go before loosing data can be calculated.The minimum time to get position data is 5.83 milliseconds (measure in microseconds), 171.8 Hz. If I knew the pixels per inch then it would be straight forward to calculate maximum speed for the mouse and not loose data. Also what is the ability of the detector? It must have a maximum detection time.To date my robot code loop time is about 2.5 milliseconds maximum. Add the 5.83 ms brings it to a total of 8.33 ms. Leaving ~1.7 ms for higher level control code. Might not be enough. If so I may add an Arduino just to track robot displacement and provide other minor functionality. Divide and conquer. I do hope this is not required. The next step is to push PS/2 to a higher clock rate and find where it breaks down. jazzycamel may have already determined this. ?

    Now that I have the mouse tracking I need to change the focal length to something like 2 cm so it clears the floor and wont collect dirt and dust. Any suggestions on where to find lenses? And how to go about using a lens.

    View Instructable »