StickAccelerationXY: make brake boost factor configurable

This commit is contained in:
Matthias Grob
2021-05-04 10:53:30 +02:00
parent 4f098a01bc
commit b98c7e63c7
3 changed files with 17 additions and 2 deletions
@@ -129,7 +129,7 @@ Vector2f StickAccelerationXY::calculateDrag(Vector2f drag_coefficient, const flo
_brake_boost_filter.setParameters(dt, .8f);
if (stick_xy.norm_squared() < FLT_EPSILON) {
_brake_boost_filter.update(math::max(2.f, sqrtf(_param_mpc_vel_manual.get())));
_brake_boost_filter.update(_param_mpc_brake_factor.get());
} else {
_brake_boost_filter.update(1.f);
@@ -81,6 +81,8 @@ private:
DEFINE_PARAMETERS(
(ParamFloat<px4::params::MPC_VEL_MANUAL>) _param_mpc_vel_manual,
(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_JERK_MAX>) _param_mpc_jerk_max,
(ParamFloat<px4::params::MPC_TILTMAX_AIR>) _param_mpc_tiltmax_air
)
@@ -508,9 +508,22 @@ PARAM_DEFINE_FLOAT(MPC_ACC_HOR_MAX, 5.0f);
* @decimal 2
* @group Multicopter Position Control
*/
PARAM_DEFINE_FLOAT(MPC_ACC_HOR, 3.0f);
/**
* Factor for faster braking than accelerating in position mode
*
* Note: In manual, this parameter is only used in MPC_POS_MODE 1.
*
* @unit m/s^2
* @min 2.0
* @max 15.0
* @increment 1
* @decimal 2
* @group Multicopter Position Control
*/
PARAM_DEFINE_FLOAT(MPC_BRAKE_FACTOR, 2.0f);
/**
* Maximum vertical acceleration in velocity controlled modes upward
*