cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1X when to trust readings?

will3
Associate III

Hi,

 

typedef struct {
uint8_t Status; /*!< ResultStatus */
uint16_t Distance; /*!< ResultDistance */
uint16_t Ambient; /*!< ResultAmbient */
uint16_t SigPerSPAD;/*!< ResultSignalPerSPAD */
uint16_t NumSPADs; /*!< ResultNumSPADs */
} VL53L1X_Result_t;

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

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


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

View solution in original post

3 REPLIES 3
John E KVAM
ST Employee

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

 


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

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

 

 

John E KVAM
ST Employee

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


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.