Tuning the Harmonic Notch

What?!? Leonard doesn’t know the specifics of every single users build?!? :slight_smile:
ESC telemetry really does make setting it up easy.

Dave, It looks good. You could try a bit more attenuation. I don’t know what a safe upper limit is, though. But you could probably get the FFT a bit flatter.
Maybe narrower, like 30 bandwidth, and increase the attenuation to 50… (assuming you have ATT at 40 now). It’s probably good as it is, but you could try a few other values if you want to experiment with it.

I’m not sure if there is a way to know how much attenuation to apply based on the FFT. I know early in the days of the FFT there wasn’t…

3 Likes

I recommend using 40 as it is pretty much a perfect notch then. The only reason we have a parameter for this at all is because the fixed notch can be used for other more advanced control applications like canceling a resonance in the control bandwidth where you only want “just enough” to do the job.

We could have left this hard coded but decided that it was worth the flexibility it provides when getting into the edge cases that 99% of users will not need to consider.

2 Likes

I currently have att at 15 and my bandwidth at 20

So I have room to move there

@Leonardthall. When you say 40 you are referring to the ATT value right?

I am trying to learn all these new features :smiley:

Replying for Leonard, yes, he means ATT. (I’ve seen him post that before).

And then yes, try increasing attenuation to 40, and leave bandwidth at 20. Can increase that later if necessary.

Will do.

Thanks for your help

To me this looks like you have peaks at the first, second and fourth harmonics so I would try setting INS_HNTCH_HMNCS to 11. I don’t think 20Hz BW is enough looks more like 40Hz.

1 Like

Hi

This is what i got FFT after +30sec alt hold with 900mm cf frame 15inc props. Cube black, copter 4.0.0

Throttle based settings;
INS_HNTCH_REF 0,3 (that is my Tht hover value)
INS_HNTCH_FREQ 150HZ @ 9000rpm (peak value)
INS_HNTCH_BW 75Hz

INS_NOTCH_ENABLE 1
INS_NOTCH_FREQ 76Hz (peak value)
INS_NOTCH_BW 38Hz

Are the values about right…around there?
I have same questions in cubepilot forum, but looks like there is more discusssion about subject here, so sorry for the double post, just want to get on top of this new feature.

Based on the frame size and accumulated data from larger copters I’m pretty sure that your primary harmonic is at 76Hz, in which case you could set INS_HNTCH_FREQ to 76 and the 152Hz peak will also be squashed (assuming you leave the harmonics setting at the default). You can then turn off the static notch (INS_NOTCH_*) settings. The peaks are pretty pronounced - if you make these changes you could turn down the BW setting to 40Hz.

1 Like

so,

INS_HNTCH_ENABLE =1
INS_HNTCH_RER =0.3 (based on my Tht value at alt hold +30sec)
INS_HNTCH_FREQ =76
INS_HNTCH_BW =40

You mentioned about hamonics, “(assuming you leave the harmonics setting at the default)”
is INS_HNTCH_HMNCS = 3 the param that should be left as is ?

And notch off,
INS_NOTCH_ENABLE = 0

Thank you for yor help sir, much appreciated.

Yes, as you have written.

1 Like

Here is my pre and after harmonic tuning graph´s, params set per your instructions.
Is there any improvements i should try or are we happy ? :slight_smile:

after fft

I think it’s hitting it pretty well, you might want to increase ATT to 40 say if you are using the default of 15

1 Like

yes, i had defauld set. Now 40, here´s the graph after setting that.

Kind regs
Mikko

after II fft

Looks good - well done

1 Like

That looks awesome. How does is fly?

1 Like

Looks ok, better than before for sure, short test on back yard and i got wibes 3.3 under 25, really good, will see after proper test flight and pid´s now are just my best guess, with bug on autotune feature… didn´t want to go with default pids, so will see when i get a chage for proper flight and get some data. Mayby go for autotune when its working again.
Really happy that i got harmonic´s finally done. All thanks to andyp1per :slight_smile:

If anyone is feeling brave I have a new PR in the works that creates a double harmonic notch. https://github.com/ArduPilot/ardupilot/pull/13121 this is designed to more effectively target the spread of noise which you particularly see on larger copters. It works fine in SITL but needs some real world testing.

1 Like

what kind of testing ?
You helped me a lot so…Is it so that ill get the params from you and well see what happen´s…would be a bummer to crach this frame again :rofl: