Measuring travel with a mouse?

We just blew the linear encoder on our hydralic press at work. A new one with 40" of travel is fairly expensive and I got to wondering if
you could use an optical computer mouse to measure distance traveled.
The idea is to mount the mouse to the base of the press and have a piece of aluminum flatbar attached to the ram. The bar would pass in front of the optical sensor on the mouse and a dedicated PC would display the distance traveled.
Does anyone know if software to do this exists? Failing that, is there any reason why Visual Basic shouldn't be able to do this if I were to dig out my old copy and install it?
Remove nospam_ to reply by email
Jeff H........
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I deal with glass scales all the time, if you're looking for precision then even if you could get the mouse to work in that manner your accuracy would not be there. If you're in Ontario the ministry would also take issue with a device modified in that manner that was not OEM to the machine, should there ever be an injury involving that machine. What make is the original scale? I have found exact replacement scales for Heidehain scales that were half the price from a guy in Chicago that deals with Fagor scales.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

It certainly sounds worth a try. My only concern is that it might not be precise enough (depending on how much precision you need).

I'm not sure, but REALbasic can certainly do it. You can't just look at the mouse position, because that will run into the edge of the screen and stop updating. But if you treat the mouse as a game input device (in REALbasic, using GameInputManager and related classes), then you can get the delta on every update, and keep adding these up as long as you need.
Sounds like a fun project, so I'd be happy to work with you on writing that RB software if you like.
Best, - Joe
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.