cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple ROI procedure on VL53L1X using ULD - how to?

MJ.2
Associate

Hi,

I'm using ULD to get measurements from VL53L1X. My case need to get 9 ROI - divided FoV into 3x3.

When I run such measurement procedure it with 2x2 = 4 RoI - It's okay. But when I get 3x3 RoI in a similar way I get measurements such as max u16_t = 65535 and my first 3 from 9 RoI center (which I get using VL53L1X_GetROICenter) oscillates around some point.

My measurement procedure is like:

/*run on 3 sensors*/

    status = VL53L1X_GetROICenter(sensorAddr, &roiCenter);

    status = VL53L1X_StartRanging(sensorAddr);

/* ........ */

        while (!allSensorsMeasReady) 

        {

            VL53L1X_CheckForDataReady(VL53L1X_I2C_ADDR_1, &dataReady[0]);

            VL53L1X_CheckForDataReady(VL53L1X_I2C_ADDR_2, &dataReady[1]);

            VL53L1X_CheckForDataReady(VL53L1X_I2C_ADDR_3, &dataReady[2]);

            k_sleep(K_MSEC(2));

            allSensorsMeasReady = dataReady[0] && dataReady[1] && dataReady[2];

        }

        dataReady[0] = 0;

        dataReady[1] = 0;

        dataReady[2] = 0;

/*run on 3 sensors*/

    status += VL53L1X_GetRangeStatus(sensorAddr, &RangeStatus);

    status += VL53L1X_GetDistance(sensorAddr, &Distance);

    status += VL53L1X_ClearInterrupt(sensorAddr); 

    status = VL53L1X_StopRanging(sensorAddr);

/* ....some calculations... */

    setROIStatus = VL53L1X_SetROI(sensorAddr, 8, 8);    //must be

    status = VL53L1X_SetROICenter(sensorAddr, center[Zone]);

Is there any problem with ULD? Or it is a hardware case? I tested such code on a different VL53L1X sensor.

Do I need to change the procedure?

PS Intermeasurement and timing budget is set to 20 ms.

Kind Regards!

Maciej

1 REPLY 1
John E KVAM
ST Employee

The smallest ROI you can use is a 4x4.

I'd use STSW-IMG017

ACTIVE

2D LIDAR using multiple VL53L1X Time-of-Flight long distance ranging sensors

As a reference. It does 13 zones across by setting a 4-wide zone and moving one SPAD at a time.

I like your use of status += VL53L1...

But you really have to check it after a few calls.

And be consistent.

One status = ... will reset the counter, and you won't know if you got an error or not.

(Sorry if you shortened you example for clarity, and then I complained about the missing lines.

if you want the absolute best accuracy, this is what I think you should do.

1) run the offset and crosstalk on each zone you plan to use, and store that data somewhere.

2) each time you change a zone, reload the crosstalk and offset.

You might find the offset for all the zones is the same. If that's the case no need to reload it.

But if you coverglass is not extremely good, your distance values might affect by the crosstalk.

(If crosstalk is the issue, dull targets will range shorter than they should. This is one way to tell you have a crosstalk issue.)

  • john


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.