cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine length of histogram bin width - VL53L3CX

v++
Associate II

Hello community,

How to know the length in distance for the width of each bin in range histogram?

Also some clarity of how these widths are generated (if there is any documents on this) will be helpful.

  1. a histogram is made of 20 bins
    1. what is distance of the whole histogram (x-axis)
    2. consequently if I divide this by 20 I expect to get distance per bin
  2. How does this distance of whole histogram relate to the 5meter maximum range of the sensor ?
    1. for instance if I placed an object 5meters away from sensor and generated 20 bin histograms, would it imply the width of the histogram is 5meters ?
      1. if not could you please share some details on how this is measured ?

Thank you

V++

2 REPLIES 2
John E KVAM
ST Employee

for the VL53L1, VL53L3 and VL53L4 the histogram bins are 20cm. It has to do with the clock speed of the device. 20 bins at 20 cm is = 4Meters. The 24 bin range extends this a bit.

If I were you, I'd only look at the first 20bins and consider the max as 4Meters.

It took us years to extropolate that data and get the longer range.

The first bin containing a number of counts is where your target is. But that only gets you to 20cm accuracy.

But consider the case where the target is exactly at 80cm. Bins 0 and 1 will contain ambient light levels and bin 2 will contain a full-height signal. As the laser is on for 2micro seconds, bin 3 will also contain a full hight signal.

Now consider a target at 90 cm. Bin 2 will contain only a half height signal, bin 3 will contain a full height signal and bin 4 will contain a half-height signal.

As the target moves farther away, the initial bin will get lower until it disappears completely.

Use the ratio of the initial bin and the next one to determine where in the bin the target is.

And please note, this is the ideal case. The laser does not fire at exactly the start of a bin and it does not turn off exactly after 2microseconds. So there is going to be an offset.

Compare the range we calculate to the bin structure to detemine that offset.


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'
v++
Associate II

Thank you so much @John E KVAM​. One thing still unclear to me is the case of a target placed at lets say 20mm (datasheet says sensor can detect up to 10mm).

In such case, can I expect my peaks to start from bin 1 ? If not why ?

Did a small experiment to test this. For the same brown tile I started ranging from about 60mm then repeated ranging for same tile from about 127mm. Both of these started peaks from bin 5 (100th centimeter range). Why did both 60mm and 100mm distance not start peaks from lets say bin 1 ? As the first bin is 20cm == 200mm. Both 60mm and 127mm are less than 200mm.

attach the logs for more details.

Kindly help me clarify this properly.

Please note I have modified the label names/descriptions a bit from the code for my own understanding in case it doesn't match the default labels.