From ea5a4ea6054bfd5175031dcbaeef43855881252d Mon Sep 17 00:00:00 2001 From: MattKear Date: Thu, 5 Dec 2024 04:49:20 +0000 Subject: [PATCH] Filter: Make heli default mode for harmonic notch tracking = fixed --- libraries/Filter/HarmonicNotchFilter.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/Filter/HarmonicNotchFilter.cpp b/libraries/Filter/HarmonicNotchFilter.cpp index c98a50eeac4ea..5a3cc84760af5 100644 --- a/libraries/Filter/HarmonicNotchFilter.cpp +++ b/libraries/Filter/HarmonicNotchFilter.cpp @@ -21,6 +21,7 @@ #include "HarmonicNotchFilter.h" #include #include +#include #define HNF_MAX_FILTERS HAL_HNF_MAX_FILTERS // must be even for double-notch filters @@ -48,6 +49,13 @@ */ #define NOTCHFILTER_ATTENUATION_CUTOFF 0.25 +#if APM_BUILD_TYPE(APM_BUILD_Heli) + // We cannot use throttle based notch on helis + #define NOTCHFILTER_DEFAULT_MODE 0 // fixed +#else + #define NOTCHFILTER_DEFAULT_MODE 1 // throttle based +#endif + // table of user settable parameters const AP_Param::GroupInfo HarmonicNotchFilterParams::var_info[] = { @@ -120,7 +128,7 @@ const AP_Param::GroupInfo HarmonicNotchFilterParams::var_info[] = { // @Range: 0 5 // @Values: 0:Fixed,1:Throttle,2:RPM Sensor,3:ESC Telemetry,4:Dynamic FFT,5:Second RPM Sensor // @User: Advanced - AP_GROUPINFO("MODE", 7, HarmonicNotchFilterParams, _tracking_mode, int8_t(HarmonicNotchDynamicMode::UpdateThrottle)), + AP_GROUPINFO("MODE", 7, HarmonicNotchFilterParams, _tracking_mode, NOTCHFILTER_DEFAULT_MODE), // @Param: OPTS // @DisplayName: Harmonic Notch Filter options