From 5b0f30ad4487fb090ce1c3f6f2c196c9f4c91e6d Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sun, 1 Oct 2023 18:21:01 +0100 Subject: [PATCH] AP_WheelEncoder: update for new AC_PID settings enable filters with AP_FILTER_ENABLED --- .../AP_WheelEncoder/AP_WheelRateControl.cpp | 70 ++++--------------- 1 file changed, 13 insertions(+), 57 deletions(-) diff --git a/libraries/AP_WheelEncoder/AP_WheelRateControl.cpp b/libraries/AP_WheelEncoder/AP_WheelRateControl.cpp index 0edf03fe9d..97c9a1e19c 100644 --- a/libraries/AP_WheelEncoder/AP_WheelRateControl.cpp +++ b/libraries/AP_WheelEncoder/AP_WheelRateControl.cpp @@ -91,12 +91,6 @@ const AP_Param::GroupInfo AP_WheelRateControl::var_info[] = { // @Description: Wheel rate control PD sum maximum. The maximum/minimum value that the sum of the P and D term can output // @Range: 0.000 1.000 - // @Param: _RATE_ADV - // @DisplayName: Wheel rate Advanced parameters enable - // @Description: Wheel rate Advanced parameters enable - // @Values: 0:Disabled,1:Enabled - // @User: Advanced - // @Param: _RATE_D_FF // @DisplayName: Wheel rate Derivative FeedForward Gain // @Description: FF D Gain which produces an output that is proportional to the rate of change of the error @@ -105,31 +99,15 @@ const AP_Param::GroupInfo AP_WheelRateControl::var_info[] = { // @User: Advanced // @Param: _RATE_NTF - // @DisplayName: Wheel rate Target notch Filter center frequency - // @Description: Wheel rate Target notch Filter center frequency in Hz. - // @Range: 10 495 - // @Units: Hz + // @DisplayName: Wheel rate Target notch filter index + // @Description: Wheel rate Target notch filter index + // @Range: 1 8 // @User: Advanced // @Param: _RATE_NEF - // @DisplayName: Wheel rate Error notch Filter center frequency - // @Description: Wheel rate Error notch Filter center frequency in Hz. - // @Range: 10 495 - // @Units: Hz - // @User: Advanced - - // @Param: _RATE_NBW - // @DisplayName: Wheel rate notch Filter bandwidth - // @Description: Wheel rate notch Filter bandwidth in Hz. - // @Range: 5 250 - // @Units: Hz - // @User: Advanced - - // @Param: _RATE_NATT - // @DisplayName: Wheel rate notch Filter attenuation - // @Description: Wheel rate notch Filter attenuation in dB. - // @Range: 5 50 - // @Units: dB + // @DisplayName: Wheel rate Error notch filter index + // @Description: Wheel rate Error notch filter index + // @Range: 1 8 // @User: Advanced AP_SUBGROUPINFO(_rate_pid0, "_RATE_", 3, AP_WheelRateControl, AC_PID), @@ -207,12 +185,6 @@ const AP_Param::GroupInfo AP_WheelRateControl::var_info[] = { // @Description: Wheel rate control PD sum maximum. The maximum/minimum value that the sum of the P and D term can output // @Range: 0.000 1.000 - // @Param: 2_RATE_ADV - // @DisplayName: Wheel rate Advanced parameters enable - // @Description: Wheel rate Advanced parameters enable - // @Values: 0:Disabled,1:Enabled - // @User: Advanced - // @Param: 2_RATE_D_FF // @DisplayName: Wheel rate Derivative FeedForward Gain // @Description: FF D Gain which produces an output that is proportional to the rate of change of the target @@ -221,31 +193,15 @@ const AP_Param::GroupInfo AP_WheelRateControl::var_info[] = { // @User: Advanced // @Param: 2_RATE_NTF - // @DisplayName: Wheel rate Target notch Filter center frequency - // @Description: Wheel rate Target notch Filter center frequency in Hz. - // @Range: 10 495 - // @Units: Hz + // @DisplayName: Wheel rate Target notch filter index + // @Description: Wheel rate Target notch filter index + // @Range: 1 8 // @User: Advanced // @Param: 2_RATE_NEF - // @DisplayName: Wheel rate Error notch Filter center frequency - // @Description: Wheel rate Error notch Filter center frequency in Hz. - // @Range: 10 495 - // @Units: Hz - // @User: Advanced - - // @Param: 2_RATE_NBW - // @DisplayName: Wheel rate notch Filter bandwidth - // @Description: Wheel rate notch Filter bandwidth in Hz. - // @Range: 5 250 - // @Units: Hz - // @User: Advanced - - // @Param: 2_RATE_NATT - // @DisplayName: Wheel rate notch Filter attenuation - // @Description: Wheel rate notch Filter attenuation in dB. - // @Range: 5 50 - // @Units: dB + // @DisplayName: Wheel rate Error notch filter index + // @Description: Wheel rate Error notch filter index + // @Range: 1 8 // @User: Advanced AP_SUBGROUPINFO(_rate_pid1, "2_RATE_", 4, AP_WheelRateControl, AC_PID), @@ -320,7 +276,7 @@ AC_PID& AP_WheelRateControl::get_pid(uint8_t instance) void AP_WheelRateControl::set_notch_sample_rate(float sample_rate) { -#if AC_PID_ADVANCED_ENABLED +#if AP_FILTER_ENABLED _rate_pid0.set_notch_sample_rate(sample_rate); _rate_pid1.set_notch_sample_rate(sample_rate); #endif