cancel
Showing results for 
Search instead for 
Did you mean: 

When do I set the ROI on the VL53L1X?

DNg.1
Associate

If I want to take multiple readings on a VL53L1X at different ROI's, I need to set the optical centers for each ROI sequentially, one for each measurement.

But when exactly do I do that, and what are the pitfalls?

e.g. I have a timing budget of 20ms, and an inter-measurement period of 25ms (so 5ms gap between measurements).

Then I start ranging on the sensor.

  1. Is the first sample wasted? Can I set the ROI before I start ranging?
  2. Can I only set the ROI after ranging has started, in the time-budget (actually measurement) phase?
  3. Can I only set the ROI after ranging, but in the same inter-measurement period? (the 5ms window in my example)?
  4. If I can set the ROI in either phase, what are the safety time budgets? (i.e. how close can I get to the ends of the time-window)

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

  1. Is the first sample wasted? Can I set the ROI before I start ranging?
  • NO Set the initial ROI, and then start. You now have Timing-budget milliseconds to set the ROI for the next range. It has to be done after the current ranging starts, but before the next one. The ROI registers are read only at the start of the ranging period.

  1. Can I only set the ROI after ranging has started, in the time-budget (actually measurement) phase?
  • Yes - exactly
  1. Can I only set the ROI after ranging, but in the same inter-measurement period? (the 5ms window in my example)?
  • To be safe I'd do it while you are ranging. The sensor takes some 20ms to take a range. Your MCU is much faster than that.
  • But you might get away with doing during the IM period, the ROI registers get read a the start of ranging. But do check that. Don't take it as gospel.
  1. If I can set the ROI in either phase, what are the safety time budgets? (i.e. how close can I get to the ends of the time-window)
  • I wait a full ms after the start command before setting the next ROI, After I get the data and processes - which is at least a couple of ms, I then update the next ROI.

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

2 REPLIES 2
John E KVAM
ST Employee

  1. Is the first sample wasted? Can I set the ROI before I start ranging?
  • NO Set the initial ROI, and then start. You now have Timing-budget milliseconds to set the ROI for the next range. It has to be done after the current ranging starts, but before the next one. The ROI registers are read only at the start of the ranging period.

  1. Can I only set the ROI after ranging has started, in the time-budget (actually measurement) phase?
  • Yes - exactly
  1. Can I only set the ROI after ranging, but in the same inter-measurement period? (the 5ms window in my example)?
  • To be safe I'd do it while you are ranging. The sensor takes some 20ms to take a range. Your MCU is much faster than that.
  • But you might get away with doing during the IM period, the ROI registers get read a the start of ranging. But do check that. Don't take it as gospel.
  1. If I can set the ROI in either phase, what are the safety time budgets? (i.e. how close can I get to the ends of the time-window)
  • I wait a full ms after the start command before setting the next ROI, After I get the data and processes - which is at least a couple of ms, I then update the next ROI.

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.
John E KVAM
ST Employee

You might also consider not setting an IM period and using a 25ms timing budget. It gives you a more accurate answer at the same timing. Does use a bit more power though. Not settting an IM period just means a new one will start immediately after the prior one finishes.


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.