Tuning the Harmonic Notch

Good day Dave,

I had crash and need to calibrate all the electronic. My notch filter is still on the old setup.


It’s probably still good. But set INS_LOG_BAT_OPT to 0, and make another hover flight to check it.

Update to latest stable.

Thanks Dave

I have the radiolink minipix and it don’t want to update to the latest update.
Here is a quick hover with the INS_LOG_BAT_OPT set to 0.


That’s a Tlog. .bin log required.

Sorry,

Copied the wrong file :see_no_evil:

There seems to be 2 fundamental modes of vibration and their respective harmonics so targeting them could be a challenge. You could try this:

INS_HNTCH_ATT,40
INS_HNTCH_BW,38
INS_HNTCH_ENABLE,1
INS_HNTCH_FREQ,76
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.339

Or a combination of static and harmonic:
INS_HNTCH_ATT,40
INS_HNTCH_BW,60
INS_HNTCH_ENABLE,1
INS_HNTCH_FREQ,120
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.339
and
INS_NOTCH_ATT,20
INS_NOTCH_BW,20
INS_NOTCH_ENABLE,1
INS_NOTCH_FREQ,76

Try both strategies and see which works better.

Thanks Dave for your help.
I have tried both and it doesn’t look any better to me.


This is the settings on top.


This is the combination.

You need to set the INS_LOG_BAT_OPT parameter to 2 to see how effective either of those configurations are. You will have to make 2 more flights.

1 Like

Hi Dave

Ok the 2nd test looks a lot better.



Indeed it does. I think that’s the best result I have seen of combination use of the Static and Dynamic Notch on what was a rather complicated FFT. Looks good!

Thanks Dave for all your help.

Hi Folks,

