Harmonic Notch Tuning. I must be doing something wrong

This is not the first time i tune the harmonic Notch, but its the first time i cant figure out whats going on.
This is a 690 frame with a Cube Orange Plus. I have verified that my frame does not have flex, my cube is screwed on properly, all cables secured and not jumping around. Propellers are verified to be balanced and still i cant make sense of it. 17" Props and my initial params set same as always.
So far pid is bad, but good enough to perform stable hover in order to find Hover throttle and small 1-2 minute flights to run FFT on all 3 imu so i can tune my harmonic notch filter. But still i can figure out what am i doing wrong with this one. I have taken it apart a number of times to check that all parts are in proper condition and everything works as it should and here are my pictures and logs.
All Logs in this link and names can be seen on the FFT pictures. Logs FFT 690 Issue - pCloud
I take of with my HNTC Frequency set to 56 as i had found from my last flight and here is the result.

Log is fft_hover_56hz.bin
On this my Y and Z vibes average between 11-12 on Imu2 and X around 5
IMU0 X 1,6, Y 2,2 and Z 5,5
IMU1 X 1.7, Y 2.3 and Z 3.8
On which i realized that i had forgotten mu mode to 4, when it should of been 1.
Same HNTC with correct Mode (Set to 1 for throttle, but still my REF value is Hover Throttle*0.6 as i had seen on a post here)

I could see instantly that my Gyro on FFT changed frequency. Peak on IMU0 is 44hz the cube sweatspot, IMU1 is 90 which is another cube sweatspot and IMU2 is at 324hz


Dropping down to 44hz *the log is FFT 56hz _mode1 test.bin) and my vibes as follows.
IMU0 all axis below 10, but at some point X jumps to 80 or so and Clipping starts kicking in)
IMU1 Same as IMU0
IMU2 X and Y average arounf 10-12 and Z at 9 and NO CLIPPING

Next round was to start from scratch by disabling Harmonic Notch. High Peak on IMU0 was 46Hz and the log is Disabled INS_HNTC.bin


This was not even a flight is was takeoff and also instant land since clipping kicked in on IMU0 and IMU1.
And from what i understood so far is the Vibes are within reason but the frequency is right where is the Cube isolation Cant take it and goes Haywire.
Enabled HNTC at 46hz and Mode1 with Ref at 0.26 which is my hover throttle and my FFT looked like this:

On which i have not two minor peaks at 56 and 107hz on Imu0, almost similar on IMU1 and a really low amplitude on at 105hz on Imu2. which is similar to all other tests i have done so far when i use a harmonic between 43 and 46hz.
Log is 690 Flight test 46hz.bin
Vibes:
IMU0 X lean 3.2, Y 3.2, Z 8
IMU1 X3.3, Y3.5, Z8.8
IMU2 X8.8, Y14, Z11.6
Would the Harmonic GODS here suggest i have my Harmonic at the 46hz and add s static at 105, or the proper way would have to be the other way around since from my test i conclude that my frame harmonics are on the Cubes isolation frequency?

1 Like

@xfacta i know you are very good with this and have helped many people in here and i would appreciate your input.

I looked at the “disabled” log.
You’ve got some crazy X axis vibrations that started half way through the flight, as if there was a sudden mechanical issue. So I’ve discounted the FFT data from that flight.

Set logging back to relatively normal:
LOG_BITMASK,180222

Next I looked at the 46hz test flight.
I couldn’t see why you would target 46Hz, since that wasnt showing up as a significant frequency anywhere.
The frequency I would estimate for your prop size is 53Hz, and in that log the base frequency is 58Hz, so that’s pretty close to my estimate :slight_smile:

So I would set these and do another test flight, then we can see if we need to target more harmonics (usually they all just go away) or any static frequencies or a second dynamic notch (but I doubt it)

INS_HNTCH_BW,24
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_FREQ,58
INS_HNTCH_HMNCS,7
INS_HNTCH_REF,0.18
PSC_ACCZ_I,0.5
PSC_ACCZ_P,0.25

I would probably raise MOT_SPIN_MIN to about 0.1 or maybe a bit more, to be sure motors and ESCs dont lose sync during descents or wind gusts.

See if you can do something about vibrations too, because the Z axis vibes is getting borderline for the non-damped IMU, and just a little less than ideal for the damped IMUs. It’s not bad yet, but you dont want some wear-and-tear or something to go wrong in-flight and send vibrations over the limit.

1 Like

