2024-11-26 02:28 PM
An anonymous customer was trying to get the best possible range accuracy with a VL53L5 sensor.
His temperature range was from 25degrees C to 50 degrees. This was his plot with no temp cal.
After calibrating between the ranges he got:
These plots have different temperature ranges and scales. But between 25 and 35 degrees, the top shows a drift of 10mm whereas the bottom shows a drift of 1mm.
He tells me the calibration takes a while which is a reason to skip it, but if you really need the accuracy, it's worth trying.
He did not show me what he was doing, but I'm betting it's:
/**
* @brief This function is used to set a periodic temperature compensation. By
* setting a repeat count different to 0 the firmware automatically runs a
* temperature calibration every N frames.
* default the repeat count is set to 0
* @PAram (VL53L5CX_Configuration) *p_dev : VL53L5CX configuration structure.
* @PAram (uint32_t) repeat_count : Number of frames between temperature
* compensation. Set to 0 to disable the feature (default configuration).
*/
uint8_t vl53l5cx_set_VHV_repeat_count(
VL53L5CX_Configuration *p_dev,
uint32_t repeat_count);
There is also an associated 'get' function.
If you don't expect much temperature variation, set this number kind of high, but it could be set to one. Will affect the speed though.