Tuning the Harmonic Notch

Thanks for answer @andyp1per, on the Pixracer I always used only the first IMU (less noisy) do you think I could have more benefit using both IMU? Do the dynamic FFT calculation repeated for both IMU create load problems? Also applying the harmonic notch comport double work for the MCU?

Sorry for so much questions.

The FFT only runs on primary IMU - so no increase there.

The F4 is only able to handle about 6 notches reliably at 1k backend. So if you use faster backend then donā€™t use double-notches. Double-notch with the dynamic harmonic at 1k should be ok.

To use faster backend do you mean use you PR https://github.com/ArduPilot/ardupilot/pull/14441 ?

Another Q: setting INS_FAST_SAMPLE = 1 could help in some way?

Yes. Both of these will only significantly help if you have very high motor speeds.

1 Like

Hello everyone!
Iā€™ve made the harmonic notch filter based on the throttle. I use a hexacopter with 15" propellers. They could tell me if the setup is correct. Thanks a lot!!
INS_HNTCH_ENABLE 1
INS_HNTCH_FREQ 67
INS_HNTCH_BW 34
INS_HNTCH_HMNCS 3
INS_HNTCH_REF 0.23752556
INS_HNTCH_MODE 1
INS_HNTCH_ATT 40
Flight


Post-Flight

Dynamic flight

Notch frequency scale data
0.2375256*SQUAREROOT( 62 / 67 ) ? 0.2284498783780
Is this correct?
I attach my records
Flight
Post-Flight
Dynamic_Flight
Thank you!!
Mauro

Hey @andyp1per
Iā€™m planning to use harmonic notch on 13" quad running Blheli ESCs. Was wondering what would happen if Blheli telemetry is lost mid-flight or if there was frame loss. Is there any fail-safe kind of measure?
Thank you!

It looks ok to me, although I am surprised that the gyros donā€™t get squashed more - maybe you are missing the frequency by a little.

We only take current data from the ESCs and we average those for which we have data. So you would have to lose all ESC info for more than 1s to see any kind of issue. If you lose it completely then the frequency would stay where it was.
In the FFT there is a failsafe fallback that uses throttle based support if the FFT health is bad. I guess we should probably do the same for the ESC telemetry.

1 Like

ESC telemetry failsafe fallback to throttle based seems so usefull, please make it real soon. Thanks!

Thanks.
For copters with blheli ESCs,
INS_HNTCH_MODE=3
INS_HNTCH_REF=1
Thatā€™s all?
No need to run FFT and find frequency and bandwidth?

1 Like

Yes, correct

More words

2 Likes

Hello,

I tried today the first time the harmonic notch filter, so I would be very thankful if someone could take a look at it, if everything is ok. It is a flat 18" octo, each flight was around 1min hover.

INS_HNTCH_ENABLE, 1
INS_HNTCH_FREQ, 100
INS_HNTCH_BW, 50
INS_HNTCH_ATT, 15
INS_HNTCH_HMNCS, 3
INS_HNTCH_REF, 0.2174736
INS_HNTCH_MODE, 1

before:

after:

1 Like

Looks pretty good!

You could probably squash that peak at 50Hz with a static notch.

2 Likes

Setting up Static Notch and Dynamic Harmonic notch filters.

Iā€™m setting up a copter (4.03) and noticed on the first tuning flights some weird behaviour in Alt Hold and GPS Pos hold when it comes to altitude.

It sometime shot up a few meters.

First i thought it was a problem with the barometer, but someone adviced me to take a look at the vibrations.

In the first log I saw a vibration failsafe at the point where the altitude altered.

Also in the log you can see the barometer alt reading to drop (even below take off altitude).

So i got the advice to setup the noise filtersā€¦ so here I am.

Iā€™m using this page as reference https://ardupilot.org/copter/docs/common-imu-notch-filtering.html

Iā€™m not using esc telemetry so Iā€™m using the Throttle based setup.

I setup FFT and used batch sampler to capture the 1st IMU

Set INS_HNTCH_MODE = 1 to use Throttle based estimation on the notch filter.

Set INS_LOG_BAT_OPT = 0 to capture pre-filter gyro data.

Hereā€™s the graph

And a link to the LOG file https://www.dropbox.com/s/dzurvdzssxie7fl/2020-06-10%2021-14-24.bin?dl=0

I also used MOT_HOVER_LEARN = 2

This should give me a hover thrust and hover frequency somewhere.

Where can I find what these values are? So the values it learned.

What graphs do i look at in the log file to find this out?

i did find something resembling throttle and read a value of 0.17 and that also seemed the value it entered for INS_HNTCH_REF

Can someone help me what to fill in for

INS_HNTCH_FREQ

INS_HNTCH_BW

Is the frequency what you read from the batch capture?

Any help would be appreciated , so i can move on to step 2

Post flight setup and analysis.

Or can I set INS_HNTCH_MODE = 4 and be done with it :smiley:

MOT_THST_HOVER will give you the learned value

From your FFT INS_HNTCH_FREQ could be 55Hz or 110Hz depending on the size of your copter (you are looking for the larget peak in the graph essentially but with obvious harmonics)
INS_HNTCH_BW should be set to half of that value to start wuth

The Accel peak you have at 300Hz or so on Z is huge - something bad mechanical is going on there, you should figure out what it is and fix it.

2 Likes

Itā€™s a 15" and always flew great without ardupilot.
So Iā€™m convinced ardupilot should also do a good job.

The FC is a matek 765 and is sort of softmounted

1 Like

Before using the notch filters the Z vibe level in general should be addressed as Andy suggested. The peak vibe levels showing are not extremely high yet clipping events are accumulating rapidly. Perhaps ā€œSort of softer mountingā€ the FC is in order.

1 Like

This is not often the case!

Ardupilot is much more sensitive to vibrations and other issues than other software Iā€™ve tried. But when itā€™s working, it is amazing.
The issue is definitely something vibrating, and needs to be physically addressed.

1 Like

So what is a suggestion for reducing this Z vibration?

Soft mount the FC?

1 Like

Thank you! I tried a waypoint mission today, made the same mission before the change and have now even less vibrations, half on the Z Axis. So that seems to work really good.

Waypoint

Litte bit unsure on the static notch, would you suggest these settings?

INS_NOTCH_FREQ = 46
INS_NOTCH_BW = 23
INS_NOTCH_ATT =15