2025-01-14 03:55 AM - last edited on 2025-01-14 08:02 AM by Peter BENSCH
Hi,
We have cases when the Sensor Status result is non zero. When it is it is usually a 3 or 255:
#define RANGE_ERROR_DISTANCE_BELOW_DETECTION_THRESHOLD 0x03
#define RANGE_ERROR_OTHER 0xFF
I asked about these in a different post but now I have a somewhat different perhaps more general question. If the Status returns a non zero in any case should the Distance be disregarded -- in all cases? Or, are there certain non zero Status conditions where we should "trust" the Distance versus not "trust" the Distance (reading) returned?
As usual thank you,
Will
Solved! Go to Solution.
2025-01-16 04:30 PM
Error 3 is an odd one. The sensor does the range - and it's really close. Then it applies the offset correction. If the offset is too large in the negative direction and comes up with a negative number, you get a 3 error. It means the target is very close to zero. It really shouldn't happen, but possible if the offset is off. The right answer is very close to 0mm.
And the 255 error could be lots of things. But the range is almost always completely wrong. Don't use that one.
- john
2025-01-16 09:16 AM
Great question Will. There are at least a couple that you might consider valid.
2-Low signal. This can be a warning. A low signal means your measurement will be less precise than the +/- 3% we advertise.
1-High Sigma - Again a warning. The standard deviation is high, but if you don't require accuracy.
4-Wrap-around. This one is tricky. Normally this is telling you your ranging is beyond what the sensor can detect. But in the case of lots of motion, you can get this. If you know that there is motion (robot moving perhaps) then you may use the result. That range was correct for at least part of the motion sequence.
The rest are definite failures.
Here's a list of the errors RangeStatus returns:
0 VL53L1_RANGESTATUS_RANGE_VALID Ranging measurement is valid.
1 VL53L1_RANGESTATUS_SIGMA_FAIL Raised if Sigma estimator check is above the internal
defined threshold.
2 VL53L1_RANGESTATUS_SIGNAL_FAIL Raised if Signal value is below the internal defined
threshold.
4 VL53L1_RANGESTATUS_OUTOFBOUNDS_FAIL Raised when phase is out of bounds.
5 VL53L1_RANGESTATUS_HARDWARE_FAIL Raised in case of HW or VCSEL failure.
7 VL53L1_RANGESTATUS_WRAP_TARGET_FAIL Wrapped target, not matching phases.
8 VL53L1_RANGESTATUS_PROCESSING_FAIL Internal algorithm underflow or overflow
14 VL53L1_RANGESTATUS_RANGE_INVALID The reported range is invalid.
- john
2025-01-16 02:02 PM
John,
Quick followup.
#define RANGE_ERROR_DISTANCE_BELOW_DETECTION_THRESHOLD 0x03
#define RANGE_ERROR_OTHER 0xFF
What happened to error 3 and 255? :)
I know 255 is a catch-all error and likely should result in throwing away the reading.
But what about 3?
Thanks as usual!
Will
2025-01-16 04:30 PM
Error 3 is an odd one. The sensor does the range - and it's really close. Then it applies the offset correction. If the offset is too large in the negative direction and comes up with a negative number, you get a 3 error. It means the target is very close to zero. It really shouldn't happen, but possible if the offset is off. The right answer is very close to 0mm.
And the 255 error could be lots of things. But the range is almost always completely wrong. Don't use that one.
- john