Compare commits

...

2 Commits

Author SHA1 Message Date
Jaeyoung-Lim 1b514be1e5 Add yaw time constant 2021-09-29 23:43:20 +02:00
Jaeyoung-Lim 10f28d23a2 Remove unnecessary checks 2021-09-29 23:26:22 +02:00
4 changed files with 21 additions and 3 deletions

View File

@ -100,6 +100,7 @@ FixedwingAttitudeControl::parameters_update()
_roll_ctrl.set_integrator_max(_param_fw_rr_imax.get());
/* yaw control parameters */
_yaw_ctrl.set_time_constant(_param_fw_y_tc.get());
_yaw_ctrl.set_k_p(_param_fw_yr_p.get());
_yaw_ctrl.set_k_i(_param_fw_yr_i.get());
_yaw_ctrl.set_k_ff(_param_fw_yr_ff.get());

View File

@ -200,6 +200,7 @@ private:
(ParamFloat<px4::params::FW_WR_P>) _param_fw_wr_p,
(ParamFloat<px4::params::FW_Y_RMAX>) _param_fw_y_rmax,
(ParamFloat<px4::params::FW_Y_TC>) _param_fw_y_tc,
(ParamFloat<px4::params::FW_YR_FF>) _param_fw_yr_ff,
(ParamFloat<px4::params::FW_YR_I>) _param_fw_yr_i,
(ParamFloat<px4::params::FW_YR_IMAX>) _param_fw_yr_imax,

View File

@ -47,9 +47,7 @@ float ECL_YawController::control_attitude(const float dt, const ECL_ControlData
{
/* Do not calculate control signal with bad inputs */
if (!(PX4_ISFINITE(ctl_data.roll) &&
PX4_ISFINITE(ctl_data.pitch) &&
PX4_ISFINITE(ctl_data.roll_rate_setpoint) &&
PX4_ISFINITE(ctl_data.pitch_rate_setpoint))) {
PX4_ISFINITE(ctl_data.pitch))) {
return _rate_setpoint;
}

View File

@ -272,6 +272,24 @@ PARAM_DEFINE_FLOAT(FW_YR_IMAX, 0.2f);
*/
PARAM_DEFINE_FLOAT(FW_Y_RMAX, 50.0f);
/**
* Attitude yaw time constant
*
* This defines the latency between a yaw step input and the achieved setpoint
* (inverse to a P gain). Half a second is a good start value and fits for
* most average systems. Smaller systems may require smaller values, but as
* this will wear out servos faster, the value should only be decreased as
* needed.
*
* @unit s
* @min 0.2
* @max 1.0
* @decimal 2
* @increment 0.05
* @group FW Attitude Control
*/
PARAM_DEFINE_FLOAT(FW_Y_TC, 0.4f);
/**
* Roll control to yaw control feedforward gain.
*