Hey @Jane Maybe because I’m often working on this real late.. like 1 or 2 AM, I just screwed up some device register addresses. Basic transcription error. D’oh.
Anyway, I now have an enhanced Python driver for the VL53L1X… the PiicoDev driver with added functionality, which enables me to:
- change the TimingBudget (this made a HUGE difference in the consistency of results), and
- choose short, medium or long distance modes
I’ve done both bench tests and in-the wild… on the bench, the standard deviation of measurements dropped from 4mm down to about 0.5mm, at the expense of significantly increasing the TimingBudget, which impacts the frequency of measurements.
I sampled 30 times, in controlled lighting, in all 3 distance modes, with TimingBudget ranging between 90 ms (close to the default value) and up to 800 ms, over 3 different distances - between about 500 mm up to 2400 mm
In my use case, I only read distance once per second, so it works fine for me;-) If you need to read 10 times a second… you’re kinda stuck with what the default settings give you - which has a fairly poor margin of error/high standard deviation. I have not tested absolute distance accuracy - for my app, that’s not as critical as consistency.
Neither have I tackled the RefSPAD, offset and crosstalk calibration methods. I’d be interesetd to hear from anyone who has done this… either in C or in Python.
I also tested the XSHUT function… works fine. My next improvement to my app will be to use this so I can put my widget into sleep mode when nothing interesting is happening.
Final observation: my widget kinda stopped functioning recently. Turns out there was some sort of film over the transmit & receive elements. I had cleaned these with isopropyl alcohol and a cotton bud not long ago, so was a bit surprised when it basically stopped working! Looking at the device under a microscope showed the smeared look. Rectified by using proper camera lens cleaning sheets… with more alcohol… and checking under the scope. Took several attempts before both TX and RX elements looked reasonably clean. After that… everything was working fine again.
Cheers, T.