cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L8CX ULD Driver Performance Issues with Gesture Recognition

Jason Mount
Associate III

@John E KVAM

I ported the gesture recognition example (STSW-IMG035_F401) from the STM32F401RE to the NUCLEO-U575ZI-Q with the X-NUCLEO-53L8A1 and the gesture library (STSW-IMG035_M33).  If I used the VL53LMZ_ULD_API driver included with the GestureKit it seemed to work fine; all gestures were recognized. If I used the VL53L8CX_ULD_API driver (STSW-IMG040), it worked poorly; only the TAP gesture was recognized (and even that was inconsistent).  This was repeatable on the same hardware;  I could load and calibrate the MZ based project and it worked fine, then I could load and calibrate the 8CX based project and it would only recognize the TAP gesture.  I was surprised that the driver intended for the specific part performed worse than the generic one.

I've attached the two ported projects (one using the MZ driver and one using the 8CX driver) for comparison.

Have I missed something?

 

Note: One significant difference I just found was that If I held a book at about 20cm over the sensor with the MZ firmware, it displayed values like:

    LC 32, Z = 198.7, Polar: r = 40.9, Theta = 99.6
The same test with the 8CX firmware displayed values like:

    LC 0, Z = 50.5, Polar: r = 2.5, Theta = 187.1

 

 

My test setup:

=======================

Build environment:

STM32CubeIDE

Version: 1.15.1

Build: 21094_20240412_1041 (UTC)

 

Hardware and physical setup:

NUCLEO-U575ZI-Q with X-NUCLEO-53L8A1 attached using the included 1.0mm spacer and cover, lying flat on my bench with the sensor facing the ceiling about 1.3m above.

If I held my hand in view of the sensor within about 0.5m, the LC messages would start printing.

 

115200-8-1-n serial communication over the default USART1 Virtual Com Port

 

I entered the following commands:

calibrate xtalk

to calibrate the cross-talk due to the cover

enable

to start the gesture recognition

 

I performed the 6 gestures at about 20cm above the sensor:

TAP, Double TAP, LEFT Swipe, RIGHT Swipe, UP Swipe, DOWN Swipe

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
labussiy
ST Employee

Hello Jason,

There is a macro called "VL53LMZ_USE_RAW_FORMAT" that is formating (or not) the sensor data. Typically, the distance will be divided by 4.

In Gesture example, we are using this macro and it declared in "plateform.h".

I suppose the macro is not defined in your code.

Thanks,

Yann


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'

View solution in original post

3 REPLIES 3
Jason Mount
Associate III

I have what appears to be the same issue in my other development environment even when using the MZ driver and no cover glass.  The distance calibration appears to be off by a factor of 4; holding my hand 400mm above the sensor reads as 100mm.

What could cause the measured distance to be reduced by a factor of 4?

labussiy
ST Employee

Hello Jason,

There is a macro called "VL53LMZ_USE_RAW_FORMAT" that is formating (or not) the sensor data. Typically, the distance will be divided by 4.

In Gesture example, we are using this macro and it declared in "plateform.h".

I suppose the macro is not defined in your code.

Thanks,

Yann


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'

That was it, thank you!

Both ported demo projects have that macro defined, but when I switched from the VL53LMZ_ULD_API driver to the VL53L8CX_ULD_API driver, I didn't change that macro name to VL53L8CX_USE_RAW_FORMAT.  In my main project, it was commented out and I somehow missed it.

I didn't see any mention of the 4x reduction in distance measurement in the documentation, but it's there in the code. 

Thanks,

Jason