Ultrasonic Rangefinder giving inconsistent values

Hi all,
Our team is using an ultrasonic rangefinder (link here: http://www.maxbotix.com/Ultrasonic_Sensors/MB1023.htm) and we have been having trouble getting consistent values from it. It seems to randomly switch from accurate values to unreasonable values (with an error anywhere from 20cm to 70cm) for the voltage and the value (we are using java and the methods getValue(), getAverageValue(), getVoltage(), getAverageVoltage()). As of now we are simply printing these values to try to find a way to make them consistent. We are aiming it at a hard surface (a metal plate or a wall) and are aware of the 30cm deadzone. Does anyone have any ideas? Any help would be appreciated.
Thanks,
Rohin Bhushan
Team 3482

Ultrasonic sensors have a ‘cone’ of detection. Some of them are quite wide. Do you have more than one sensor running? Do you have anything near the cone of detection? Is the sensor extremely close to the ground?

Have you set a gain? The sensor returns a value that is linearly proportional to the distance, but you need to use a gain to make it accurately report. I.e. - is it consistently wrong? Or is the distance inconsistent.

We’ve never had good luck with the maxbotix sensors.

We also found (years ago) that they are sensitive to “environmental” ultrasonic noise. Such as that produced when two hard objects (like gear teeth) smack together and produce a broad spectrum of frequencies. Like on most robots…

No, we don’t have spectral measurements to support the theory, just a basic knowledge of sound and vibration physics. It masks as an EMI issue, but when the gear teeth (and only the gear teeth) were removed from the test scope the problem effectively went away. YMMV.

Check the wiring of the sensor as well.

The analog methods you are using sounds right… but just in case can you post your code so we can look at it?

You might try shielded cable. We had this problem a couple of years ago and didn’t solve it. If you figure something out, please let us know. On the Maxbotix site they sell shielded cable and they claim its steady when using it.

Try using the Pulse width output into the DIO instead of the Analog. We attempted to use Analog the first year they came in the KOP. We changed to the pulse width and have consistent results between minimum (6 inches) and about 80 inches. Beyond that, the reading will jump from the correct value.

It might be possible for you to filter out unreasonable values in software. If you see a large jump in the ultrasonic sensor’s value that doesn’t match up with other values that it’s output that value might just be noise.

These ultrasonics also have a serial output that the RoboRIO can read. I wrote a driver for them a while back, and you’re welcome to use it. Like the DIO, it should be more reliable than the analog.

We have never had success with these sensors. We’ve tried using 3 of them in the past to no avail.

Some other may have had success, but from my experience they were only good at detecting something going from really close to really far away.

Let me say that after working with sonic and ultrasonic rangefinders on robots for a few weeks a couple of years ago, we switched to almost entirely optical/IR for range finders. I am an (underwater) acoustician in my day job. I was most unhappy with (affordable) acoustic and ultrasonic sensors’ handling of returns less than twice the nominal minimum range.