2022-12-07 10:05 AM
Despite many previous questions about how to read histograms from the VL53L3CX, I am still confused how the histogram data is formatted.
I currently read out the histogram as follows:
As the data is output, I then have a python script parsing the data output on the /dev/ttyACM0 serial port.
Here is an example I get for 2 histograms that are printed out sequentially when imaging a wall 0.5m away (ignore bottom plot).
My questions are:
2022-12-08 12:17 PM
there are 2 different histograms. An even and an odd. One has 4 bits of ambient light an 20 active bins. The other has 24 active bins.
the reason is we are trying to detect Radar Aliasing. By having 2 different pulse repitition rates we can tell if the light from pulse N is coming back after the light from pulse N+1.
Take your data and remove the first 4 bins of one of the histograms. They will line up.
That first 'lump' might be photons from your coverglass. (Assuming you have one.)
if you subtract the crosstalk data from the histogram - it will go away.
2022-12-08 12:49 PM
Hi John,
Thanks for the reply!
I am not sure if the extra bump is due to crosstalk. Currently I am using the bare VL53L3CX breakout board without a coverglass (which does not even have a lens). Do you have any other thoughts on what it could be? I could also look into subtracting the crosstalk. How can I access the crosstalk data?
I have a few follow-up questions:
Thank you very much!
Felipe
2022-12-08 02:38 PM
Aliasing is also known as "wrap around".
We shoot out a squart of light. We wait enough time for the light to go out 4Meters and back. This is the wrap point.
Then we shoot out another squirt.
But look what happens if the target is 4.2M away.
The blast goes out, and nothing comes back. So we shoot out another blast.
Then the light comes back.
the sensor concludes the target is 0.2M away instead of 4.2.
So what one does do at least detect this situation is to take another range where the wrap period is 4.2M
If the ranges match, you have a good range.
if they don't match and are a fixed distance apart, you can work out where the real target is up to about 6M.
Otherwise return an error.
I'd average the ranges together. A long term average is going to give you the most accurate range.
if you have two lumps, then one might conclude that you actually have 2 targets.
Use the Evaluation kit and see what it gives you. (log the data, and search the spread sheet for the number of targets.)
2022-12-09 09:17 AM
Hi John,
Thanks for the reply.
I see. I think I kind of understand your radar aliasing (wrap-around) explanation.
However, just removing the first 4 bins does not seem to be sufficient to combine these two histograms. Here are the histograms I obtain when capturing a wall at 0.5m and 1m, and a flat ceiling at 1.5m away. At 0.5m removing the first 4bins of ambient does make the first lump line up well. However at 1m and 1.5m the histograms do not line up. The first lump in the histogram with the ambient bins (red histogram below) seems to be jumping from the beginning of the range to the end of the range.
Histograms of flat wall at 0.5m away:
Here are the histograms of a flat wall at 1m away:
Here are the histograms of the ceiling at 1.5m away:
Furthermore, I am still not understanding how I could be getting two lumps if I am just imaging a flat wall. Here is the 1m capture I did for the histogram above. I just point the sensor to a flat wall 1m away:
2022-12-09 02:37 PM
I had this sort of issues as well.
Instead of trying to look at plots just print out the histogram data - 1 histo per line.
Line them up by hand.
In your first plot, that red line is exactly 4 bins after the blue one.
this makes the average useless.
Once you get the alignment right we can re-evaluate why there are extra 'lumps'.
And try using a real histogram plot.
it made thinks easier for me.
2022-12-13 02:40 PM
Hi John,
Sorry for the late reply.
What do you mean by lining them up by hand? It seems like I would need to apply a different offset for each distance.
I was also compared the results with the VL53L1A2 X-Nucleo board and that board does give me the expected histograms, and after removing the first 4 ambient bins the histogram line up correctly.
Here are the histograms I get at 0.5., 1. and 1.5m for both boards after removing the first 4 ambient bins:
2022-12-14 10:13 AM
The short answer is to your L3 issue is, "Switching the L3CX to long distance mode should give the same results as L1."
As explaination, we have to dig deep into the chip. There are only enough bins to go out 4 meters. (20 bins representing 20cm per each) but the L3 advertizes it can go out 6M. And basically we cheat by using the histogram in odd ways.
If you take the L3 code and simply change it to long distance mode, you will get the histogram you expect.