Skip to main content
Associate II
February 20, 2024
Solved

VL53L4CX Two API function problems

  • February 20, 2024
  • 1 reply
  • 1527 views

Hi,

When I get the data returned by VL53L4CX, I have two problems.


1:About"VL53LX_get_device_results()"

The API function "VL53LX_get_device_results()" takes a lot of time. My MCU is 32MHZ and the operation of this function takes me 13ms. Is this time acceptable?

2:About"vl53lx_tuningparm_reset_merge_threshold"

When the distance of the measured object changes, the data obtained by the L4CX is delayed for a few cycles before the new distance is obtained. There are several cycles of error reporting (ErrorCode: sometimes 7,sometimes 255) or old distance before getting the new data. Looking in the manual, it seems that this can be improved by decreasing the"vl53lx_tuningparm_reset_merge_threshold", but even if I change it to 0, it doesn't change anything, am I using it wrong?

Thanks.

This topic has been closed for replies.
Best answer by Zhiyuan.Han

Hi 

Yes, your understanding is correct, this tuning parameter is a threshold to decide when to trig a new round of signal accumulation (or saying reset the signal accumulation). with a fix target, the return signal variation will be very small, this means it will not reset the signal accumulation. But if the scene changed suddenly, ex. a target mov into/out FOV suddenly, the return signal rate will change a lot compare with previous frame, sensor will detect the return signal rate variation bigger than the threshold, the signal accumulation buffer will be reset. 

 

Br

Zhiyuan.Han

1 reply

Zhiyuan.Han
Technical Moderator
February 20, 2024

Hi 

For the 1st question, I test with STM32 F401(84Mhz) VL53LX_GetMultiRangingData() with 400khz I2C, which include VL53LX_get_device_results(), it's around 3ms -4ms from my side, your reading time is a bit long, but still reasonable.  

For the 2nd question, this tuning parameter is used to decide when to trig a new round of signal merge, the sensor will compare current and previous return signal difference, if you set a big value, the scene need have a significant change to trig, that's why the user manual suggest to set a smaller value if you want to improve the latency, please have a try with different value than 0. 

 

Br

Zhiyuan.Han

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
sctzAuthor
Associate II
February 22, 2024

Hi,

Thank you very much for your reply, I understand the first question.

About the second question, I still have some questions.

Can you help explain "trig a new round of signal merge"?
Does it mean that if there is a big difference between the current measurement and the previous one, the current measurement output will keep the result of the previous measurement? And if I change "vl53lx_tuningparm_reset_merge_threshold" ,I can adjust the trigger threshold for this?

 

Thanks

 

Zhiyuan.Han
Zhiyuan.HanBest answer
Technical Moderator
February 22, 2024

Hi 

Yes, your understanding is correct, this tuning parameter is a threshold to decide when to trig a new round of signal accumulation (or saying reset the signal accumulation). with a fix target, the return signal variation will be very small, this means it will not reset the signal accumulation. But if the scene changed suddenly, ex. a target mov into/out FOV suddenly, the return signal rate will change a lot compare with previous frame, sensor will detect the return signal rate variation bigger than the threshold, the signal accumulation buffer will be reset. 

 

Br

Zhiyuan.Han

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.