Page 1 of 1

How to increase output frequency of multiranger deck?

Posted: Thu Apr 07, 2022 3:49 am
by hamsterasu
I see this line in multiranger.c :

vTaskDelayUntil(&lastWakeTime, M2T(100));

I decreased it but the maximum frequency I can get seems to be around 15hz only. Meanwhile, in this thread(viewtopic.php?t=4764), I see that the developers were able to get 25hz.

How do I increase the output rate of the multiranger deck further?

Re: How to increase output frequency of multiranger deck?

Posted: Fri Apr 08, 2022 6:44 am
by tobias
You need to adjust the VL53L1 timing budget as well. Check zranger2.c for an example. There is a trade-off in accuracy and range though. I suggest you to consult the VL53L1CX datasheet for more details.

You can probably do this in multiranger.c (have not tested)

Code: Select all

  // Init VL53
  if (vl53l1xInit(pdev, I2C1_DEV))
  {
      // Configure timing budget	
      VL53L1_SetDistanceMode(&dev, VL53L1_DISTANCEMODE_MEDIUM);
      VL53L1_SetMeasurementTimingBudgetMicroSeconds(&dev, 25000);

      DEBUG_PRINT("Init %s sensor [OK]\n", name);
      status = true;
  }
  else
  {
      DEBUG_PRINT("Init %s sensor [FAIL]\n", name);
      status = false;
  }

Re: How to increase output frequency of multiranger deck?

Posted: Mon Apr 18, 2022 4:50 am
by hamsterasu
Thanks! I added the lines

Code: Select all

      VL53L1_SetDistanceMode(&dev, VL53L1_DISTANCEMODE_MEDIUM);
      VL53L1_SetMeasurementTimingBudgetMicroSeconds(&dev, 25000);
and I was able to get around 20hz now.