StickAccelerationXY: make brake filter configurable

This commit is contained in:
Matthias Grob 2021-05-04 11:08:48 +02:00
parent b98c7e63c7
commit fef8c5e42e
3 changed files with 14 additions and 1 deletions

View File

@ -126,7 +126,7 @@ void StickAccelerationXY::applyJerkLimit(const float dt)
Vector2f StickAccelerationXY::calculateDrag(Vector2f drag_coefficient, const float dt, const Vector2f &stick_xy,
const Vector2f &vel_sp)
{
_brake_boost_filter.setParameters(dt, .8f);
_brake_boost_filter.setParameters(dt, _param_mpc_brake_filter.get());
if (stick_xy.norm_squared() < FLT_EPSILON) {
_brake_boost_filter.update(_param_mpc_brake_factor.get());

View File

@ -83,6 +83,7 @@ private:
(ParamFloat<px4::params::MPC_ACC_HOR>) _param_mpc_acc_hor,
(ParamFloat<px4::params::MPC_ACC_HOR_MAX>) _param_mpc_acc_hor_max,
(ParamFloat<px4::params::MPC_BRAKE_FACTOR>) _param_mpc_brake_factor,
(ParamFloat<px4::params::MPC_BRAKE_FILTER>) _param_mpc_brake_filter,
(ParamFloat<px4::params::MPC_JERK_MAX>) _param_mpc_jerk_max,
(ParamFloat<px4::params::MPC_TILTMAX_AIR>) _param_mpc_tiltmax_air
)

View File

@ -524,6 +524,18 @@ PARAM_DEFINE_FLOAT(MPC_ACC_HOR, 3.0f);
*/
PARAM_DEFINE_FLOAT(MPC_BRAKE_FACTOR, 2.0f);
/**
* Brake boost filter time constant
*
* @unit m/s^2
* @min 2.0
* @max 15.0
* @increment 1
* @decimal 2
* @group Multicopter Position Control
*/
PARAM_DEFINE_FLOAT(MPC_BRAKE_FILTER, 0.8f);
/**
* Maximum vertical acceleration in velocity controlled modes upward
*