9 years, 2 months ago.

Different sensors

How hard would it be to implement the sensor on the VP V2 kit?

Question relating to:

An input/output controller for virtual pinball machines, with plunger position tracking, accelerometer-based nudge sensing, button input encoding, and feedback device control.

1 Answer

9 years, 2 months ago.

It wouldn't be terribly hard. They use an IR proximity sensor, which I believe presents an analog voltage level as its output. The voltage level is meant to vary roughly linearly with the distance of the target from the sensor. On the hardware side, you'd have to wire up the analog out from the sensor to an analog in GPIO pin on the KL25Z. On the software side, you'd sample the analog level and interpret that into a position report, replacing the existing code that reads and interprets the CCD pixel data.

One person has reported on vpforums.org converting this software to work with a potentionmeter as the sensor. The software side of that should be very similar to using an IR prox sensor, since they both work by turning the distance measurement into a voltage value on an analog in pin.

If you do go that route, feel free to fork the repository with a new IR proximity sensor version.

The downside of the IR prox sensors is that they're pretty bad distance sensors, as far as I can tell. They're weak in terms of linearity, precision, and stability. The data sheets for the sensors that I've looked suggest they were really designed to tell you *if* there's an object in range at all rather than exactly how far away it is. Using them as distance measuring tools seems to be a bit of a stretch in terms of what their designers optimized for. The VP kit software appears to try to compensate by using a very coarse granularity in the position reports it sends to the joystick interface - about 8-10 quanta over the whole 3" physical motion range of the plunger. You'd have to do the same, so the results might not be all that pleasing. It's possible that someone sells an IR prox sensor with better distance measuring capabilities; I haven't looked all that hard, so I don't really know, but I kind of doubt it. I get the impression that people who want precise position measurements just don't think of this technology as a candidate, so there's no demand for optimizing for this application.

It looks to me like the technology of choice for precision position measurement is linear encoders. The downside of those is that they're expensive - they all seem to go to the other extreme and optimize for *really* high precision, like micron scale or better, which is way more than we need for this application. Note that Zeb of zebsboards is selling a new plunger kit of his own design that reportedly uses a linear encoder as its core measuring device. I have no idea which device he's using, but he must have found something that's reasonably priced and has the right physical properties. You might ask him if he can give you a lead on this before going the IR prox route.

Accepted Answer