Tuning the Harmonic Notch

Throttle-based will work on all models and should work fine. My FFT-based option will also work on older models but is not in master yet.

It’s not working because for throttle-based you need to set INS_HNTCH_REF to your hover thrust, or configure it to scale from the minimum desired frequency. The details are on the wiki.

can you explain how is that supposed to be done?

i do not see anything explained in the wiki
http://ardupilot.org/copter/docs/parameters.html
it says same as MP help page, not much of the useful information there:

A reference value of zero disables dynamic updates on the Harmonic Notch Filter and a positive value enables dynamic updates on the Harmonic Notch Filter. For throttle-based scaling, this parameter is the reference value associated with the specified frequency to facilitate frequency scaling of the Harmonic Notch Filter. For RPM and ESC telemetry based tracking, this parameter is set to 1 to enable the Harmonic Notch Filter using the RPM sensor or ESC telemetry set to measure rotor speed. The sensor data is converted to Hz automatically for use in the Harmonic Notch Filter. This reference value may also be used to scale the sensor data, if required. For example, rpm sensor data is required to measure heli motor RPM. Therefore the reference value can be used to scale the RPM sensor to the rotor RPM.

http://ardupilot.org/copter/docs/common-imu-notch-filtering.html

interesting - google is not finding that page for me, at all.

It only got published a couple of days ago - maybe it hasn’t been re-indexed

ok, i am reading it now. it is still as clear as mud. it begins great explaining what buttons to press and what window to open. gives a sample of noise - good. then it gets confusing. ‘open it in the regular way in mission planner and graph the throttle value. From this identify an average hover throttle value’.
that is not very clear - better have a screenshot and a sample. as i have learning set to 2 - i can get it right away - my hover value is 0.393618, i have it in the settings.
then

  • Set INS_HNTCH_REF = hover_thrust to set the harmonic notch reference value
  • Set INS_HNTCH_FREQ = hover_freq to set the harmonic notch reference frequency
  • Set INS_HNTCH_BW = hover_freq / 2 to set the harmonic notch bandwidth

what are 2 last params supposed to be set to? it would be helpful, may be, to do a compelte reference sample using the screenshot in there, to identify what each actual value is and where exactly is supposed to come from.

say, here is the data from my fpv tilt - what should be used from it:

Pull requests on the wiki gratefully accepted :slight_smile:

You want to set INS_HNTCH_FREQ to one of the two peaks. My guess is that the motor peak is actually the second one so about 180Hz? Then set INS_HNTCH_BW to 90Hz (half of the frequency). Does that sound right based on your motor size?

If it does sound right then do the FFT again after you have configured the harmonic notch to see if you need a static notch on the lower peak.

so, i did set _ref to the hover value, flew it, battery out of juice now, i will do it later. i saw CTUN->N to get some fluctuations, mildly, from 80 to 88 and so on, but not too much. FFT of that log does not look very different from the first one.

Sounds like you haven’t set INS_HNTCH_FREQ if it’s tracking from 80Hz. The minimum of CTUN->N should be INS_HNTCH_FREQ

it is set to 80. i posted it above. it is now as:

|INS_HNTCH_ATT|30
|INS_HNTCH_BW|50
|INS_HNTCH_ENABLE|1|
|INS_HNTCH_FREQ|80
|INS_HNTCH_HMNCS|3
|INS_HNTCH_MODE|1
|INS_HNTCH_REF|0.39something

So I think you want to set it to 180 or so based on your FFT. How big is your copter?

The maths assumes that you are tracking motor rpm. If you are tracking something else then your notch will basically miss

that one is a 450mm. so, you say the
|INS_HNTCH_FREQ|180
and the
INS_HNTCH_BW|90 ?

i am not sure, those are 800kv motors with 10" props - isn`t it too high for a freq for this size?
anyway, if it is set now to 80hz - that correlates to the first hump. but second FFT did not show any differences - why?

Yeah sorry, that size of copter I agree the first peak is probably the motors. It’s more like 90Hz though than 80 I think. What does the post filter FFT look like? That will tell you how well it is working.

i posted both screenshots of FFT above - what do you mean?
i actually see the first one had gyro x max of 32, second one seems to show max of 24. dunno, i need to fly it again with a proper lipo, charged.

Set INS_LOG_BAT_OPT = 2 it shows the gyro values after the filter stage

Also in the wiki :wink:

it is set. i see it in the settings. ok, it is not set. :slight_smile: i was looking at the old file. will correct it now.
ok, will go outside to try again.

Those graphs are for post-filter? Ok so I suspect you are just missing the peak a little. Try 90.

You can see why the dynamic FFT is a good option - it figures this all out automatically.

You could also set ATT to 40

ok, new FFT is here, with a proper 5mah battery on - previous one was a light one.

it looks like spike is at 100hz and filter worked. so i see i need to set freq to 100hz, and att to 40.

Yes, looks right. Good stuff!

is that now a default that should be set to any configuration, ESC based or throttle based?
in all other models i have it set to 30 - is the advice now to set it to 40 everywhere?