Servers by jDrones

Suggestion: make an "autotune" for filters

Hi all,

since 4.x copter is out, i struggled a bit to find the “best” tuning of the new filter parameters (starting from INS_GYRO_FILTER to ATC_RAT_PIT_FLTT, and the PSC prefix ones, etc). I ended to what i consider a good setup, but everytime i fly it, i feel that it could be improved. Also, depending on what (payload weight, different propellers,…) i mount on the quad, it can happen it begins to have vibrations etc. So, there’s a possibility that there’s not a unique optimal setup for a given platform, especially bigger ones with “modular” payloads.
So said, and since we have a vibration estimation on-board inside the EKF, i ask myself if it would be possible to implement an PID-style closed loop autotune algorithm which tunes that parameters or even adjust them dinamically during flight. (Sorry, i don’t have the skills to do that). Also, such a dynamic-filter algorithm could adjust values depending on flight envelope, since quads have much different throttle states during hover, translation, raise up, yaw, and bad harmonics can raise during those “transient” states, so it would be very difficult to catch them with a “trial and error” setup method.
I think it could greatly improve flight quality of every size and shape UAV. Admins, let me know if i should open a PR in github.

Yeah im also this problem face some times but I never think about this opportunity and now you raised your hand on this thread.

I hope @xfacta help you out and make new one for everyone :grin:

Happy flying :slightly_smiling_face:

Does the dynamic notch meet this request? ( It’s in Master already, and slated for the 4.1 releases (a few months away).

dynamic filter (afaik) works reading rpm from esc telemetry, which is not a widely spread standard. my idea is to make a loop with vibration feedback

When FFT referenced Dynamic Notch is out of master this could make a more general configuration possible. Assuming the board will run it, not all will. It’s the preferred method now if you don’t have ESC telemetry and running Master. It has worked well on a couple of my craft. Also, bidirectional Dshot will make RPM referenced filters a bit easier to implement. Again, in development but I have found that to work well also on one craft.

1 Like

Yes, by all means open a PR in github.

The FFT support is the way to go here. I have discussed this with Leonard before but he is not convinced it will be particularly viable/useful. The filters are all about what noise you let through but also what control you need - all very dependent on physical factors and only tangentially related to vibration. The greatest source of vibration is motor noise which we already can filter automatically using either FFT or RPM. After that its much more about the physical response of the aircraft.

I really think a much simpler approach is to get the user to input his size / weight and then calculate good defaults from those. As long as you have a working notch you can probably estimate a half decent tune just based on those.


The challenge here seems to be driving the user to the tuning documentation before they maiden the craft. So often it’s; build it, load default firmware and launch it…

Like the single page flyers packaged with many products, “Read this Before Operating” :grinning:

1 Like

Couldn’t agree more. I’ve met a few people building, loading defaults and just flying. Sure it works sometimes. Other times, not so much.

A proper configuration wizard similar to what Flight One uses but much deeper for ardupilot would be really amazing, and make setup for newbs much easier.

Mission Planner used to have a Wizard. But the Ardupilot hardware selection then was pretty slim.

Yea I used the wizard a few times years ago but it left much to be desired.

It would be unworkable today. I think the fact is a certain amount of pilot knowledge thru available documentation is required.

Servers by jDrones