Andrew Tridgell
Andrew Tridgell
the DynamicRpmNotches flapping test has me worried. It failed on this PR:  it passes locally, so likely just flapping again, but I think we should try and get it...
The attenuation formula from https://github.com/ArduPilot/ardupilot/issues/25461 does not seem to be correct. This PR implements it and also adds a test that graphs attenuation and phase lag with and without the...
after some discussion with @lthall we decided to use a linear interpolation and keep the notch at the min frequency. This ensures phase lag is no worse than current code...
@lthall @andyp1per after the discussion on the call today this graph illustrates the result:  This is the familiy of attenuation graphs for the following settings: - INS_HNTCH_FREQ = 50...
@lthall @andyp1per this is the equivalent graph for current master (ie. before this PRs changes):  Key difference is that the higher harmonics don't track down to the desired frequency...
> There is a subtle but bad bug in `HarmonicNotchFilter::update(uint8_t num_centers, const float center_freq_hz[])` methinks yep! fixed by making single frequency update call the multi frequency, so only one code...
See updated graphs in the discord thread for latest results with more symmetric notches
I flew this on a 6" quad and on a 7kg quadplane today, worked as expected
@lthall need the thresholds for nyquist and bandwidth, we use a combinations of 0.48, 0.5 and 0.52 in various places
> * We only get that for the first motor, but if it works for it then we can reconstruct the same data for the other motors from the `FTN`...