Harmonic Notch filter not working

Hello. I am running ArduCopter V4.5.7 (2a3dc4b7) on a CubeOrange flight controller. I activated Harmonic notch filter after I performed some flights in order to filter out some gyro noise. Using ArduPilot Filter Review Tool I see that there is apsolutly no filtering done at all. There is no diffrence betwin pre-filter and post-filter data, but I see desired result in Estimated post-filter. What is the issue?
I will post a link for the test flight log as is too big to upload here.

Thank you.
TAROT X6 frame, Tmotor Arm Pack 6007 II 160KV + Alpha 60A HV, P21*6.3", BAT 12S 18A

For starters, change INS_LOG_BAT_OPT to 4 instead. The effect of 5 (so sensor rate logging bit set) makes the frequency resolution larger than it needs to be.

Consider disabling fast IMU in the logs if you have batch logging enabled.


This seems more like a logging problem than the filter not being applied. Since you had high rate attitude and PID logged, you can see that the pitch PID response looks suspiciously similar to the Y axis estimated postfiltered imu data, which suggests to me that the controller saw filtered results even if they weren’t correctly logged in the batch logger. Someone feel free to fact check me.

Edit: two words

Logging settings should be ok for a H7 CPU. I did check the in the Hardware Report web tool. Looks ok. I will soften all logging options after tuning is done. Also there is absolutely no change in behavior of the drone before and after applying the filter. Same lvl of vibrations recorded… :confused:

No surprise there. A properly configured notch filter can have an effect on mechanical vibrations but it’s intent is to filter the vibrations before the gyro rate controller.

Just set the logging batch option to 4 as suggested and make another flight.

Looks like now i can see the postfiltered imu data in the ArduPilot Filter Review Tool. I think it’s enough filtering to start tuning.
Also since I decided to use fixed reference I will disable FFT.

Then disable FFT. No reason to have that running. And you would likely be better served with a throttle based notch.

I would be surprised if Auto Tune completed successfully with the Rate oscillation you have.

The issue is less that the logging settings are “overwhelming” and more that they’re “mutually exclusive in logging behavior for some reason”

FFT disabled. Tried to do autotuning today but wind was crazy. I did some flights. Reduced the PIDs a bit… roll pitch yaw does not look bad on RATE and ATT. What do you mean about “Rate oscillation”. You refer to refer to ROut POut YOut logged parameters? I think those shoud be betwin +/-0.15 right?
Here is the today’s log. After this flight I reduced PSC_ACCZ_P to 0.38 as I saw a lot of oscillations on vertical rate.

https://we.tl/t-94ZYeXFYkx
Las log with PSC_ACCZ_P to 0.38

You forgot the I term. And I would configure a throttle based notch.

I guess I need to reduce I term roughly by the same percentage I reduced the P term… right?

From the wiki:

If you are going to proceed with manual tuning I would suggest a complete read of the tuning docs. And I’m just talking about what’s required leading up to an Auto Tune.

Thank you very much for all the answers. As soon as the weather improves I will start testing again.

Hello again. i did some flights today for autotunning. I started with roll with AUTOTUNE_AGGR 0.075 and AUTOTUNE_MIN_D 0.0002, but after tune ended I saw that D was 0.0002 so the tune was not ok. I modified AUTOTUNE_MIN_D to 0.0001 and then after autotune all values modified also the P and ACC for angle were substantially bigger. Then I did autotune the other axes including yaw D. After all of this i did a test flight in Loiter. I rewied the log and I saw that RATE was wrily good but i saw some oversoot on ATT angles. I will upload this log here. Thes I modified the AUTOTUNE_AGGR to 0.1 and did only ROLL. All PID values increased substantially but after takeoff on the thest flight i saw heavy oscilations. I did autotuning for roll again with AUTOTUNE_AGGR to 0.085. Test flight was ok, log RATE ok but again oversoot on ATT angles :frowning: