2025-05-02 3:34 AM
Hi all,
I'm currently developing test code for the VL53L1 ToF sensor using STM32CubeIDE, and I'm aiming to optimize the sensor's performance for close-range measurements — specifically in the 10mm to 200mm range — with a target accuracy of around 1–2%.
I'm currently using the bare driver files provided by ST, which I’ve manually integrated into my STM32 project.
I'm aware of the various distance modes (Short, Medium, Long) offered by the sensor, and I plan to experiment with them. From what I understand, the Short distance mode is generally preferred for close ranges due to better ambient light immunity and reduced signal crosstalk. I'm also considering manually configuring a Region of Interest (ROI) centered around the sensor’s optical center to help reduce edge-related anomalies.
My questions to the community are:
Which distance mode and ROI settings have yielded the best results for others in this close-range context?
What other parameters should I tune to achieve maximum accuracy over this short range? I’ve read a bit about tweaking:
Timing budget
Inter-measurement period
Sigma threshold
Signal rate threshold
I can afford a slower sampling rate (~200ms), so I’m happy to increase timing budgets or reduce the measurement frequency if it improves consistency and accuracy.
Any insights, advice, or sample configurations would be greatly appreciated!
Thanks in advance,
Matthew
2025-05-02 10:23 AM
the reason 'short' works better for the short distances is that the pulse repetition rate can be faster.
We don't need to wait as long for the light to go out to the max distance and come back. And more pulses = more accuracy. But if you can afford 200ms it really doesn't matter that much. You have plenty of pulses.
But what really counts is the quality of your target.
If you have something like a piston moving in and out, and want to know where that piston is, you can choose a relatively reflective target giving you lots of signal. And a matte finish is preferred.
At 20cm you are going to have lots of signal and choosing an ROI does make sense.
I'd get some idea of how many SPADs your system is using and create a region slightly larger than that.
If you are only using 10 SPADs worst case a 4x4 area would be fine.
20cm is NOT very far and I'd be willing to be a 4x4 will be fine. But if you have a dull target, then a 5x5 might be required.
Sigma and Signal settings allow the chip to return a different status if the Sigma is too high or the signal too low.
But they really don't affect the range. It's more like a warning. But in your case if you get either of these then you need more SPADS.
the Inter-measurement period is only useful if you want to save power and only need sparce ranging. It allows the chip to rest in between ranges.
If you want the best accuracy, consider building system where the temperature does not vary. Changes in temperature affect the sensor. And it self-heats to a minor degree.
- john