Tuning the Harmonic Notch

Thanks for the response! I just did a minute hover in alt hold. I am still getting the same issue with the fftui showing 24Hz after changing the suggested parameters.

Donā€™t do this. Needs to be something sensible for your aircraft - so 40Hz maybe to start.

Its possible that you are not able to log quickly enough or are running out of CPU. What board and are you using a fast sdcard?

I have a Cube Orange on the drone using the default SD card. The CPU load goes up to 35. Currently I am extracting the Acc and Gyr data from the logs and putting them into a fft script until we can figure this out. I will need to go out to buy a class 10 sd card and fly tomorrow

I would think the default SD card is ok - I doubt they ship with something that is not good enough. And CubeOrange has plenty of CPU so thatā€™s not it.

For Norim,
Iā€™m also studying how to insert ā€¦ recover the values to be entered to enable the harmonic notch filter ā€¦ can you explain me ā€¦ teach me how to say that you have peaks around 75 Hz, 150 Hz, 216 Hz and 286 Hz ā€¦ looking only at the correspondence of the tips of the various graphs or these values are written to you somewhere ???

Run the FFT, look at the graph on gyros - the peaks in the graph are frequency peaks. The python version has a go at doing this automatically for you. mavfft_isb.py in pymavlink

I donā€™t know. I just selected highest peaks on the graphs.

Ok so thatā€™s my FFT result:


It looks much better ??numbers are much lower :slight_smile: here is log from this flight.

If the throttle scaling will change because I will fly with heavier copterā€¦ Do I have to change also:
INS_HNTCH_REF ???

Do I have to change anything in parameters after this FFT procedure ?

Should I use more aggressive flight log to adjust Frequency Scalling

dear @andyp1per do you think I can leave such settings and just fly ?

Yeah throtte ref might allow you to do a little better below 70Hz and the associated hamronics. Interesting that you as have a fourth harmonic, but in geneal I think this looks pretty good and you can fly. You might also be hitting some IMU damping resonance at 130Hz which you could use a static notch to take out.

1 Like

Ok so I will use this setup. Do you think that such step by step guide can be added to wiki or maybe wiki should be changed/updated a little bit ?

Step by step guide to tune throttle based Harmonic Notch Filter. Based on: Flat octocopter, Cube Orange, 6s Batteries, 16" Propellers, copter weight around 9kg.

  1. check the parameters in Mission Planner and change them to:
    INS_LOG_BAT_MASK = 1
    LOG_BITMASK (without RAW IMU)
    INS_HNTCH_ENABLE=1
    INS_LOG_BAT_MASK=7
    INS_LOG_BAT_OPT= 1

  2. Do the gentle hover flight at least for 30 seconds.

  3. Analyze the flight log in Mission Planner (Ctrl+F) FFT option and select new DF log (load your .bin file log from this gentle flight)

  4. Check the value of first high peak and remember the value. In my case it was 70Hz

  5. Change the parameters in Mission Planner to:
    INS_HNTCH_FREQ=70 (is the noise frequency for the first hamornic so 70 in your case)
    INS_HNTCH_REF=0,22 (is the throttle scaling usually the same as MOT_THST_HOVER so 0.22ā€¦ in my case)
    INS_HNTCH_BW=35 (is best set as half the frequency = 70/2 = 35 in your case)
    INS_LOG_BAT_OPT=2

  6. Do the next gentle hover flight at least fro 30 seconds.

  7. Again upload the log from this flight to FFT option in Mission Planner. Check the values and peak they should be much lower. Also the vibration in log should be much lower:

  8. What is a bed scenario if the filters are to broad? How the copter will behave ? What is good scenario ? There should be better parameters from autotune? Copter should fly better and better response for wind etc. ?

2 Likes

Feel free to create a PR to update the wiki

Looking to set harmonic notch, which freq, BW and harmonics (1st, 2nd, 3rd, etc) should i use? Is there a freq range chart for each of the 8 harmonic? I.e. 1st harmonic 0-75hz, 2nd 76-140hz, etc. Thanks

1 Like

Itā€™s a notch filter so you can only target a single frequency and multiples thereof. Although changing the bandwidth attenuates surrounding frequencies to some degree the more attenuation is right in the middle. In 4.1 there is support for a double-notch which can make the effective notch a little wider.

In your case it looks like you should target 80Hz with two harmonics total (so 80Hz and 160Hz). You will find that when you apply the notch the frequency spread changes. I presume this is a Y6 or X8 or something.

Its a quadplane vtol. So i should set this:
Set INS_HNTCH_ENABLE = 1 to enable the harmonic notch
Set INS_HNTCH_REF = hover_thrust - mine is .4868117
Set INS_HNTCH_FREQ = 80
Set INS_HNTCH_BW = 40
Set INS_HNTCH_HMNCS = 3 (harmonics 1 and 2)
Set INS_HNTCH_ATT - currently set at 40 (default)

Thanks.

Yep looks right. Is this 4.0? I had a feeling the notch only worked for quadplanes on 4.1

Yes, it is 4.0. Iā€™ll post the results when i fly again. Is there any reason not to use harmonics 1, 2 and 3? Its says you have a max of 3. Thanks

Yep use 3 harmonic by all means

Hey Andy! New tune on a new aircraft and it already looks great. Anything youā€™d change? Log

Just me $.02 but no way to know w/o looking at the pre-filter log that prompted you to configure both a Dynamic Notch and a Static notch. It doesnā€™t look like the Dynamic notch is doing anything (FTN in the log).

1 Like

Thanks Dave! Iā€™ll get the pre-filter log as well.