Map derivative gains for rate controls

This commit is contained in:
Jaeyoung Lim 2022-07-18 10:33:18 +02:00 committed by Silvan Fuhrer
parent f2877ce585
commit dcff481219
3 changed files with 49 additions and 1 deletions

View File

@ -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);

View File

@ -209,6 +209,7 @@ private:
(ParamFloat<px4::params::FW_PR_I>) _param_fw_pr_i,
(ParamFloat<px4::params::FW_PR_IMAX>) _param_fw_pr_imax,
(ParamFloat<px4::params::FW_PR_P>) _param_fw_pr_p,
(ParamFloat<px4::params::FW_PR_D>) _param_fw_pr_d,
(ParamFloat<px4::params::FW_PSP_OFF>) _param_fw_psp_off,
(ParamFloat<px4::params::FW_R_RMAX>) _param_fw_r_rmax,
@ -218,6 +219,7 @@ private:
(ParamFloat<px4::params::FW_RR_I>) _param_fw_rr_i,
(ParamFloat<px4::params::FW_RR_IMAX>) _param_fw_rr_imax,
(ParamFloat<px4::params::FW_RR_P>) _param_fw_rr_p,
(ParamFloat<px4::params::FW_RR_D>) _param_fw_rr_d,
(ParamBool<px4::params::FW_W_EN>) _param_fw_w_en,
(ParamFloat<px4::params::FW_W_RMAX>) _param_fw_w_rmax,
@ -231,6 +233,7 @@ private:
(ParamFloat<px4::params::FW_YR_I>) _param_fw_yr_i,
(ParamFloat<px4::params::FW_YR_IMAX>) _param_fw_yr_imax,
(ParamFloat<px4::params::FW_YR_P>) _param_fw_yr_p,
(ParamFloat<px4::params::FW_YR_D>) _param_fw_yr_d,
(ParamFloat<px4::params::TRIM_PITCH>) _param_trim_pitch,
(ParamFloat<px4::params::TRIM_ROLL>) _param_trim_roll,

View File

@ -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
*