Measuring Vibration with IMU Batch Sampler || Sampling rate inconsistent

I’m trying to log Gyro 1 and Gyro 2 at a sampling rate of 8 kHz using the IMU Batch Sampler to measure vibration. However, when I open the log files in the ArduPilot Filter Review Tool, it shows that my primary gyro is only logging at 1.6 kHz—or sometimes as low as 1.3 kHz. I’ve already tried setting INS_GYRO_RATE to 4k and 8k, but the primary gyro still logs at the same lower rate. The second gyro does log at 4k or 8k, but I can’t review its data because it’s grayed out in the tool.


My configuration:
INS_GYRO_RATE 3
INS_LOG_BAT_OPT 4
INS_LOG_BAT_MASK 3

Additionally, here you can download one of the logs to see the parameters Unique Download Link | WeTransfer

I think IMU1 (ADIS1647x) does not support anything above 2kHz sampling rate (at least that is my conclusion from looking into datasheet). But why it is lower that that - not sure. Perhaps some relation to ardupilot loop rate.

See How to methodically tune any ArduCopter | MethodicConfigurator for information on how to get faster logging on H7 processors

I have tried both batch and raw logging with my Pixhawk 6X Pro with the same results

In this image, you can see I am only getting 1.3 KHz, and gyro 2 and 3 are gryed out

That was unexpected. Thanks for sharing. @iampete can you explain why raw logging is not giving better results?

Batch logging won’t be used if raw is enabled. Turn off INS_RAW_LOG_OPT to use batch logging. You can tell the logging type being used at the top:

If you want to log more than the first sensor you need to set that in the either INS_RAW_LOG_OPT or INS_LOG_BAT_MASK (but not both).

As for the sensor rates the tool reports the rate the sensor is running in the little info line at the top:

The logging rate at the bottom of the box is calculated from the logged data. In this case the logging rate is only a little lower than the sensor rate, and your not dropping log messages, so the problem is not with logging, its just the rate the sensor is running at.

The actual rate you get depends what the individual sensor is capable of, how much stuff there is on the bus, if the DMA is shared with other peripherals (and probably some other stuff). AP tries to converge to a consistent sample rate.

Thanks for the clarification. I was able to successfully perform batch logging and raw logging in my test.

I also tested removing the ADIS, as it wasn’t logging at the rate I was expecting and I was experiencing some instability in Loiter and PosHold modes. From this post — Introducing the Holybro Pixhawk 6X Pro — I saw that the logging rate for Gyro 1 is around 2 kHz.

Using only the IIM and ICM, GPS-based flight modes became significantly more stable — much closer to what I was expecting.

Can you explain why the ADIS is not logging at the expected rate? Is there anything I can change to fix this?

It seems that the slower logging rate of the ADIS may be contributing to instability in GPS modes. Could you please explain why that might be?

I’m attaching links of two flight logs:

  • Log 1: ADIS used as the primary IMU
  • Log 2: IIM used as the primary IMU

Unique Download Link | WeTransfer the link will expire in 3 days let me konw if you need me to extend this one

Thanks !!

ADIS only supports 1KHZ ODR, that’s why it is logging at a slower rate