I’d just like some feedback on this notch tuning. EDU-450. (10" props) PixRacer R15. 4s 5200MAh battery. It was probably too windy to be doing first-flights today but some times you have to make hay while the sun shines (or fly when the wife is busy…). In spite of the wind the vibrations looked good so I went ahead and tried notch tuning.

Before:
https://cp.sync.com/dl/9d66e8740/q7hnecmz-yw5czbrq-m92hc9p2-fjhksjnr

INS_HNTCH_REF = 0.177
INS_HNTCH_FREQ = 160
INS_HNTCH_BW = 80

After
https://cp.sync.com/dl/8ca0cdb10/ayjqn6j3-3ku64mry-b9exarfw-fdxvueif

Thanks!

Try with the freq at around 90 and bw 45. I cant tell exact values now, but whatever that first peak is.

1 Like

I think I misunderstood what was meant by first peak, that’s why I went for 160, not 96. Thanks for setting me straight.

I updated my mission planner to the latest beta so it seems the FFT scaling looks different. I’ll repost the graphs so they’re comparable.

Stock:

Yesterday (freq: 160, BW 80)

Today (Freq 96: BW 48)

Certainly cleaned up the first peak, but there is still a harmonic around 155-160. INS_HNTCH_HMNCS is at the default of 3. Do you think it’s worth messing with this anymore considering I’m using throttle sensing not ESC? With the wind today I can’t really judge the flying qualities. I did a 5 minute flight in loiter and pos-hold (still un-tuned) and the fact that it didn’t crash in the winds today says it must be doing alright.

Hey everyone! I’m new to the harmonic notch thing, but am hopeful I can use it to get my quad a bit more stable. I’ve had issues with vibrations on this quad before. Switching from the foam tapes included with Pixhawks to a vibe dampening mount improved the drone from being unsafe to fly to usable. Obviously that doesn’t remove all the vibrations but it does help. I’m hoping the notch can help. I’ve followed the wiki and tried two different sets of settings but still see peaks around my ref freq and the next harmonic. Also haven’t seen much improvement in the stability of the drone.

Build details:
Pixhawk 2.1, Copter 4.0.3, upgraded to 4.0.7
HERE GPS
Tarot X4 frame
T-Motor U7 420KV Motor
Tarot 1855 props
40-Amp T-Motor ESCs
6S 16AH Lumenier LiPo, or a Tattu 6S 14AH

Each of these logs were made with INS_LOG_BAT_OPT = 2 for post filter data. I assumed that this is equivalent data to pre-filter if the filter was entirely disabled. Obviously would be a problem if I’m wrong there.

Stock:

After enabling the notch for the first time. Ref value taken from the learned hover value

Edited the notch to increase attenuation.

Obviously there are still peaks in the gyro. It would appear to me that the harmonic around 108 or so is pretty well squashed on the third picture, but the harmonic around 54 is definitely still there. Should i be increasing the attenuation further? Should I increase the bandwidth as well?

Also, should I still be seeing peaks int he accel graphs? I think I read somewhere that this notch only shows a difference in the gyro graphs, but just wanting to make sure.

Drive link to log files

Hey - to bump the thread and add a bit more information,

I’ve tried increasing the notch attenuation as high as 140 and played around with the bandwidth as well. The graphs essentially haven’t changed. I decided to to fly again with the pre-filter logging enabled and will post the chart below. Obviously the filtering is bringing down the large peaks dramatically, but is there a way to get them down the rest of the way? Or are the above graphs what a “correct” filter looks like and I should move on to tuning my quad in other ways?

Thanks for any insight!

You definitely want these:
INS_HNTCH_ATT,40
INS_HNTCH_BW,27
INS_HNTCH_ENABLE,1
INS_HNTCH_FREQ,54
INS_HNTCH_HMNCS,3
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.277

You’ve got some ATC FLT settings too low, example: ATC_RAT_RLL_FLTT,8 , should be 13 (don’t go below 10)
And INS_GYRO_FILTER could go up to 26.
Download a new copy of this spreadsheet and check all you params

Setting those filter values too low filters out actual movements that you want the flight controller to work with, instead of just noise.
But be aware I think your ATC_ANG P values and ATC_RAT PIDs are all a bit too low. So increasing the filters alone could allow those PIDs to cause oscillations - or might not.
You might like to put in these relatively safe PIDs at the same time as fixing the filter values.
ATC_ANG_RLL_P,5.0
ATC_ANG_PIT_P,5.0
ATC_ANG_YAW_P,4.5
ATC_RAT_RLL_P,0.11
ATC_RAT_RLL_I,0.11
ATC_RAT_RLL_D,0.006
ATC_RAT_PIT_P,0.11
ATC_RAT_PIT_I,0.11
ATC_RAT_PIT_D,0.006
I think you’ll find, in the end, those ATC_ANG P values will be able go higher than you expect.

1 Like

@andyp1per

I was trying to set hormonic notch filter to my quad and followed tuning guide on wiki.
before filter enabled that LOG__BAT_MASK = 1.done hover test in AltHold mode for 2min and found peak frequency that 115hz.

bin file also attached here:
https://drive.google.com/file/d/1fcwD09RVh9bxHT5emwpUIVqOqIIHRvNG/view?usp=sharing

Then enabled INS_HNOTCH_ENABLE = 1
INS_HNTCH_REF = MOT_THST_HOVER
INS_HNTCH_FREQ = 115HZ
INS_HNTCH_BW = 56
INS_HNTCH_MODE = 1
INS_HNTCH_OPTS = 3
then Enabled INS_LOG_BAT_OPT = 2 & INS_LOG_BAT_MASK = 0.
performed hover flight in AltHold mode and landed .

plotting the post filter FFT graph but its unable to load the graph.
post filter flight log here:
https://drive.google.com/file/d/1uNmJDDoh-23IQn1Ai1smcDfjos6diBR9/view?usp=sharing

parameter file also attaching here:M690 parameter.param (16.1 KB)

please guide me where I’m doing wrong .

Of course it won’t log IMU data with this disabled.

There’s no point in setting this with the throttle based notch