Notch filter not working?

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!

I can’t answer that - I too see differences in the output, I am not sure which one is correct

The difference in the graphs might have to do with the bin size. The amplitude displayed is basically a count of how many times that frequency occurred, so if your bins are larger, you get larger amplitudes, even if the data is the same. The spiky-looking graph from pymavlink suggests it’s using smaller bins. You can try increasing the bin count in the MP FFT grapher to see if you can get a graph that matches. I don’t know if the pymavlink one lets you change them.

Hi Rick,
Thank you for your reply. I noticed that in pymavlink the function is scaling the amplitude. Moreover on the wiki page in ardupilot speaking about IMU batch sampler it is written that FFT should be used only to locate frequency bands. Amplitude values are not scaled to a useful value. So I suppose that the pymavlink amplitude values are more appropriate?

The actual value of the amplitude is essentially meaningless, so just ignore it. The important part is the general shape of the graphs, which is why I mentioned the data binning, as that can affect not just the amplitude but also the shape (small bins makes it spiky).

But they’re both valid and both show the same thing - that you’ve got a vertical resonance and ~110 Hz and a harmonic at 220.