Help validating Notch Filters

Hi all,

I am trying to validate that I enabled correctly the notch filters in my setup and also their effect.

My setup is:

  • Matek H743 Wing V3
  • Arduplane 4.4.4
  • platform: 2 motors non-vectored tailsitter
  • Using BDSHOT for rpm feedback

I have configured the notch filters:

  • ins_hntch_enable = 1
  • ins_hntc2_enable = 1
  • ins_hntch_mode = 3
  • ins_hntc2_mode = 3
  • ins_hntch_opts = 1
  • ins_hntc2_opts = 1
  • ins_hntch_hmncs = 3
  • ins_hntc2_hmncs = 3

and collected data with:

  • ins_gyro_rate = 3
  • ins_log_bat_opt = 4
  • ins_log_bat_mask = 1

Using the tool in Mission Planner I get:

  1. Is it necessary to enable both filters (HNTCH and HNTC2) so that each motor has an individual filter assigned? Or is this configured from INS_HNTCH_OPTS (perhaps 1 or 2)? Reading the documentation I wan not able to clarify this.
  2. In the picture above it is obvious that the noise is better after the filters but I can not tell for sure what is the the main frequency and the harmonics of the noise from the motors.
  3. How can I check that there is no overlap of the filters? Something like done here Bidirectional Dshort with Dynamic Harmonic Notch Filters - #3 by Yuchen_Huang

First things first. Update to ArduPlane 4.4.4 or newer.

I am working on 4.4.4, I corrected it above. Sorry for the confusion
Also, this is the flight log. 1 01-01-1980 01-00-00.bin - Google Drive

  1. No, one is enough

  2. looks like you have not collected enough data. Make a longer flight.

  3. With just one filter, all you need is to make sure the lower frequency limit is not too low.

Thanks a lot for the advice!

Assuming that I use INS_HNTCH_MODE = 3, this is not configurable by the user, right?

It is, see INS_HNTCH_FREQ

INS_HNTCH_FREQ: Harmonic Notch Filter base frequency

Note: This parameter is for advanced users

Harmonic Notch Filter base center frequency in Hz. This is the center frequency for static notches, the center frequency for Throttle based notches at the reference thrust value, and the minimum limit of center frequency variation for all other notch types. This should always be set lower than half the backend gyro rate (which is typically 1Khz).

1 Like

I had some extra flights and these are the logs.

  1. Hover flight with minimal stick movement.
    hover.bin - Google Drive

  2. Hover with some sharp stick movement.
    normal.bin - Google Drive

Both give similar result as previous flight. All in all I need to check if the filter is configured correctly or not.
I have configured:

  • ins_hntch_enable = 1
  • ins_hntch_mode = 3
  • ins_hntch_opts = 1
  • ins_hntch_hmncs = 3
  1. Is my configuration missing anything?
  2. I still can not understand from the FFT where the motor spinning frequency is seen.
  3. What are these sharp drops in the second picture?
  4. Regardless of 2, do the post filter data look ok-ish in general?

Excuse my vague questions, I am new this and I am not sure if I interpret the data correctly.

Yea, it’s missing the reference so it’s not doing anything.
INS_HNTCH_REF,0 (set this to 1)

And you are using the wrong tool for the job: Filter Review Tool

Looks like VTOL plane users could also benefit from reading:

Thank you both for the valuable ideas! I changed

  • INS_HNTCH_REF to 1
    and using the correct tool I see the filter’s effect in first and 2nd harmonic.

However, I am a bit confused about the INS_HNTCH_OPTS and INS_HNTCH_BW selection though. The flight was done with 1 and 40 accordingly. Reading the documentation it makes more sense to use INS_HNTCH_OPTS = 2 (a notch per motor; my platform has 2 motors).
Bidirectional Dshort with Dynamic Harmonic Notch Filters - #2 by xfacta here is stated that when setting OPTS to 2 one should lower the BW to 20.

  1. Does this make sense? If I do this (BW = 20, OPTS = 2) the filter response is worse than the existing one.
  2. Finally, if I choose INS_HNTCH_OPTS = 2 does that mean that there will be two overlapping notches? Assuming that motor speeds are close enough. Can this impose issues in the controller?

Use two notches reduce the BW to 30.
Overlapping notches is not a problem.

The problem is when the center frequency is bellow 30Hz

This is all you need. Less is more if it does the job.

Pre-filter data:

Notch Filter settings:

Estimated Post Filter Result:

2 Likes