How to increase output frequency of multiranger deck?

Firmware/software/electronics/mechanics
Post Reply
hamsterasu
Beginner
Posts: 6
Joined: Tue Mar 01, 2022 3:40 am

How to increase output frequency of multiranger deck?

Post 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?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How to increase output frequency of multiranger deck?

Post 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;
  }
hamsterasu
Beginner
Posts: 6
Joined: Tue Mar 01, 2022 3:40 am

Re: How to increase output frequency of multiranger deck?

Post 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.
Post Reply