From a9fb5ceb5ccc2af4316fd17279f4984b63f0d8c0 Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Tue, 3 Aug 2021 13:35:05 +0930 Subject: [PATCH] AC_PID: fix PID filter names FILT -> FLTE, D_FILT -> FLTD Follow used guided but references the maximum velocity settings. As Guided does not set maximum velocities these values come back as zero. So we need to reference WP_Nav to get safe maximums. --- libraries/AC_PID/AC_PID_2D.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libraries/AC_PID/AC_PID_2D.cpp b/libraries/AC_PID/AC_PID_2D.cpp index 0bbfb210d0..d34b6e5303 100644 --- a/libraries/AC_PID/AC_PID_2D.cpp +++ b/libraries/AC_PID/AC_PID_2D.cpp @@ -4,8 +4,7 @@ #include #include "AC_PID_2D.h" -#define AC_PID_2D_FILT_HZ_DEFAULT 20.0f // default input filter frequency -#define AC_PID_2D_FILT_HZ_MIN 0.01f // minimum input filter frequency +#define AC_PID_2D_FILT_E_HZ_DEFAULT 20.0f // default input filter frequency #define AC_PID_2D_FILT_D_HZ_DEFAULT 10.0f // default input filter frequency #define AC_PID_2D_FILT_D_HZ_MIN 0.005f // minimum input filter frequency @@ -25,22 +24,22 @@ const AP_Param::GroupInfo AC_PID_2D::var_info[] = { // @Description: The maximum/minimum value that the I term can output AP_GROUPINFO("IMAX", 2, AC_PID_2D, _kimax, 0), - // @Param: FILT + // @Param: FLTE // @DisplayName: PID Input filter frequency in Hz // @Description: Input filter frequency in Hz // @Units: Hz - AP_GROUPINFO("FILT", 3, AC_PID_2D, _filt_E_hz, AC_PID_2D_FILT_HZ_DEFAULT), + AP_GROUPINFO("FLTE", 3, AC_PID_2D, _filt_E_hz, AC_PID_2D_FILT_E_HZ_DEFAULT), // @Param: D // @DisplayName: PID Derivative Gain // @Description: D Gain which produces an output that is proportional to the rate of change of the error AP_GROUPINFO("D", 4, AC_PID_2D, _kd, 0), - // @Param: D_FILT + // @Param: FLTD // @DisplayName: D term filter frequency in Hz // @Description: D term filter frequency in Hz // @Units: Hz - AP_GROUPINFO("D_FILT", 5, AC_PID_2D, _filt_D_hz, AC_PID_2D_FILT_D_HZ_DEFAULT), + AP_GROUPINFO("FLTD", 5, AC_PID_2D, _filt_D_hz, AC_PID_2D_FILT_D_HZ_DEFAULT), // @Param: FF // @DisplayName: PID Feed Forward Gain