cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1X - Ultra Lite Driver - Function VL53L1X_GetRangeStatus() return values

Hardwariano
Associate III

Hello.

I'm using VL53L1X sensor with Ultra Lite Driver (ULD). VL53L1X_GetRangeStatus function returns all the time status 13. This value comes from the array "status_rtn".

0693W000003RZ3zQAG.png

Where can I find info about the meaning of these values?

What does status=13 mean?

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

That information is hard to find.

This file has just been released in the VL53l1 STSW_IMG019 release.

This IMG019 software is the full version of our ToF driver and is specifically to run with the VL53L1CB. (A slight improvement over the VL53L1X)

(This software supports Histograms. Something that the VL53L1X does not support. )

But the error return is the same for both the VL53L1X and the VL53L1CB. And is valid for the ULD as well.

Search for and Download STSW_IMG019, and dig out the UM233 document. It's in there.

Your error is that you miss-configured your ROI. They are either too small (must be at least 16 spads) or that they are out of range.

(in the case where your ideal center SPAD is between 2 spads pick the one on the right, or the one ablove.)

13 - VL53L1_RANGESTATUS_MIN_RANGE_FAIL Programmed ROI is not valid, selected ROI is out of the SPAD array.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.

View solution in original post

4 REPLIES 4
John E KVAM
ST Employee

That information is hard to find.

This file has just been released in the VL53l1 STSW_IMG019 release.

This IMG019 software is the full version of our ToF driver and is specifically to run with the VL53L1CB. (A slight improvement over the VL53L1X)

(This software supports Histograms. Something that the VL53L1X does not support. )

But the error return is the same for both the VL53L1X and the VL53L1CB. And is valid for the ULD as well.

Search for and Download STSW_IMG019, and dig out the UM233 document. It's in there.

Your error is that you miss-configured your ROI. They are either too small (must be at least 16 spads) or that they are out of range.

(in the case where your ideal center SPAD is between 2 spads pick the one on the right, or the one ablove.)

13 - VL53L1_RANGESTATUS_MIN_RANGE_FAIL Programmed ROI is not valid, selected ROI is out of the SPAD array.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.
Eleon BORLINI
ST Employee

Hi @Hardwariano​ ,

any feedback from your side on your issue?

-Eleon

Hardwariano
Associate III

Hello @John E KVAM​ and @Eleon BORLINI​ , thanks for your info.

As John said, I had a problem with ROI. I forgot to set ROI center.

        status_ST += VL53L1X_SetROI(I2C_ADDRESS_29, 16, 16);
        status_ST += VL53L1X_SetROICenter(I2C_ADDRESS_29, 199);
        status_ST += VL53L1X_SetInterruptPolarity(I2C_ADDRESS_29, 1);
        status_ST = VL53L1X_StartRanging(I2C_ADDRESS_29);
 
        while(1)
        {
            while (dataReady == 0)
            {
                status_ST = VL53L1X_CheckForDataReady(I2C_ADDRESS_29, &dataReady);
                R_BSP_SoftwareDelay(2, BSP_DELAY_UNITS_MILLISECONDS);
            }
            dataReady = 0;
            status_ST += VL53L1X_GetRangeStatus(I2C_ADDRESS_29, &RangeStatus);
            status_ST += VL53L1X_GetDistance(I2C_ADDRESS_29, &Distance);
            status_ST += VL53L1X_ClearInterrupt(I2C_ADDRESS_29);
         }

The above code now works well (RangeStatus = 0 and Distance = 20cm), at least when ROI area is 16x16 and ROI center SPAD is 199.

But if I replace those values with the values from document UM2555 VL53L1X ultra lite driver multiple zone implementation example, I get all the time:

  • RangeStatus = 2 (VL53L1_RANGESTATUS_SIGNAL_FAIL)
  • Distance = values too high.
        status_ST += VL53L1X_SetROI(I2C_ADDRESS_29, 6, 11);
        status_ST += VL53L1X_SetROICenter(I2C_ADDRESS_29, 223);

The document's example is:0693W000004H7yhQAC.png

Why is this happening?

Regards

John E KVAM
ST Employee

One unfortunate effect of disabling over half the detectors as you did was to cut down the distance the device can 'see'. One can a see a large, reasonably reflective target at 4M. But if you disable over half that SPADs the detection distance would go way down. I'm would generally guess that is your issue.

But you say that you cannot see an object at 20cm? That should not be an issue, unless your object was exceptionally black or there was sunlight involved.

Can you use the Evaluation Kit to simulate your experiment. Then you can use the logging function to see all the data. There might be some hint in there.

Or you could ask for the VL53L1X_GetAmbient() and see if extra ambient is too high.

One other approach is to increase the size of the ROI, and see at what point you see what you need to see. And can you live with that.

Or you can take a sheet of white paper and carefully cross over the sensor. Decide at what angles you are looking. And use it to find your max range.

Knowing where the 'top' is in your diagram is not as easy as you would think.

Then try the same experiment with your hand. (Paper is 88% reflective, Hands are 40-61% reflective.)

Also, increase your timing budget if you can. That helps to find things when the signal is too low.

I use a full half and I can see people walking under a 10 foot tall door. So that's a range of 4 feet or so.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.