Notch filter not working?

I hate to repost, but I fear the original post may have gotten lost in the Arducopter parent forum section.

I’m flying Copter 3.6.7, and I’ve been trying to get the notch filter to work. Enabling it and changing settings does not seem to affect the FFT profiles at all. For example, here’s FFTs of two near-identical flights, one with no notch, and one with a 30dB notch at 100-150 Hz:

No notch:

Notch at 100-150 Hz:

As you can see, I’m experiencing translational Z vibration at around 125Hz, probably from propeller blade passage. This is a perfect use case for the notch filter, but I was rather disappointed to find that turning it on didn’t change anything. Not sure if it’s not working, or I’m doing something wrong, or maybe the data used are pre-filter samples.

My settings for the above flight is:

INS_NOTCH_ENABLE 1
INS_NOTCH_FREQ 125
INS_NOTCH_BW 50
INS_NOTCH_ATT 30

Although I’ve also tried various combinations of other values. Any insight would be appreciated.

@Anubis,

I’m afraid I don’t have a good answer except that I’m not surprised that the outputs from FFT are not changing. As you suggest, I think it’s likely that the filtering is done after it is logged.

I’ve added this to our 3.6 issues list so it’ll come up on next week’s dev call.

1 Like

@Anubis Are you using the batch sampling technique? I thought that took the place of raw IMU sampling. I think you would see the notch effects on the medium or fast attitude logging. But I’m pretty sure the batch sampling is raw IMU data. @rmackay9 do you know?

1 Like

I’m afraid that I don’t know much about it… I did clean up this Batch Sampling wiki page… maybe it says something useful.

I am pretty confident you are right

I’m afraid I don’t have a good answer except that I’m not surprised that the outputs from FFT are not changing. As you suggest, I think it’s likely that the filtering is done after it is logged.

As I suspected, thanks for the reply. In that case, I will note that the VIBE logging is also unaffected by the filter.

@bnsgeyer

@Anubis Are you using the batch sampling technique? I thought that took the place of raw IMU sampling. I think you would see the notch effects on the medium or fast attitude logging. But I’m pretty sure the batch sampling is raw IMU data. @rmackay9 do you know?

I’ve used both, results are the same. The post that I linked has a screenshot of my batch-sampled flights.

Also tagging @amilcarlucas since he created the original post and may want to read this.

Me and at least a couple other people are having a different issue w/ the notch filter… We’re all using the cheap betaflight style boards. But I think Paul’s is an f7 kakute, and mine is an f4 omnibus.
When we enable the notch filter, the copter isn’t flyable. It just flips. And if you look at the HUD in MP, as soon as the notch is enabled, the HUD starts spinning.
Does the notch require multiple IMU’s or anything these small boards don’t do?

@CraigElder can you add this to the Dev Meeting ?

We discussed this a bit on the dev call and Tridge confirmed that we shouldn’t expect the FFT results to change because they use pre-filtere data. He also said that he’s successfully used the Notch filter on multicopters somewhat recently so the fetaure should work. The suggestion was that perhaps the filter has been setup to filter out too much or perhaps has been set to the “control range”.

I would guess from the parameters shown above that the Bandwidth is far too wide. I think these settings would remove from 75hz to 175hz which is very central and very wide. I think the filter should be much more targeted on just narrow bands (perhaps 10hz?) right around where unwanted vibrations from the propellers are appearing.

@wicked1, I don’t think there’s any special requirement on the boards. If you can provide a dataflash log that might be good.

Thanks, good to know.

To clarify, I was just wondering if I should expect the filter to be apparent in the FFT results, because previous discussions of the notch filter implied that they should be. I wasn’t experiencing any adverse effects from applying the filter, although I agree my settings are a bit crazy, but that’s just because I was trying to see some results. Also, the filter settings I have should do 100-150 Hz rather than 75-175; the INS_NOTCH_BW parameter (should) set the total bandwidth, with _FREQ as its center. I assume so, anyways, based on the description. Guess I’ll check the code to be sure.

1 Like

Thanks for the reply,

I was initially trying to set it to a high frequency… about 280hz center frequency because it’s a small copter with fast props. 10hz bandwidth and 10db attenuation. I thought maybe the frequency was the issue, so lowered it to 200, and then to 80, and in every case the hud just spun.

I will get a log sometime in the next few days and post it here.

1 Like

Hi Randy,
the above means FFT is not showing notch filter effects?
or
FFT is not showing acc and gyro parameters filter effects ?
or
BOTH??

P.S.: we need to improve the relative wiki, its undocumented

Yes, I agree we need to update the wiki (it’s on the list!).

The FFT (the graph’s shown at the top of this topic) will not change even if the Notch filter is enabled… so the 2nd item on your list I think.

Hi

I successfully use the notch filter on a Pixhack v3. It reduces significant the amplitude in the defined bandwith. If somebody wants, I can upload images and logs to show the result.

BR

Harald

I enabled notch today, and it’s working fine. (I assume).
No spinning HUD. Copter is completely flyable. I don’t know why it wasn’t working for a few of us a few months ago when we were trying, but whatever… :slight_smile:

Harald, are you saying you can see in the logs the difference the notch filter makes? If so, I’d like to know how to see the results.

1 Like

With the FFT Analysis you can clearly see the improvements of the Amplitude in the bandwith of 50-90 Hz.
I had the Impression that the copter has flown als smoother, but this is only an Impression.

Without notch filter:

With notch filter:

INS_NOTCH_ATT 25
INS_NOTCH_BW 20
INS_NOTCH_FREQ 70

Hi @rmackay9
I tried to apply the notch filter and as you mentioned I did not notice any difference between applying and not applying the filter inside the FFT tool in mission planner. So the FFT tool is not taking into account of the notch filter.
However when I run the pymavlink script I got lower values and slightly different shapes. Is the pymavlink script taking into account of the filter?

In Mission Planner

In pymavlink

See Notch filter is not a notch filter?

Thank you @andyp1per
So in the current AC3.6.8 if the notch filter is enabled it is probably doing the job but I cannot see anything from the loaded data right? It will come with the next versions of the firmware I supposed since you already pulled the request? So now, what about the difference between mission planner FFT tool and pymavlink script?
Thank you!