Hello For Autonomous mode, we need robot to navigate to specific distance. We tried encoders and they work great but problem with encoders are that we don’t know how to place the robot to start with. So we decided to use Distance Sensor but we found below problem:
Test Performed:
We connected distance sensor to I2C port 1 and put a robot to one position and a white cardboard (big one) at another location (5 inches, 2 inches apart). My test was to check if distance sensor gives me accurate output or to learn if there are error rate.
We performed multiple tests and results were very bad. For 50 mm distance, reading from distance sensor varied from 31mm to 47mm. For 500 mm distance, reading from distance sensor were varying from 440 to 495.
Problem we are facing: There is no pattern of error rate to use distance sensor predictably.
The REV Distance Sensor is known as a Time of Flight sensor, it’s reading how long it takes for the laser to emit a beam of light that then reflects off the object and return back again. REV sells it as a 2m distance sensor, but most folks agree that its max distance is one fourth of that (accuracy increases when you’re a foot or less away, but requires about 2-3 cm of separation minimum). Regardless, the longer distance a sensor can read the less accuracy you’re going to get, and the shorter the distance the more accuracy you’re going to get. The REV distance sensor also only has about 25 degrees of FoV, so its detection cone is really tight - aiming and seeing the reflection is critical. All things equal, assuming a flat cardboard always perpendicular to the vision of the sensor, I would have expected better. Maybe not crazy better, but better (within 15 mm or so in all cases). Are you sure the cardboard was flat and the return was always within the measurement cone?
The REV Distance Sensor uses a VL53LOX sensor, you can see its depth information in the sensor spec sheets here.
The color sensor can also perform short-range measurements, but that’s “REALLY” short range. In case you want to duplicate your tests short-range.
You might consider an ultrasonic sensor, if speed isn’t a requirement.
The distance sensor has a CONE of light that it puts out, so it’s range is not just based on a single spot. So make sure you are not getting additional reflections from the ground, or from different points on a curved piece of cardboard, or perhaps a nearby hand of foot. The spec sheet shows the angle of the cone… I was surprized how large it was…