diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index a794726f83..d5fcf71919 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -96,7 +96,7 @@ FixedwingAttitudeControl::parameters_update() const Vector3f rate_p = Vector3f(_param_fw_rr_p.get(), _param_fw_pr_p.get(), _param_fw_yr_p.get()); const Vector3f rate_i = Vector3f(_param_fw_rr_i.get(), _param_fw_pr_i.get(), _param_fw_yr_i.get()); - const Vector3f rate_d = Vector3f(0.0f, 0.0f, 0.0f); + const Vector3f rate_d = Vector3f(_param_fw_rr_d.get(), _param_fw_pr_d.get(), _param_fw_yr_d.get()); _rate_control.setGains(rate_p, rate_i, rate_d); diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp index 8b71b52ff2..b82a6417f9 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.hpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.hpp @@ -209,6 +209,7 @@ private: (ParamFloat) _param_fw_pr_i, (ParamFloat) _param_fw_pr_imax, (ParamFloat) _param_fw_pr_p, + (ParamFloat) _param_fw_pr_d, (ParamFloat) _param_fw_psp_off, (ParamFloat) _param_fw_r_rmax, @@ -218,6 +219,7 @@ private: (ParamFloat) _param_fw_rr_i, (ParamFloat) _param_fw_rr_imax, (ParamFloat) _param_fw_rr_p, + (ParamFloat) _param_fw_rr_d, (ParamBool) _param_fw_w_en, (ParamFloat) _param_fw_w_rmax, @@ -231,6 +233,7 @@ private: (ParamFloat) _param_fw_yr_i, (ParamFloat) _param_fw_yr_imax, (ParamFloat) _param_fw_yr_p, + (ParamFloat) _param_fw_yr_d, (ParamFloat) _param_trim_pitch, (ParamFloat) _param_trim_roll, diff --git a/src/modules/fw_att_control/fw_att_control_params.c b/src/modules/fw_att_control/fw_att_control_params.c index b039f6c69b..e0a962b7b0 100644 --- a/src/modules/fw_att_control/fw_att_control_params.c +++ b/src/modules/fw_att_control/fw_att_control_params.c @@ -96,6 +96,21 @@ PARAM_DEFINE_FLOAT(FW_P_TC, 0.4f); */ PARAM_DEFINE_FLOAT(FW_PR_P, 0.08f); +/** + * Pitch rate derivative gain. + * + * This defines how much the elevator input will be commanded depending on the + * current body angular acceleration error. + * + * @unit %/rad/s + * @min 0.0 + * @max 1.0 + * @decimal 3 + * @increment 0.005 + * @group FW Attitude Control + */ +PARAM_DEFINE_FLOAT(FW_PR_D, 0.00f); + /** * Pitch rate integrator gain. * @@ -170,6 +185,21 @@ PARAM_DEFINE_FLOAT(FW_PR_IMAX, 0.4f); */ PARAM_DEFINE_FLOAT(FW_RR_P, 0.05f); +/** + * Roll rate derivative Gain + * + * This defines how much the aileron input will be commanded depending on the + * current body angular acceleration error. + * + * @unit %/rad/s + * @min 0.0 + * @max 1.0 + * @decimal 3 + * @increment 0.005 + * @group FW Attitude Control + */ +PARAM_DEFINE_FLOAT(FW_RR_D, 0.00f); + /** * Roll rate integrator Gain * @@ -228,6 +258,21 @@ PARAM_DEFINE_FLOAT(FW_R_RMAX, 70.0f); */ PARAM_DEFINE_FLOAT(FW_YR_P, 0.05f); +/** + * Yaw rate derivative gain + * + * This defines how much the rudder input will be commanded depending on the + * current body angular acceleration error. + * + * @unit %/rad/s + * @min 0.0 + * @max 1.0 + * @decimal 3 + * @increment 0.005 + * @group FW Attitude Control + */ +PARAM_DEFINE_FLOAT(FW_YR_D, 0.0f); + /** * Yaw rate integrator gain *