2025-02-04 08:23 AM
I am trying to run a VL53L8CX sensor at the maximum advertized speed. Originally, following the marketing for this chip, I had thought that this was possible at the full 8x8 sensor resolution, but later learned that that has a maximum speed of 15 Hz (strangely, an associate of mine was able to get it to work closer to 20 Hz, but no faster). We need to have the sensor running at 60 Hz, even if at a reduced resolution, but all examples we can find online are below that 20 Hz threshold. Does anyone have any advice for settings and configurations to bring this sensor to maximum speed? For example, beyond cutting the resolution down by 75%, do we also have to use SPI? Are there any important clock speed values that have to be set to some specific maximums?
For reference, I am running the board with an ESP32 S2 Dev Module board.
2025-02-05 07:36 AM
Sorry for the slow post (technical issues.)
The VL53L8CX affectionately known as the L8 can do 15 frames per second in 8x8 mode and 60 frames per second in 4x4 mode.
The trick is to insure your I2C can handle the data. Depending on which options you choose in the Platform.H file, you can generate some 2000 bytes per frame. And that adds up.
Yes, you can push the sensor to 20 frames. But be a little careful here. Less integration time means a less accurate answer - and you cannot 'see' quite as far. (The sensor does not get as many photon strikes with a shorter integration time.) But if you don't need to see out to the full 4 meters and you have a reasonably bright target, it will work just fine.
We got the results in the datasheet by running at 15 frames, so we set that as the 'practical' max.
But give it a try.
And you might be able to drive the 4x4 to 80 frames, but that's a lot of testing on your part to ensure your answer is good enough for you.
- joh
2025-02-07 09:51 AM - edited 2025-02-07 10:29 AM
I think I understand. Thank you. We have been able to get three 4x4 sensors operating just under 60 Hz now, thanks to the VL53L8CX being capable of 1 MHz trasmission over I2C (in case anyone in the future needs it, here's the command, to be put after DEV_I2C.begin(): DEV_I2C.setClock(1000000)).
I do have one more question though, regarding speed. In our testing, we have found that, when the sensor returns NA for the majority of its measurements, it ends up being a bit faster than when the measurements are within range. I believe this may be due to the limited processing power on the board to accomplish the calculations it is doing for each measurement (as covered in this question). Becuase of this, I would like to deactivate as much of the on-board calculations (for the L8) as possible, so I can choose to do them myself on my more powerful computer or other board.
To do this, I've been looking at the vl53l8cx_api.c file, and having been trying to parse all of the different options available for disabling functions contained within it:
VL53L8CX_USE_RAW_FORMAT, VL53L8CX_DISABLE_MOTION_INDICATOR, VL53L8CX_DISABLE_TARGET_STATUS, and VL53L8CX_DISABLE_DISTANCE_MM, for example.
Do you know of a good resource out there I could use to understand what each of these (not including the ones with obvious names, of course) are doing? And if deactivating them (by defining them in the platform_config_default.h file) will allow the VL53L8CX to operate a little bit faster?