Harmonic notch support (ESC, Throttle, FFT)

A thread for configuration of the harmonic notch in 4.1.
Please make sure you have read https://ardupilot.org/copter/docs/common-imu-notch-filtering.html and https://ardupilot.org/copter/docs/common-imu-fft.html before posting here

4 Likes

Thanks Andy for all your work on this!

These are the params currently used

pre filtering

first question: why I cannot see the control area in the prefilter graph?

post filtering

Are the params sets correctly? In particular with ESC telemetry my confusion is how to set FREQ and BW, somewhere I’ve read to use FREQ to target the lowest noise freq, is this correct?

That seems odd. Can you post both logs and your full parameter set?

@andyp1per looks like he is showing accelerations. The harmonic notch does not affect accelerations, right? @Giorgio_Rinolfi should look at gyro data to determine effectiveness of the notch.

Right

More and more words

Looking at those graphs, without the log, it looks like you need:
INS_HNTCH_ENABLE,1
INS_HNTCH_MODE,3
INS_HNTCH_REF,1
INS_HNTCH_FREQ,135
INS_HNTCH_BW,67
INS_HNTCH_ATT,40
The actual logs will tell more

In the @Giorgio_Rinolfi post there are both acc and gyro FFT graph.

From what I understood with INS_HNTCH_OPTS=2 the frequency of the 4 notch comes from the ESC telemetry RPM converted to Hz for each motor, so the params INS_HNTCH_FREQ and INS_HNTCH_BW could be leaved to default values, but this should be confirmed or confuted by @andyp1per.

My apologies. I missed that when I was viewing it from my phone.

That’s correct, but in the case INS_HNTCH_FREQ also represents the minimum frequency that will be tried so you should pick a frequency below your first harmonic and then make the BW half that

1 Like

Couple of questions about setting up the Harmonic notch. Apologies if I am being a Biff about setting this up but sometimes I find reading instructions difficult to interpret and certainly in this case reading the Wiki. I have been trying to set up the Harmonic Notch using FFT but am getting a confusing read back of the FTN1.PkAvg. Here is a screen shot with a log attached.

. What is the thought on the Freq that the notch is dealing with? The Wiki implies that all I need to do is to enable the notch, set mode 4 and the ref to 1 and then set the bandwidth as to the second screen shot ie 50(?) and that’s about it.
Is this correct? If it helps my copter is a 20kg machine using 18x6 inch props on 435kv motors on 6s
Log here..

I did apply just a throttle based HNotch and here are the before and after graphs having applied a notch based on a throttle of 0.36 with a freq of 91 bandwidth 45

Just to ensure my pure Biffery isn’t total, I am referring to the Gyro rather than Accel graphs for this aren’t I?

This is a tricky setup to get right - it’s an X8 so there are going to be a lot of competing signals amongst the noise.

First problem is the SnR threshold which by default is set at 25, this is yours:

So the signal drops below 25db a lot which is why you get dropouts. Your signal seems pretty strong so try setting FFT_SNR_REF = 15

Next problem is that your first harmonic looks like it is at about 90Hz, which is awfully close to the lower bound you have at 80Hz. If the RPM drops below 80Hz you again will get no signal, so I suggest you lower the range to something that is definitely covering your frequencies (also 180Hz is not far below 200Hz your upper bound). So try FFT_MIN_HZ = 50 and FFT_MAX_HZ = 300.

Final problem is that the tracking is bouncing a lot between first and second harmonics:

It’s possible that by making the changes above you will get much better tracking. If not there are some other knobs we can turn to improve things.

Thank you for this- Ill give it a try next time Im out.

Hello! @andyp1per
Help me to understand and understand the notch filter and FFT setting.
Drone 120cm octa X8, Weight 9kg, Cube Orange, arducopter 4.1
Read the wiki but I am having a hard time figuring out how to set up the FFT. Please take a look at my log and graphs. Am I setting everything up correctly? The graphs FTN1.PkAvg, FTN2.PkX are somehow confusing.
According to the instructions in the wiki, I did this.

FFT_THR_REF and FFT_FREQ_HOVER are derived values in case you want to use the FFT to calculate good results for the throttle based notch. If you want to use FFT to drive the notch then you can ignore them. To use FFT to drive the notch:

INS_HNTCH_MODE=4
INS_HNTCH_REF=1
INS_HNTCH_FREQ=F
INS_HNTCH_BW=F/2
FFT_MINHZ=F

Where F is a reasonable lower minimum for your setup. You can start with the default of 80, or lower it for a bigger copter (such as yours) to something like 60.

3 Likes

Thanks Andy, for such a great explanation and guidance. In a couple of days I will go to conduct tests with these settings. Thanks again.

I’m building a slightly unconventional Y6, 3kg, 15". I think vibes are pretty good, maybe filtering isn’t super necessary. However I would still be interested to get the FFT to work properly.

My hover RPM is at about 57hz for upper motors and about 67hz for the lower ones, also confirmed with telemetry (but I need to free up that serial port)

FTN2[0]PkZ shows a clear signal that matches rotor frequency. On some tests it picks up the upper rotor frequency, in other tests the bottom rotor frequency.

FTN2[0]DnF picks up a higher frequency, however I am not sure on what base. This could be the lower motor frequency, however FTN2[0]PkX and FTN2[0]PkY are pretty noisy, so I am not sure if DnF is derived from this reliably.
log: Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.


FFT_SNR_REF = 15,

Does anybody have some advice in how to tackle this from the FFT angle?

Otherwise the only approach feasible seems to take the average of both frequencies and do HNTCH throttle-based.

This flight was pre-autotune btw, so tuning is not good.

This is a NoraFC 4.1.1-rc1 and I am running a loop rate of 500, cpu load 60%. Still I am getting about 150-200 long loops. I reduced the FFT samples and think all my settings and logging should be pretty reasonable for this FC. Maybe I should go down to Dshot150?

If Z is the right peak then we don’t have an option to target that. Would be pretty easy to add though - worth raising an issue if this is what you need.

The Z peak may be specific for my frame and i am more asking out of interest than out of practical neccessity. I think no action needed at this point.

However, most coax builds Y6 or X8 will have two dominant RPMs that are not far apart (the top and bottom props). I see how it is very difficult to target both by FFT.
But for HNTCH i think it would be nice to be able to give a second reference frequency, and have a second filter to be able to tackle top and bottom rpm specifically for throttle-based filtering.