Skip to main content
RPavl.2
Associate II
April 3, 2022
Question

Strange behavior of the VL53L0CXV0DH sensor.

  • April 3, 2022
  • 7 replies
  • 3563 views

Strange behavior of the VL53L0CXV0DH sensor.

I get the correct data (distance to the obstacle), with a normal change in the position of the obstacle (zoom in / out), the data changes correctly and corresponds to the real distance.

If the obstacle is sharply removed from the "field of view" of the sensor, I get 0 (or very small, 0-25mm, values), although it is logical to get infinity. I can’t understand, is this the usual behavior of the sensor, then I will make a code check or is it some kind of problem with my sensor?

Before that, I used sensors soldered on the board and did not encounter such behavior. The described situation occurs on the board of my PCB ordered in jlcpcb, but once again I will pay attention, most of the data is correct! This baffles me.0693W00000Lwh1bQAB.png0693W00000Lwh1WQAR.png

This topic has been closed for replies.

7 replies

John E KVAM
ST Employee
April 4, 2022

What you are seeing is a 'ghost image'. You are getting a distance you are not supposed to see.

There are some reasons for this.

1) The coverglass is not calibrated. Light from the sensor hits the cover glass and return immediately. These photons get averaged in with the ones that hit the target, and you get a reasonable answer.

But when you remove the target you are left with only the errant photons. And they return a value.

solution is to run the crosstalk calibration.

2) Something is still in your field of view. The sensor 'detects' objects within a code of 27 degrees. But the transmitted light does not fall off immediately. So if you have a reflective object just outside that FoV, it might return enough photons to give you a ghost target.

The solution is to set the minimum signal rate. This is generally 1.5 times the crosstalk you have and is configured when you do the crosstalk calibration. But you can change.

First thing to do is compare the signal strength to your real signal. Is it much, much less? You can use a number 1.5 times that as your lower limit.

-john

RPavl.2
RPavl.2Author
Associate II
April 5, 2022

Hi John, thanks for your reply.

I don't use a cover glass, it's a prototype, it sits on my desk and doesn't need protection from dust or dirt, that is why I am perplexed.

Your second version is better for my case.

I will run some tests and report the results.0693W00000Lwu5vQAB.jpg

John E KVAM
ST Employee
April 8, 2022

