Servers by jDrones

IMU Filter Tool

imu
tools
filter
signal-processing
(Guglie) #1

Hi, I want to share a simple python tool to apply FFT to raw IMU logs and then test various filters.

I’m also testing spectral analysis to see how FFT changes over time:


I can clearly see at least 3 different curves, I think relative to the resonance frequency of 3 motors, with their harmonics above.

If you think it can be useful, just tell me where to put it and I’ll make a pull request :slight_smile:

5 Likes
Notch filter is not a notch filter?
(Andyp1per) #2

Very nice, I like it!

2 Likes
(Guglie) #3

Thanks, I would like to make it faster, but I think it’s OK for now.

Side note, actually I’m calculating STFT rather than FFT

(Giorgio Rinolfi) #4

I love it! Thanks Guglie! Please dev, help this guy to integrate ASAP this in Mission Planner :rofl:

2 Likes
(kuspower) #5

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?

(James Pattison) #6

@tridge this could be useful / of interest

1 Like
(Guglie) #7

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.

(Guglie) #8

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
(Andrea Belloni) #9

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

(Guglie) #10

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
(kuspower) #11

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?

(Guglie) #12

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