ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Fast ICM42xxx performance

Open andyp1per opened this issue 2 years ago • 7 comments

At faster gyro backend rates (e.g. 4khz) the per-tick CPU load becomes quite important. This change reduces the CPU load a couple of ways:

  • Increases the SPI clock on the MatekH743 to 16Mhz for the ICM42xxx gyros which are rated at up to 24Mhz (cannot currently get higher than 12.5Mhz because of the clock divisor). This gives about a 30% reduction in per-tick time.
  • Synchronizes the ticks with the data. Before there were a lot of redundant ticks because data wasn't quite ready. Now the next tick is calculated from the time at which data is received.

andyp1per avatar Aug 03 '22 11:08 andyp1per

Would this also apply for the Zealot H743 which has a ICM-42688-P?

timtuxworth avatar Aug 03 '22 14:08 timtuxworth

Would this also apply for the Zealot H743 which has a ICM-42688-P

Yes, but manufacturer would need to confirm it is safe

andyp1per avatar Aug 03 '22 14:08 andyp1per

Would this also apply for the Zealot H743 which has a ICM-42688-P

Yes, but manufacturer would need to confirm it is safe

I've checked with QIo-Tek, they say this fix isn't necessary because their design doesn't have the problem this is fixing.

timtuxworth avatar Aug 03 '22 14:08 timtuxworth

I've checked with QIo-Tek, they say this fix isn't necessary because their design doesn't have the problem this is fixing.

Which can only mean they are not using this chip

andyp1per avatar Aug 03 '22 14:08 andyp1per

I've checked with QIo-Tek, they say this fix isn't necessary because their design doesn't have the problem this is fixing.

Which can only mean they are not using this chip

It needs to be tested. Will higher sampling make the sampling accuracy of the sensor different? We haven't conducted actual hardware testing yet. We need to compare with the previous sampling speed.

QioTek avatar Aug 03 '22 15:08 QioTek

It needs to be tested. Will higher sampling make the sampling accuracy of the sensor different? We haven't conducted actual hardware testing yet. We need to compare with the previous sampling speed.

For the 42688 the sampling is all done at 32Khz regardless of ODR. Higher ODR allows higher AP filter settings. This issue is addressing some issues that might be seen with higher ODR - mostly because the tick latency becomes more important

andyp1per avatar Aug 03 '22 15:08 andyp1per

Flew four batteries on this today - all worked great

andyp1per avatar Aug 07 '22 16:08 andyp1per

tested on Pixhawk6X, works well!

tridge avatar Aug 12 '22 10:08 tridge