calibration is best described partially in the datasheet and in the user manual (which is cleverly hidden in the API one downloads from the web page.

But a short synopsis. If you are constantly off by a couple of cm or less, you need to offset calibrate. Range a lot, at something around 14cm away, and average your results. The difference between your answer and the correct answer is your offset. (There is software to help do this.)

If you don't have a coverglass (and there is nothing near the field of view) you do NOT need crosstalk calibration. This calibration measures the number of photons hitting the glass and immediately returning.

One does it by finding some point where the measured distance is less than the actual distance by 10 or 20%. (This point depends on the reflectivity of your target and the quality of your glass.)

By knowing the right answer and the ranged answer the software can estimate the crosstalk.

Here is where I direct people...

https://community.st.com/s/article/Time-of-Flight-Cover-glass

RPavl.2
RPavl.2Author
Associate II
April 9, 2022

While everything was as a layout, I also thought that I didn't need calibration. I corrected the strange millisecond data tending to zero by simply putting the data in a circular buffer, comparing and ignoring atypical data. But as soon as I put the glass down, and the essence of the project is that the sensor should stand behind the glass and measure the distance, I immediately got something completely different from the truth. So I have one way - to deal with calibration.

Thanks for the answer!

John E KVAM
ST Employee
April 11, 2022

All the received photons are averaged together. But some come from the glass and some come from the target.

That VL53L0X_REG_CROSSTALK_COMPENSATION_PEAK_RATE_MBPS tells the sensor, how much to 'cheat'. Knowing how many photons come from the glass tells the algorithm, how to adjust the final answer.

10 zero distance photons and 90 from the target will average to about 10% short, but if the sensor knows there are 10 zero distance photons, it can add that 10% back in before giving the answer.

You don't need to translate the code. You can do it yourself. Range on a target that returns a distance that is 10 or 20% short. Take several measurements and average them. Then set VL53L0X_REG_CROSSTALK_COMPENSATION_PEAK_RATE_MBPS to something and range again. If you are still short, increase the value. if you are too long, reduce the value. Eventually you will get something that looks about right.

(But using the code is easier.)

There is also a minimum signal rate that should be set to about 1.5 times the PEAK_RATE. This will keep the sensor from detecting a false target (just due to the coverglass.)

Good luck.

  • john

  • john
RPavl.2
RPavl.2Author
Associate II
April 17, 2022

I wrote a long message with a bunch of questions, my mistake was to blame and all the questions are not relevant. I can't delete the message, so I just had to edit it

John E KVAM
ST Employee
April 18, 2022

A 4mm glass is extremely thick. And is the root cause of your issues. You have accounted for the crosstalk, but since so many photons are reflecting off that glass, you don't have enough left over to do what you want.

You can prove this by putting that glass down on the Evaluation kit and trying it. As we know our code works, it will give you the best performance you can get. But I'm thinking you will be unsatisfied.

The only solutions I can think of is to thin the glass, or switch sensors.

Both the VL53L3CB and the VL53L4CX, will fit perfectly. but they are more expensive.

They use a different bit of code that is immune to crosstalk over 80cm. and as this logic is more sensitive, I'm thinking they will work for you.

If you have fifty dollars, buy the X-NUCLEO-53L3A1 or the X-NUCLEO-53L4A2 and test them on the Nucleo F401RE you already have for your VL53L0X Eval kit. Proving it works before you get very far is the key.

  • john
RPavl.2
RPavl.2Author
Associate II
April 19, 2022

John, I received confirmation of my assumptions, it was important for me to understand that I had done everything possible. Thank you for that! I will definitely buy X-NUCLEO-53L3A1 for tests, it seems to me very promising.

RPavl.2
RPavl.2Author
Associate II
April 18, 2022

John, I received confirmation of my assumptions, it was important for me to understand that I had done everything possible. Thank you for that! I will definitely buy X-NUCLEO-53L3A1 for tests, it seems to me very promising.

John E KVAM
ST Employee
November 9, 2022

There are two important measures the sensor returns - Distane of course, but you need to look at signal strength.

A nice solid object is going to return a nice, high single rant - where vapor might get enough signal to return an answer - but the signal rate willl be much lower.

Getting the true signal rate is a bit of a trick however. We have an array of 16x16 SPADs that detect the photons, but if we are getting tons of photons, we turn a lot of those off.

So you neeed to get read the signal rate AND the number of SPADs. Calculate the Signal per SPAD (although I generally normallize it by multiplying it by 200 ( the effective max spad count.)

Signal = (signal_rate / number of spads) *200

Big signal means you have a good target, small signal means you have water vapor.

But where you set the boundry is up to you experiment.

There is also a Sigma value. This is the standard deviation of all the photon timings. I'm very sure that a real target will have a standard deviation that is MUCH less than that of Vapor.

You've been working on this for a long time. Write me an email at john.kvam@st.com and tell me who you are, where you live and give me some idea of what you are building if you can.

  • john
RPavl.2
RPavl.2Author
Associate II
November 11, 2022

The task didn't seem difficult, but i have a problem. Application note - AN 5191 describes in detail access to the values of the SPAD array for vl53L1, but for vl53l0 I can't find something similar. Please tell me where I can read about it?

John E KVAM
ST Employee
November 11, 2022

The VL53L1X has a lens over the receiver SPAD array. So we can tell from where in the field of view the photons came from. The L0, L3 and the L4 have no such lens. So all we know is that a photon struck the SPAD and we counted it.

So the documention on the L0, L3, and L4 is sparce becasue there is nothing you can learn from it.

The one thing you do have is the ability to know how many SPADs were used. If a target is close are very reflective, we will disable some SPADs to limit the power needed to reset them.

Thus to get the true measure of the situation you really should divide the return signal by the number of SPADs and multiply that by 200 to normalize it.

  • john