Skip to content

Commit

Permalink
Filter: Make heli default mode for harmonic notch tracking = fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKear committed Dec 5, 2024
1 parent 9063fb8 commit ea5a4ea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libraries/Filter/HarmonicNotchFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "HarmonicNotchFilter.h"
#include <GCS_MAVLink/GCS.h>
#include <AP_Logger/AP_Logger.h>
#include <AP_Vehicle/AP_Vehicle_Type.h>

#define HNF_MAX_FILTERS HAL_HNF_MAX_FILTERS // must be even for double-notch filters

Expand Down Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ea5a4ea

Please sign in to comment.