Tuning the Harmonic Notch

Andy, how’s dynamic notch and autotune supposed to work together !? I’ve tried an autotune on an already tuned and filtered quad, and luck played a better part in having it back on land in one piece.
I can’t tell exactly what it went for in PIDs, but once I started trying to fly those, I couldn’t revert back to the old ones until it was on ground and I cycled power.

Everyone was in hurray mode, rc5 turned into rc6, Randy was searching for a video for 4.0 launch, but take a look at those DesRoll/Roll and DesPitch/Pitch graphs at the end of the flight. I don’t count scratches on the landing pads, and it didn’t get one elsewhere, but still, maybe we shouldn’t be allowed to run autotune after applying the harmonic notch filter, or something :wink:

What were the symptoms after autotune? Shaking/oscillating? Very sensitive and difficult to control? Very slow to respond or ‘drunk’ feeling, so difficult to control?

I’ve run autotune on several copters after applying the harmonic notch, without any problems. It gave them higher PID’s, but that’s what I wanted for these particular copters.

That’s exactly my experience too - better results - I’ve never ended up with a dodgy tune.

I don’t think this is a Notch problem. Your pitch axis ended up very low because your aircraft was not responding symmetrically in the pitch axis. I am not sure why this is but it could be an offset CG, week motor, wind or something similar.

I am not sure why you could not switch back and forth between your PID’s. I will need to look into that further.

Also from my experience I had no problems to run autotune after applying harmonic notch.
In some cases I reduced the obtained PID as suggested here (https://ardupilot.org/copter/docs/tuning-process-instructions.html#autotune) to have a smoother response but it is a matter of taste.


Hello.
I also wanted to show the filter result in following the throttle.
Attached: vibration without a filter, with a 100hz static filter and a harmonic filter following the throttle (I will add that flying at 40 km / h wind). As you can see, it works great.

Question for the group… I grab the DF logs and then click FFT then ‘new DF log’

I then give it the .bin file and nothing happens.

Then if I try clicking “run all IMUs” I get data in the screens.

Other then enabling the INS_HNTCH_MODE=3 (yes I have esc telemetry)
and INS_HNTCH_REF=1

Do I need to do anything else?

Thanks

INS_LOG_BAT_MASK = 1 (or 3 for two IMUs)
and
INS_LOG_BAT_OPT = 2 for post-filter sampling or 0 for pre-filter

Thanks @andyp1per I will give it a test today.

Do you guys think it is worth setting the notch filter on big quads too? I mean 30 inch props quad.

Probably… Make a pre-filter and post-filter FFT to see if you have any peaks that the lowpass isn’t taking care of, which could be targeted with the notch.

Ok thanks, will try.

Is the process here to do a pre filter, then a post filter and compare the results? Does looking at the post filter or prefilter alone tell you anything?

I did a quick flight and I have the INS_HNTCH_MODE=3 and INS_HNTCH_REF=1

I did a post filter sample and I have the following.

Is this good? Bad? Do I need the prefilter to look at as a comparison?

Thanks

Dave

Is that with the notch enabled? If not, then that’s probably good enough, and you need a notch around 63hz. If that is with the notch enabled, then a pre filtered image will tell us how much it’s helping and if it needs adjustment.

These are my current settings:
|INS_HNTCH_ENABLE|1|
|INS_HNTCH_FREQ|80|
|INS_HNTCH_BW|20|
|INS_HNTCH_ATT|15|
|INS_HNTCH_HMNCS|3|
|INS_HNTCH_REF|1|
|INS_HNTCH_MODE|3|

I can try another test flight using pre filtering a little later on this evening

You might want to lower the frequency to about 60. I believe that parameter is the low end of what it will filter, and it looks like there’s some noise down there…
Set the bandwidth to about 30.
ATT to 40.

Be sure Servo_Blh_Poles matches the poles for your motor.

What size copter is this?

This is a Tarot 680 hex with 13inch props Using a CUAV V5+ cube FC with Holybro Tekko32 metal ESCs running dshot300

The copter was just finished being built. I haven’t even done autotune yet

I have set the proper number of poles for my motors

@wicked1

I made the changes you said with the exception of the ATT… Max is 30.

Here are the results:

Then I checked the prefilter and got the following:

So the filtering is clearly working… looks like I just need to tune it

Looks great! That’s a big improvement from pre-filtered.