Measuring Vibration with IMU Batch Sampler¶
The IMU BatchSampler can be used to record high-frequency data from the IMU sensors to the dataflash log on the flight controller. This data can be analysed post-flight to diagnose vibration issues using graphs created from Fast Fourier Transforms (FFT) of the data.
FFT transforms data from the time domain into the frequency domain. Put another way, accelerometer data recorded over time (i.e. a flight) can be converted into a graph showing the frequencies of the vibration. A frequent feature of these graphs is a spike at the propeller’s “blade passage frequency” (the frequency at which the blade crosses over the arms) which causes an acceleration in the aircraft body. FFT has the following limitations:
- FFT can not show you frequencies above half your sensor’s sampling rate
- The smallest frequency that can be shown is half your sample size divided by your sample rate
Flight and Post-Flight Analysis¶
- Perform a regular flight (not just a gentle hover) of at least a few minutes and download the dataflash logs
- Open Mission Planner, press Ctrl-F, press the FFT button, press “new DF log” and select the .bin log file downloaded above
- Accelerometer data appears in the top left window with the vertical access showing the amplitude and horizontal axis showing the frequency. The amplitude is not scaled to a useful value meaning the graph is useful for determining the frequency of the vibration but not whether the levels are too high or not. Vibration at frequencies above 300hz may lead to attitude or position control problems.
Advanced Configuration and Analysis¶
- Set INS_LOG_BAT_OPT = 1 to enable batch sampling at the sensor’s highest rate which allows analysis above 500hz for very fast IMUs from InvenseSense
- INS_LOG_BAT_MASK can be used to sample just a single sensor. This will increase the number of samples retrieved from a single sensor (e.g. the best on the platform), which may provide better data for analysis
- INS_LOG_BAT_CNT specifies the number of samples which will be collected. Increasing this will yield a more representative idea of problem frequencies. When divided by the sample rate will give the smallest frequency which can be detected, so 1024 samples at 1024kHz sampling will (poorly) pick up 0.5Hz frequencies
- INS_LOG_BAT_LGIN interval between pushing samples to the dataflash log, in ms. Increase this to reduce the time taken to flush data to the dataflash log, reducing cycle time. This will be at the expense of increased system load and possibly choking up the dataflash log for other messages
- INS_LOG_BAT_LGCT Number of samples to push to count every INS_LOG_BAT_LGIN ms. Increase this to push more samples each time they are sent to the dataflash log. Increasing this may cause timing jitter, and possibly choke up the dataflash log for other messages
The following two graphs are from the same flight on a PixRacer flight controller. Accel on the right is the InvenseSense IMU and shows higher frequencies than the slower IMU on the left
Log Message Contents¶
There are two types of dataflash log messages involved in batch sampling, ISBH and ISBD.
- ISBH is a batch header; it includes a batch number and metadata about the batch.
- ISBD messages contain the actual data for the batch, and reference a header by batch number.