Tuning the Harmonic Notch

That’s really interesting! It would be good to know what the actual rpm is - I think you should target that. Based on @ThePara 's specs above it wouldn’t surprise me if it’s the 56Hz peak. If you target 56Hz then 112Hz will get picked up by the next harmonic as you need. The thing is, when I was testing the Durandal on a vibration speaker there was a huge resonant spike around 100Hz - so I wonder if your second harmonic is causing resonance which makes the peak bigger. I’m wondering whether it makes sense for manufacturers to test this for their flight controllers and then users can set a static notch at the resonant frequency. I’m not sure on how the physics works on this - whether its resonance of the FC casing or of the IMU soft mount or what.

Net is - you have nothing to lose by targetting 56Hz and it might well make things better.

Any damping mechanism will have a frequency it’s vulnerable to. I’ve learned that trying to sound-proof a basement disco. There was a door with a cracked glass pane that never stopped screeching to the tune.

In our flying equation, with propeller-induced noise and frame noise, IMU-damping noise is a 3rd variable.

Interesting indeed. So here is the result of the experiment:

Pre-notch reference

:

112Hz notch

56Hz notch (1 harmonic)

Seemed smooth as silk!

Cool! This copter would benefit from the double-notch that BF uses and that @Leonardthall and I have been talking about.

2 Likes

Just upgraded to 4.0.0 and keen to try out the Harmonic Notch Filter in throttle mode.
However when I set INS_LOG_BAT_MASK = 1, EK2_ENABLE is reset to 0 and the HUD displays error message “PreArm:no EKF2 cores”.
FC is a MATEK F405-WING running 4.0.0 RC5.

Seems weird. Can you post all your parameters?

I suspect that there is something weird gong on and will reload the firmware and reconfigure everything tomorrow.

Thanks for responding.

HARMONIC.txt (18.9 KB)

Nothing obviously wrong that I can see

@andyp1per I have tuned a 5 inch quadcopter with pixracer and your small-copter-4.0 branch and I see a strange behavior.

If I use HNTCH_MODE=4 is all OK, follows plot of values from dynamic FFT and the FFT itself:

If I use HNTCH_MODE=1 with other parameters learned from dynamic FFT I see unexpected peaks on FFT, follows plot of values from dynamic FFT and the FFT itself:

here the logs for the two cases:


Another thing on the subject: I thought that FFT from Mission Planner and from command line:

mavfft_isb.py log.bin

should be similar, but this is what I obtain for Gyro and Accel on the case HNTCH_MODE=1

Accel
Accel_HNTCH_MODE_1

Gyro
Gyro_HNTCH_MODE_1

@anbello - glad my small copter branch is still working for you! I have updated it with Copter 4.0 and some other changes but done little testing.

I think the phenomena you are seeing is a problem with the throttle-based dynamic notch. Basically the update assumes that rpm is proportional to throttle squared, the problem is that zero throttle is not zero rpm - because when you arm your copter the motors spin at a non-zero speed. So the calculation is imperfect and will be more or less accurate depending on the specs of your copter. I think that higher kv motors will be worse because their zero-throttle speed is quite high. This is why FFT and ESC telemetry works better. @Leonardthall has some thoughts about how we could make this better, but nothing planned as yet.

1 Like

Both MP and pymavlink have issues. pymavlink in particular has a bunch of bugs which I have fixed here: https://github.com/ArduPilot/pymavlink/pull/354
With that PR you should get more comparable results (although MP is also doing things slightly wrong)

1 Like

Thanks for replying, anyway it seems that the pymavlink FFT is in accordance with the calculated values from your dynamic FFT with peak frequency near 200Hz.

I will do more testing with the updated branch

Thanks again

@andyp1per Now I am using your branch of pymavlink and graph ar more meaningful

FFT for Gyro Pre Filter
Gyro_No_Notch_Pre_New

FFT for Gyro Post Filter with HNTCH_MODE=4 (and dynamic FFT obviously)
Gyro_HNTCH_MODE_4_New

One thing. What is your FFT_MINHZ? You need to set your INS_HNTCH_FREQ to that for the learned ref value to be correct.

My FFT_MINHZ is 80Hz, do I have to set INS_HNTCH_FREQ = 80Hz?
I thought that INS_HNTCH_FREQ should be set to the learned hover frequency that for me is near 220Hz looking at the plot of FTN1.PkAvg, am I wrong?

Yeah sorry it’s not very clear.

You can either set INS_HNTCH_FREQ to the learned hover frequency and set ref to the learned hover throttle or set INS_HNTCH_FREQ to FFT_MINHZ and ref to the learned ref value.

In my test I used the first of the two options, anyway what you wrote above is for HNTCH_MODE=1, with HNTCH_MODE=4 this parameters get automagically the right values, right?

Yes. With mode 4 you don’t need these parameters.

1 Like