cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1: Could you give some help on per-zone offset correction please?

MVand.3
Associate II

My application requires scanning multiple zones (ROIs) and comparing the results. When I do this I see an offset that varies somewhat randomly based on the shape and position of the ROIs. I see in the UM2133 user manual that there is a calibration procedure to correct offset per zone:

VL53L1_SetOffsetCalibrationMode(Dev, VL53L1_OFFSETCALIBRATIONMODE_MULTI_ZONE);

and to apply the correction per zone:

VL53L1_SetOffsetCorrectionMode(Dev, VL53L1_OFFSETCORRECTIONMODE_PERZONE);

My question is: Could you explain how this multizone calibration and correction works and where the per-zone data is stored? The data structure in the following quote from the user manual is only for the overall offset calibration right? There would need to be offset data stored for each ROI right? Thanks, Martin

6.3.4 Offset correction options In multizone scanning mode, the offset correction can be improved by using a per zone calibration. If the calibration is made using this option, the user can apply a per zone calibration by calling: VL53L1_SetOffsetCorrectionMode(). The two possible options are: • VL53L1_OFFSETCORRECTIONMODE_STANDARD (default) • VL53L1_OFFSETCORRECTIONMODE_PERZONE

6.3.5 Getting offset calibration results The function VL53L1_GetCalibrationData() allows the reception of all calibration data. The returned structure VL53L1_CalibrationData_t contains another structure called VL53L1_customer_nvm_managed_t which contains the three offset calibration results: • algo__part_to_part_range_offset_mm • mm_config__inner_offset_mm • mm_config__outer_offset_mm 

3 REPLIES 3
John E KVAM
ST Employee

Sorry for the slow reply. I'm supposed to get notified of an entry, but basically the tool *****. Not an excuse, I should have watched more carefully.

If you are going to use multiple zones, you will need to calibrate the offsets for each zone.

this code will do that for you and update your offset everytime the zone is changed.

If you were to use the ULD driver, you would have to do this yourself. Between each range one much change the zone and update the offset before the next range starts.

With the VL53L1CB code, this is done for you. make the calls to set up your zones, and then calibrate.

This code does exactly what you think it should - set the zone, range a bunch of times, compare the known result with the sensor result, and store that difference.

then when running, it will update zone information for you and at the same time, update the offset.

It's automatic.

  • 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.

Thanks for the reply John. I'm actually not sure if I'm using the ULD driver or the CB code. Does this code block in vl53l1_def.h help to figure it out?

/** VL53L1 IMPLEMENTATION major version */
#define VL53L1_IMPLEMENTATION_VER_MAJOR       6
/** VL53L1 IMPLEMENTATION minor version */
#define VL53L1_IMPLEMENTATION_VER_MINOR       6
/** VL53L1 IMPLEMENTATION sub version */
#define VL53L1_IMPLEMENTATION_VER_SUB         1
/** VL53L1 IMPLEMENTATION sub version */
#define VL53L1_IMPLEMENTATION_VER_REVISION  2432

John E KVAM
ST Employee

you are using the full CB driver. The Ultra Lite Driver is 700 lines of C code and some .h files. Plus a bit more for calibration. But it's really lite.

the code you are using does all that for you.

Once you set up your zones, it does all the switching. That's one reason it's so large.

I was just trying to point out what the code is doing.

  • 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.