As you can see i had already dont a test flight with 56hz and there there is a harmonic remaining at 44hz, not all settings were similar to yours and clipping on the isolated imus started towards the end of the flight. I will go and test today and come back to you.
As about the 44-46hz they came from a number of tests with disabled HNTC. As about mechanical issue, last night i took the whole thing apart once more, just to inspect. there is nothing wrong and i start having a feeling that the “hidden” 45ish hz drives 0 and 1 crazy and in combination with the 58 you suggest, drives 2 crazy also.
Thank you for your reply.

@xfacta I added your settings, including Spin_min and i did a number of tries during which i almost made some changes.
1st test which is the log: xfacta settings 1st try clip on loiter.bin
i took off on Alt hold and after few secs wanted to switch on loiter.
On IMU2 you can see i takeoff and my vibes dont go higher than 10-15…until: IMU0 and IMU1 started clipping like crazy.
On which also my X axis vibes started going crazy high. (No mechanical issue and ill explain why i say this in the end.)


Even though you said that on such file FFT should not be considered, i decided not to take you advise and see what FFT had to say. A significant peak at 44hz

I decide to keep the Harmonic as per your instructions and add a static notch at the 44hz. I Say a prayer and takeoff with my eyes set to see if any clipping will occur.
Log is: xfacta settings plus slight extra D and static notch at 44hz.bin
IMU2 vibes now peak at 27 and 0/1 17 and 19. On this one i also increased d term slightly to help fly a little better because there was a bit of wind… I need to not that IMU2 XY vibes were between 20/30 while IMU0/1 XY vibes were peaking at 7.
Checking FFT on this test i could see that the amplitude dropped to 0.04 on IMU0, 0.25 on IMU1 and 0.017 on IMU2 and that the peaks now were 107 on 0, 110 on 1 and 55 on 2.

Since during this flight i did not see any clipping i decide to make a series of small test flights on which i tuned the copter to flight slightly better and run another measurement flight. By now wind had started picking up a bit and gusts also.
Log of the last test flight is: XfactaSet Manual PID increase_Harmonic and Static.bin
On filtered FFT i can see peaks of 107, 105 and 57 accordingly.

By making a quick check on the log i could see my PID is alot better (Not correct) and the noise seems to be gone.
Vibes on 0 for XY are close to 7 and Z peaks on 17, IMU1 almost same and IMU2 seems to be getting 20/30 with no clipping (for which phillip has said that for this sensor if there is no clipping is ok, but still trying to see what else that might vibes i am missing).
Besides your thoughts and input i would like to know why did you give me a BW value of 24 (instead of 29 which is 58/2).
Checking the frame once more i can see that top and bottom plates are pretty thin and whild i have reinforced and i have see there is alot less flex, there is the part the lading gear bolts on that still has flex and this is most like the culprit. Looking to add standoff at the 4 screws of the landing hear to bolt on the top plate and see if that makes any difference on IMU2

That extra vibration and clipping is a physical issue that needs fixing, such as the flex you’ve found.
It’s too much for the software (harmonic notch filter) to cope with.

took the frame apart once more and inspected all parts one by one.
before that as i had sai i was able to see a bit of flex where the retract mounts and i had a fix for it.
While being apart i compared the frame piece by piece with one that flys perfect with no issue, no vibes and no clipping. What i was able to find is that on this frame the top and bottom plates are NOT 1.85mm (in theory should be 2mm) but they are 1.65, thus making a significant difference and even by hand i can feel that i can “push” 2 diagonal arms towards the thrust direct. i think that along with the hover frequency is creating both the 112hz frequency peak as also the 46hz static notch. i run another 12 1min flights tweaking each time and also decided to test a double notch. Only reason i tested notch at the 109/112 range is because thats where i could see my high peak.
Its seems on the particular frame the combo of motor, prop along the newer lower quality of the frame is the cause.
As about clipping. i only get it if i dont have a static notch the the 44/46hz range. When a static is in place there is not clipping and vibes on IMU0 and 1 for XY peak at 8 and Z peaks at 15/16, while on the non isolated IMU peak at XY at 15 with peaks of 20/25 and Z about the same with some fast maneuvers and braking.
15 6-14-2023 9-22-06 PM.bin

The vibrations measured by the IMUs are physical, measured before the software filters we are discussing here. The only way that setting harmonic notches and static notches can affect the actual vibrations is if there is some sort of feedback or resonance. That could be possible.
The risk will be that all the resonances will change if you make any changes to the copter, like adding or changing payload, or battery pack. Then you could be back to extreme vibrations and noise all of a sudden, and flight would be affected.
The real fix will be to get new plates cut from stronger material.

The highest most obvious peak is almost never the primary frequency that needs to be targeted. It’s usually half of that frequency. Setting a notch filter for the highest peak is only squashing a harmonic and not the real frequency that is causing the trouble.

