cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L4CD Minimum distance reading

GJohn.4
Associate II

Hi,

I am testing a VL53L4CD sensor for a measurement application. I am using the example code from the API to test out the sensor and I'm having an issue with the minimum distance of the sensor. It will not report a measurement range less than 70mm and when the target is closer than 70mm it reports range status 3. The API documentation says that range status error 3 means that the distance is below the detection threshold but has no other information about the error. I have tried changing the detection threshold to 0 with the API function (VL53L4CD_SetDetectionThresholds) but it had no effect on this error. I don't see any other information in the API manual that appears relevant, but this API doesn't seem to have as much documentation as the APIs for other sensors (I have used the VL6180X a little bit as well, with no issue). Any help with this is much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
GJohn.4
Associate II

Hi,

My coworker was able to work around our issue by using the calibration offset. He set the offset to 70mm then subtracted the same amount from the results data, and this let us measure with the sensor. I would like to fix the issue still, and our testing code is attached.

Thanks

View solution in original post

6 REPLIES 6
Zhiyuan.Han
ST Employee

Hi John

It's quite strange to see error 3 during test, may I get your L4CD testing code and logs, then I will try to reproduce your issue at my side.

Br

Zhiyuan.Han

GJohn.4
Associate II

Hi,

My coworker was able to work around our issue by using the calibration offset. He set the offset to 70mm then subtracted the same amount from the results data, and this let us measure with the sensor. I would like to fix the issue still, and our testing code is attached.

Thanks

Zhiyuan.Han
ST Employee

Hi John

Seems your code sequence is not correct, you need to initialize the L4CD after the platform was initialized.

The example code for VL53L4CD is available on www.st.com

STSW-IMG026 - Ultra lite driver (ULD) application programming interface (API) for the VL53L4CD Time-of-Flight high accuracy proximity sensor - STMicroelectronics


_legacyfs_online_stmicro_images_0693W00000bidKYQAY.png 

br

Zhiyuan.Han

ElectroElegant
Associate

HI,

I see the same phenomenon as soon as I switch from the single ranging example to a multi ranging example. That's the same in the ULP as in the X-CUBE-TOF1 examples. Values ​​smaller than 70mm are no longer output. I have also tried the additional steps of the multiranging examples, such as assigning a different address, in a single ranging example to be able to see where the problem comes from. Unfortunately without success. The 70mm limit only comes up at >1 ToF sensor in my case. Is there a recommendation?

Thanks

Excellent, GJohn.4!

I had the same problem with a 3 VL53L4CD sensor s array, and you saved my life!

I tried setting various values using VL53L4CD_SetOffset(....) and then subtracting the offset from the result.

At the end I decided to use an offset of 50, so I got the sensor working down to 20 mm and get error #3 beyond 21 mm.

Thanks again for your precious suggestion!

dimitarkunchev
Associate

I stumbled across this problem while implementing an integration of the VL53L4CD sensor. I didn't use the library code. After some head scratching I found the problem was not setting all default values for the registers. Many of them are described as "not user-modifiable", but unless you set them to the values from the library the sensor behaves weirdly. In particular, it can't measure anything below 70mm and just gives status 3. Just as you describe.

I think some proper documentation of the registers might help.