FFT analysis - Parameter and Hardware requirements

,

I’m trying to use FFT analysis to look at vibration. It doesn’t work for me - and I think it’s my LOG_BITMASK setting and hardware.

  1. From a hardware standpoint - I have a Pixhawk 2.1 with a stock memory card (SanDisk EDGE 8GB MicroSD(HC) Class 4)
    I’m going to upgrade that to a 32GB or 64GB SanDisk Ultra. And set LOG_FILE_BUFFSIZE to 64

  2. I’m not as sure about the LOG_BITMASK setting.

Current setting is 176126 - which is "ALL+FastATT & “NearlyALL” Enabled)

Here’s the log types:

LOG_BITMASK

830:Default
894:Default+RCIN
958:Default+IMU
1854:Default+Motors
-6146:NearlyAll-AC315
45054:NearlyAll
131071:All+FastATT
262142:All+MotBatt
393214:All+FastIMU
397310:All+FastIMU+PID
655358:All+FullIMU
0:Disabled

Is 655369 what I need for FFT? Or can I back off to a less aggressive setting?

Thank you.

KenMc

I’m trying to use FFT analysis to look at vibration. It doesn’t work for me

  • and I think it’s my LOG_BITMASK setting and hardware.

There’s a couple of ways to do FFT analysis.

From a hardware standpoint - I have a Pixhawk 2.1 with a stock memory
card (SanDisk EDGE 8GB MicroSD(HC) Class 4)
I'm going to upgrade that to a 32GB or 64GB SanDisk Ultra. And set
LOG_FILE_BUFFSIZE to 64

That will probably be good. 64GB won’t work, 'though - wrong tech.

I'm not as sure about the LOG_BITMASK setting.

Current setting is 176126 - which is "ALL+FastATT & “NearlyALL” Enabled)

You need “fastimu” to get the GYR and ACC messages at a useable FFT-able
rate.

Is 655369 what I need for FFT? Or can I back off to a less aggressive
setting?

A relatively new feature is “IMU batch sampling”. This cycles between all
your sensors and adds data suitable for FFT to your log. Memory footprint
is low so you don’t need to fiddle memory parameters.

Here’s a feature request for using MP for graphing these:
https://github.com/ArduPilot/MissionPlanner/issues/1647

(not that issue says the feature is a WIP for ardupilot; that’s no longer
the case).

You can enable batch sampling with the IMU_BAT_* parameters:

https://github.com/ardupilot/ardupilot/blob/master/libraries/AP_InertialSensor/BatchSampler.cpp#L6

KenMc

Peter

I’m not clear on how to enable “IMU Batch Sampling”. Can you please elaborate?

Peter -

Thanks so much for the really great detail.

As I work through this I’ll post my results.

KenMc

I’m not clear on how to enable “IMU Batch Sampling”. Can you please
elaborate?

set your IMU_BAT_MASK to 7

After that you’ll have the relevant messages in the log.

This parameter will only exist if you’re running the master branches.

Peter

Huh, I’m running the latest posted 3.6 dev and don’t see that parameter.

Is it the “INS_LOG_BAT_MASK” parameter?

Huh, I’m running the latest posted 3.6 dev and don’t see that parameter.

Gah. INS_ not IMU_

Don’t blame me, it was like that when I got here :wink:

STABILIZE> param show INS_LOG_BAT_CNT
STABILIZE> INS_LOG_BAT_CNT 1024.000000
param show INS_LOG_BAT_MASK
STABILIZE> INS_LOG_BAT_MASK 0.000000

Peter

That did the trick. Data for FFT at 1kHz input. Thanks!

I’ve install the 3.6 dev and trying the same, without success atm.
@dkemxr @peterbarker
I have only 1 IMU, the primary in my copter.
Could you explain what exact value need to be set for:
INS_LOG_BAT_CNT
INS_LOG_BAT_MASK

Setting correctly the above params the LOG_BITMASK need still to be set to FastIMU or FullIMU? (btw before using the 3.6 dev FastIMU never works, only fullIMU let me plot FFT in MP)

Others parameters involved?
…for example I still don’t understand if I need to set INS_FAST_SAMPLE 1.

Thanks

I reported that bug to MP.

I’ve install the 3.6 dev and trying the same, without success atm.
@dkemxr @peterbarker
I have only 1 IMU, the primary in my copter.

Really? That’s not common…

Could you explain what exact value need to be set for:
INS_LOG_BAT_CNT
INS_LOG_BAT_MASK

INS_LOG_BAT_CNT is just the number of samples taken. Must be at least
twice the frequency you’re interested in.

INS_LOG_BAT_MASK is the mask of the IMUs to be logged into the match.
With only one IMU a value of “1” will be OK.

Setting correctly the above params the LOG_BITMASK need still to be set to
FastIMU or FullIMU? (btw before using the 3.6 dev FastIMU never works, only
fullIMU let me plot FFT in MP)

No other parameters need be set for the batch IMU logging.

The concept with the batch IMU logging is that once we have confidence in
it we can have it on all the time. As opposed to the traditional “fast
logging”, which tends to completely flood SD cards all the time - meaning
using it can be a bit of a pain.

Others parameters involved?
…for example I still don’t understand if I need to set INS_FAST_SAMPLE 1.

Not for batch sampling.

Note you can also use the mavfft_isb.py to examine logs which have IMU
batch logging enabled.

Peter

Thank a lot Peter and Amilcarlucas, very appreciated.

@peterbarker
Yes I have a custom made Pixracer with only 1 IMU, fortunatly really good :slight_smile:

For having data for FFT at 1kHz, what the exact value for INS_LOG_BAT_CNT ?
2048 ?? Please help

Hello,

I try to use the BatchSampler functionality, reading the current wiki page about it.
The parameters to set (INS_LOG_BAT_…) do not exist. I assume they have been renamed or replaced. What are they ?

You can configure this in Mission Planner on the FFT screen. Or in the Full parameter list here:
INS_LOG_BAT_CNT
INS_LOG_BAT_MASK

Hint: Entering “batch” in the full parameter list search box will find these…

Thx for helping.
In my case, when I click on FFT Setup, i Get a huge error screen:

I would guess you either need Mission Planner Beta or Copter 3.6Rc1 or both. At least that’s what I’m running.

Yeah, that’s a bug. Can you create an issue with that screenshot for
MisionPlanner? Or just hit the “report” button I guess :slight_smile:

@meee1

Yes I clicked on “yes” to report the issue. So the feature is not existing yet in current 3.5.5 release ? Only from 3.6 ?

Hugues,

I have been using FFT in Missionplanner for a while already - I typically access it from the “hidden ctrl-f” menu". Hit ctrl-f, in the window that opens find “fft” and voila… works for me with 1.3.56 pretty reliably.

Christian

In Copter, yes. But you could run stable rover instead! That will work.

Well, for fft analysis. You may have trouble with the flying bit.