@xfacta i took all you had to say under careful consideration and it seems i found my issue. I had already done a mod on the retracts to have them sturdier which made a small difference but the whole issue as i can see from my two latest logs was the factory battery mount. Tarot uses some rubber grommets with 10mm CF pipe to install a battery holder on it. Took that whole assembly off and installer 10mm CF clamp and also installed the battery mounts straight in the CF tube, wrapping the battery strap around the CF pipe, thus creating a 100% solid fixture of the battery to the frame. This is with no harmonic notch active 690 No Harmonic Setup_ Solid install Battery.bin - pCloud
and this is with a 52hz, because i feel this is my starting frequency. 690 Solid Battery_52hz harmonic.bin - pCloud
IMU 0 and 1 vibes on X Y and Z with or without the notch are peaking at 9 while IMU2 peaks at 25 (higher on Y, but lower overall with harmonic setup), flight one was with calm breeze and flight two with a bit of wind.
As i can see on both flights and conditions, 52hz did not change on the logs, and vibes are all under control Thanx once more for spending the time to push me and having me find the root cause so far. More testing to be done, but apparently the grommets i go in this frame are different from older versions and by a post i read on the Cubepilot FB page, for the orange vibes of this magnitude if there is no clipping is not an issue, but still i source and lower IMU2 vibes also.
Even though i will test some more changes on the frame which i strongly to believe will lower IMU2 and keep the same for 0 and 1. Good thing is there is no clipping on any of my flights, not only on the ones posted here.

I took the no-notch log and ran it through the new filter review tool and I came up with this after a bit of playing around:

INS_HNTCH_ENABLE,1
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.16
INS_HNTCH_FREQ,46
INS_HNTCH_BW,20
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_HMNCS,47
INS_HNTCH_OPTS,0

The vertical black lines and grey areas are where the notches should take effect with the above settings. You can see the estimated post-filter lines are practically flat across the bottom of the graph.

Then I looked in your second log with 52Hz filter.
Attitude control is better and smoother.
The filter is working effectively (judging by the MissionPlanner FFT graphs)
In the new filter review tool it shows a result less than ideal - the notches dont line up with the harmonics very well, and the post-filter lines still have noticeable amplitude in that 50Hz region.

So I just tweaked a couple of your settings you had in that log to:

INS_HNTCH_FREQ,48
INS_HNTCH_HMNCS,7
INS_HNTCH_OPTS,0

and got a good result, all post-filter noise is practically gone.

It would be very helpful if you can do another flight just with those three HNOTCH params adjusted and post the resulting .bin log.

I think it would be incorrect to say that just because there’s no clipping means vibrations wont affect flight. I think you could further reduce vibrations (for the non-damped IMU) by checking prop balance.

EDIT: changed harmonics setting to 7 - it still knocks out all the higher harmonics and less chance of causing performance issues.

Hello @xfacta ,

Took your settings, rechecked my blades and motors to make sure vibes are not from there (anything remaining should be frame related but ill investigate more) and run two small flight for you today.
Xfacta FFT Analysis Settings BWsame at 26hz.bin - pCloud your settings and nothing else changed.
Xfacta FFT AnSettings PID test PR no Yaw.bin - pCloud same ins settings as you asked only slightly different PID.
wokring out also something that might reduce harmonics or vibes a bit more and i will have full battery test flights in the morning.

In addition i forgot to post this which is slightly more worked on the PID but both rate and P need more work to track better.

@iampete (see graphs in previous posts)
Well these HNOTCH settings derived from some time spent in the new Filter Review tool totally knocked out any noise - more so than we could have done using the normal methods and theory with only the MissionPlanner FFT graphs. To achieve the same effectiveness would have taken more test flights specifically to experiment with HNOTCH values, not knowing what the results would have been.
The revelation is the frequency is set lower than we would have previously expected due to the “shape” of the notch, and this can be clearly seen in the new Filter Review tool.

image

It looks like attitude control is nice and smooth with only minimal work required to complete the tune now,
You can safely set
ATC_THR_MIX_MAN,0.5
I would just run Autotune.
In that final log the Roll attitude control is actually worse than what it was in the previous two logs, so I’d put those PIDs back.

1 Like

@xfacta Once Again thank you for your input and helping me locate my main source.
Even though i am working on lowering the IMU2 vibes even more, here is a log as an FIY for you with slightly better PID on higher wind and also faster moves.

Dont forget this one:

Now that attitude control and PIDs look good.

i did it on the next flight that i worked slightly more on the PID and input shaping. I forgot to mention that this test was fully loaded.