Tuning the Harmonic Notch

Hello @andyp1per, may I have your words in this harmonic notch?
My configurations:
. Hex plus frame
. 32-inch propeller size
. 12S battery
. Tmotor P80III and 120A Alpha ESC

This is the FFT:

My notch filter configurations:

The rate out noise seems to be 58Hz which is the largest peak of FFT:

Here is the log:
https://drive.google.com/file/d/1fAnwT08Z-RZDbQvKCIiVf6a7kV4RylmC/view?usp=sharing

Is my configuration goods enough? The DES_ROLL vs ROLL, DES_PITCH vs PITCH in ATT parameter are bad, even I can see some noise in the PITCH/ROLL

Is it trivial?

Thanks in advance.

1 Like

It looks ok. You should try with harmonics as 3 - you may not need all 3. Eyeballing it my guess is its more like 55Hz

Be careful about using such a wide peak so low down in the frequency range - maybe try BW = 20 and see how it looks.

The other thing to try is adjusting the ref to cover lower frequencies as is documented in the wiki.

1 Like

Hi,

thank you for the extensive topic!

I’m facing a “double” notch, I guess because there was some wind and the motors where spinning with different rpms.

Can I start with this log anyhow and how (start somewhere in the middle at 95 Hz)?
Or should I wait for a calm day?

Its a 10" hexa with 2,300 g, 920 kv Motors and 4S. The MOT_THST_HOVER is 0.27.

THX!

Post a link to the log. I don’t think wind would explain the large yaw bias you are seeing on the motor commanded outputs. It was either commanded to yaw hard or your motors/arms/frame geometry result in motor tilt.

1 Like

Hi Andy @andyp1per

I tried the harmonic notch filter on a little 380 size helicopter for the first time. Can you please take a look at my log and advise if I’ve got it setup right?

G380-IMG_3324

Main rotor RPM: 2220
Tail rotor RPM: 8340-8400 (I believe)
Electric motor RPM: 11,100

Notch filter setting:

INS_HNTCH_ATT,40
INS_HNTCH_BW,10
INS_HNTCH_ENABLE,1
INS_HNTCH_FREQ,18.5
INS_HNTCH_HMNCS,11
INS_HNTCH_MODE,1
INS_HNTCH_REF,0
INS_NOTCH_ATT,20
INS_NOTCH_BW,25
INS_NOTCH_ENABLE,1
INS_NOTCH_FREQ,80

Thanks.

What does the pre-filter graph look like? You are missing that spike at 140Hz

Here is the pre-filter graph on a earlier flight.

To me it looks like this might be better:

INS_HNTCH_FREQ,37
INS_HNTCH_HMNCS,11

Thanks Andy @andyp1per,

I thought INS_HINTCH_FREQ needed to be set at half rotor rpm?

Tried your suggestion and it looks good.

Hi @andyp1per,
Ive been having issues with FFT. For some reason the input freq. is 24Hz. Ive tried using mavproxy but the output says “extracted 0 fft data sets”. I followed the documentation for FFT even in-flight FFT. The props are spinning at 5000RPM/80Hz. I have ESC telem connected and set up on a cube orange.

FFT_ATT_REF,15
FFT_BW_HOVER,20
FFT_ENABLE,1
FFT_FREQ_HOVER,80
FFT_HMNC_FIT,10
FFT_HMNC_PEAK,0
FFT_MAXHZ,200
FFT_MINHZ,0
FFT_SAMPLE_MODE,0
FFT_SNR_REF,25
FFT_THR_REF,0.35
FFT_WINDOW_OLAP,0.75
FFT_WINDOW_SIZE,64

INS_HNTCH_ATT,15
INS_HNTCH_BW,10
INS_HNTCH_ENABLE,1
INS_HNTCH_FREQ,40
INS_HNTCH_HMNCS,11
INS_HNTCH_MODE,3
INS_HNTCH_OPTS,0
INS_HNTCH_REF,1

Not able to get FFT analysis

2021-02-23 23-03-32.log.param (18.3 KB)

You need

INS_LOG_BAT_MASK,7
INS_LOG_BAT_OPT,0

Hi I am trying to learn and use Notch Filters but I can’t even display my log. Can we try to do step by step guide ? I would like to use Harmonic Notch Filter in my octocopter with 16" propellers, 6s, weight with camera around 12kg. I am flying without gimbal and camera for this test.

  1. I checked and set parameters:
    INS_LOG_BAT_MASK = 1
    LOG_BITMASK without RAW IMU
    INS_LOG_BAT_OPT= 0
  2. I would like to do throttle based setup but I didn’t found “INS_HNTCH_MODE” = 1 in my parameters list in Mission Planner???
  3. I did gentle hover flight for few minutes (Log here)
  4. I tried to load it in FFT filter but I get empty screen. What I am doing wrong ?

INS_HNTCH_MODE won’t appear until you have set INS_HNTCH_ENABLE

But the lack of batch sampler messages is a head scratcher. How many IMUs do you have and which is the primary?

I have Cube Orange so I think 3. I don’t know how to check which is primary ?

So I have to do:
INS_HNTCH_ENABLE:1
and fly again gentle hover for 30 seconds ?

Set set INS_LOG_BAT_MASK to 7 so that you get data for all the IMUs. Then hover again

Hi,
I’m also in the same situation as you,
although I have read the ardupailot wiki several times I do not know how to do several steps to find the values that need to activate the notch filter … get the FFT… how to determine the frequency to be taken as a reference etcc …
It would take some practical examples and described step by step on how to perform them … so that everyone can proceed on their own without always being asking …

1 Like

Ok so I did the test flight. This is a log from gentle hover (304
and I loaded log into FFT part of Mission Planner and I have peaks around 75 Hz, 150 Hz, 216 Hz and 286 Hz:

So as I understand I should start form creating Notch filter something like that:
INS_HNTCH_REF=0,2209552 (my MOT_THST_HOVER)
INS_HNTCH_FREQ=75
INS_HNTCH_BW=32
???

INS_HNTCH_FREQ is the noise frequency for the first hamornic so 70 in your case
INS_HNTCH_REF is the throttle scaling usually the same as MOT_THST_HOVER so 0.22… in your case
INS_HNTCH_BW is best set as half the frequency = 70/2 = 35 in your case

1 Like

Ok so next step is to change:
INS_LOG_BAT_OPT=2 and perform next gentle hover flight :slight_smile: