Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calibration functions #10

Open
agrath opened this issue Sep 17, 2019 · 3 comments
Open

Calibration functions #10

agrath opened this issue Sep 17, 2019 · 3 comments

Comments

@agrath
Copy link

agrath commented Sep 17, 2019

I am looking at using a VL531X sensor (well, many) for a project.

Our application will require cover glass to be placed over the sensor, which means we will likely need to re-calibrate the sensor as per the manual UM2356, section 3.

According to the manual, the following functions are required:

  • VL53L1_PerformRefSpadManagement
  • VL53L1_PerformOffsetSimpleCalibration
  • VL53L1_PerformSingleTargetXTalkCalibration
  • VL53L1_SetXTalkCompensationEnable
  • VL53L1_GetCalibrationData
  • VL53L1_SetCalibrationData

Plus the data structure for calibration data, VL53L1_CalibrationData_t and VL53L1_customer_nvm_managed_t (containing the 8 RefSpad calibration parameters)

You need to call the first 3 functions in order, with a gray target (17 % reflectance at 940 nm) placed at measured 140mm for the VL53L1_PerformOffsetSimpleCalibration call, then call VL53L1_GetCalibrationData to obtain the values.
These values can then be re-loaded at boot using VL53L1_SetCalibrationData after VL53L1_DataInit and VL53L1_StaticInit (which appear to be unrolled into init)

Cross talk compensation must also be enabled using VL53L1_SetXTalkCompensationEnable if you're using cover glass.

It appears from reviewing the source that the init function of this library presently applies static config calibration data around line 100, however I'm not sure if this additional calibration data from VL53L1_SetCalibrationData is the same.

Would it be possible to have support for these functions added to the library? As far as I can tell, this would make it feature complete.

@agrath
Copy link
Author

agrath commented Sep 17, 2019

Note: https://github.com/pololu/vl53l1x-st-api-arduino/blob/master/vl53l1x-st-api/vl53l1x-st-api.ino provides a way to directly call the API functions rather than using this wrapper, however that looks like a lot of pain that could be avoided

@hennieb
Copy link

hennieb commented Jun 19, 2020

I am looking at using a VL531X sensor (well, many) for a project.

Our application will require cover glass to be placed over the sensor, which means we will likely need to re-calibrate the sensor as per the manual UM2356, section 3.

According to the manual, the following functions are required:

  • VL53L1_PerformRefSpadManagement
  • VL53L1_PerformOffsetSimpleCalibration
  • VL53L1_PerformSingleTargetXTalkCalibration
  • VL53L1_SetXTalkCompensationEnable
  • VL53L1_GetCalibrationData
  • VL53L1_SetCalibrationData

Plus the data structure for calibration data, VL53L1_CalibrationData_t and VL53L1_customer_nvm_managed_t (containing the 8 RefSpad calibration parameters)

You need to call the first 3 functions in order, with a gray target (17 % reflectance at 940 nm) placed at measured 140mm for the VL53L1_PerformOffsetSimpleCalibration call, then call VL53L1_GetCalibrationData to obtain the values.
These values can then be re-loaded at boot using VL53L1_SetCalibrationData after VL53L1_DataInit and VL53L1_StaticInit (which appear to be unrolled into init)

Cross talk compensation must also be enabled using VL53L1_SetXTalkCompensationEnable if you're using cover glass.

It appears from reviewing the source that the init function of this library presently applies static config calibration data around line 100, however I'm not sure if this additional calibration data from VL53L1_SetCalibrationData is the same.

Would it be possible to have support for these functions added to the library? As far as I can tell, this would make it feature complete.

Hello, did you get this resolved? I have a similar scenario and need to calibrate the device with a cover glass in place. Please let me know how you got on with the calibration process.

@Lyr3x
Copy link

Lyr3x commented Sep 23, 2021

That would be really good to have in this library as it has most of the advanced features implemented then, with a usable API. Including the complete API comes with much bloat. That’s why I implemented this library in my project.
Users keep asking for cover glass calibration so I am kind of stuck here as well.
@kevin-pololu do you intend to implement the missing functions?
I’ll check if I could provide a PR but that library is maybe too low level for me 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants