IMU Filter Tool

Hello, where we can download your python app for test? Also can you tell how to set ardupilot filters following filter tune done with your app?

@tridge this could be useful / of interest

1 Like

Thanks to all, I have created a pull here in the Tools folder as suggested by @amilcarlucas https://github.com/ArduPilot/ardupilot/pull/11603

I’ve also made a lot of updates to the tool, now it works on all 3 axis, it sets the filter defaults reading the parameters of the log and on closing it prints the parameters to set the filters.

You can run it passing a log as command line argument, if not it should open a file picker GUI.

The code surely needs a cleanup and has some dependencies, I’ve tested only with python 3.

This has been merged in master in Tools/FilterTestTool

Let me know if it is working for you and if you need other features!

1 Like

Thanks @guglie for this useful tool.
One question: the AccX part is only useful if one apply your PR, is it right?

Yes, but now you should not see the notch on the accelerometer if the firmware that recorded the log doesn’t support it.

And you should also see AccY and AccZ. Only on first IMU for now.

1 Like

Hello I tried your python script on windows with python 3.5. I installed all modules requested by the scrip, but finally i cant get it working, nothin happens.

Sorry I’m newbee on this but maybe i forget on detail for it work and maybe you can help me to get it work?

Hi, I don’t use Windows, but I can try to help.
Do you see some kind of error or the program hangs?
Sometimes the file chooser window opens in background.
You can try to call it from a command line with a log file argument, E.g.

python3 run_filter_test.py logfile.bin

What are the log file parameter prerequisites for this to work? I assume this requires the Batch processing parameter like FFT? For high logging rate?

Hi! No, FFT batch logging is not required as this FFT analysis is performed on raw IMU logs, so I think the minimal bitmask to enable this is LOG_BITMASK = 786560

Maybe in the future we can visualize and compare also a batch FFT, but raw imu logging is already a considerable load, so I don’t know how the logger can handle it.

Also if you see holes in the log you can try to increase LOG_FILE_BUFSIZE.

Can the LOG_BITMASK and other parameters required for this to work be documented in the README.md file ?

Hi @guglie nice tool! Im also trying to run it on Windows but have had no success, the program hangs. Tried running it via cmd too but no success there either.

Hi, thanks! Have you tried the following written above?

Hi. Yes I did but it wasnt working. I tried it on another Linux machine and it seems to be working fine now, needed to install some packages (tk and pymavlink) but other than that all good!

Ok it works on Windows too forgot to install pymavlink, my mistake.

Is it complicated to change this to use the batch sampler ?

1 Like

To see effects of filters I suppose it’s not simple, because you need original signal to simulate the appliance of filters.

Maybe the effect of filters can be estimated using only FFT batches, but I don’t know how to do it.

Batch sampler simply stores 32 samples in a single log_write() function call.
The IMU_RAW that you use needs 32 fuction cals to log_write() in order to log the same amount of data.
The batch sampler is simply more efficient and has less overhead.

The batch sampler does not perform FFT!! the FFT is performed on the ground station.

1 Like

@amilcarlucas Oh, sorry I wasn’t aware of that! Thought it was a FFT batch to reduce log size, not only to reduce log_write() calls.
So yes we can use batch sampler!

I just need to check the log message format

Hey @guglie I have this working but I thought I saw a graph from you which showed frequency over time? How do I do that? Or is that a different tool?