Tuning the Harmonic Notch

Hi Andy-I’m back to playing around with FFT for the notch filter and I see this error generated. Haven’t seen it before. 4.0.4-dev

Fixed by https://github.com/ArduPilot/ardupilot/pull/13741 if you are playing around with FFT I suggest you use that PR as it has a lot of bugfixes and improvements.

And in fact if the PR fixes your issue then that’s a really good datapoint as @tridge was running into the same problem.

OK, Could I get the latest build for a Pixracer?

This is a build of my small copter branch so includes FFT, Double-Harmonic Notch, SRXL2

Thanks Andy. I’m not clear on a few of the parameters. Entered or derived maybe?
FFT_BW_HOVER
FFT_HMNC_FIT
FFT_THR_REF

INS_HNTCH_OPTIONS

OK, I see what’s learned from the Parameter Wiki. Think I’m good.

FFT_BW_HOVER FFT_THR_REF are learned values that you can use to configure the throttle based notch

FFT_HMNC_FIT leave this at the default

INS_HNTCH_OPTIONS set this to 1 to get the double notch

If the INS_HNTCH_OPTIONS to 1 is supposed to open some other parameters I’m not seeing them.

No it’s literally 1 for double notch or 0 for single notch

Right, I guess I expected some double notch specific parameters to populate after enabling it and a refresh.

it was forever since i looked at it all - but, summer comes and i reworked old tarot 690 to fly on matek f765 brain. uses 6 motors D4215-650kv on 5S 6000mah lipo. an obsolete big bird from the past. :slight_smile:

So, I activated notch filter on throttle - so far so good, seems to be quite stable. it uses oneshot ESCs, set on mode 1 - i test it with no load yet so it shows crazy low MOT_THST_HOVER=0.125.

peak of vibrations is at 110hz, all filters in INS set to 40hz. INS_HNTCH_ATT=40. seems to be ok so far.

to be honest it is crazy to see the level of vibrations this big bird generates, left is pre-filter, right is post-filter. dunno, it is with 40dB suppression. may be need to set more, about 80. will see.

odd, i do not recall why but i set BW param really high - to 60. should it be back to 10? what was concluded about that?

  • ok, i found in the old initial discussion we talked about INS_HNTCH_BW = hover_freq / 2.
    is it still the case?

other thought - damn, it hovers now, according to f765 embedded current sensor, at 6A current with no load and at 8A hover with a gimbal. a 45 minute hover time, with a 6000mah 5S - it is too good to be true, honestly, it was before a 15 min drone, but, i shaved off a ton of weight from it. or it can mean a F765 matek has a shitty current sensor that reads bogus. gotta do a real test soon, to run an autotune on it.

It looks pretty good if you look at the scale on the post-filter gyro. You can use mavfft_isb to get a more idealized picture of the power under the peak.

@andyp1per

I am just starting to get my Octo back up in the air. Wondering if you could take a look. I still am not 100% clear on which harmonic is which.

Massive spike at 50hz

The Notch is active

Here are my settings.

INS_HNTCH_ENABLE 1
INS_HNTCH_FREQ 50
INS_HNTCH_BW 30
INS_HNTCH_ATT 40
INS_HNTCH_HMNCS 11
INS_HNTCH_REF 1
INS_HNTCH_MODE 3

I think its set for 1,2,4th harmonics

Is it the 3rd that’s spiking? How do I know which is which?

Thanks

Can you do a pre-filter graph? It’s much easier to tell that way round

Will do that this afternoon, thanks

Is the amplitude of the FFT useful when comparing different flights? I know if I take two similar flights, it’s useful.
But if I look at a log from a 1 minute flight, and then one from a 6 minute flight, will the 6 minute flight have higher amplitude because it’s longer and has more samples?

I’m not exactly sure what Michael does, but I think he averages all the frames so the amplitude should show something sensible. If you use mavfft_isb.py then the graphs are definitely comparable as they are given in units of power spectral density

@andyp1per

Here you go

Do I read this as:

Red first Harmonic
Green Second
Blue Third

Is that Right?

Thanks for taking the time to look and assist

No, those are just your X,Y,Z axes.

1 Like