mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 14:23:33 +08:00
mc_pos_control_params: update jerk params (limits + defaults + description)
This commit is contained in:
@@ -140,7 +140,7 @@ ManualSmoothingXY::_setStateAcceleration(const Vector2f &vel_sp, const Vector2f
|
|||||||
// very slow at low speed.
|
// very slow at low speed.
|
||||||
_jerk_state_dependent = 1e6f; // default
|
_jerk_state_dependent = 1e6f; // default
|
||||||
|
|
||||||
if (_jerk_max.get() > _jerk_min.get()) {
|
if (_jerk_max.get() > _jerk_min.get() && _jerk_min.get() > FLT_EPSILON) {
|
||||||
|
|
||||||
_jerk_state_dependent = math::min((_jerk_max.get() - _jerk_min.get())
|
_jerk_state_dependent = math::min((_jerk_max.get() - _jerk_min.get())
|
||||||
/ _vel_max * vel.length() + _jerk_min.get(), _jerk_max.get());
|
/ _vel_max * vel.length() + _jerk_min.get(), _jerk_max.get());
|
||||||
|
|||||||
@@ -483,33 +483,47 @@ PARAM_DEFINE_FLOAT(MPC_ACC_UP_MAX, 10.0f);
|
|||||||
PARAM_DEFINE_FLOAT(MPC_ACC_DOWN_MAX, 10.0f);
|
PARAM_DEFINE_FLOAT(MPC_ACC_DOWN_MAX, 10.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum jerk in manual controlled mode for BRAKING to zero.
|
* Maximum jerk limit
|
||||||
* If this value is below MPC_JERK_MIN, the acceleration limit in xy and z
|
|
||||||
* is MPC_ACC_HOR_MAX and MPC_ACC_UP_MAX respectively instantaneously when the
|
|
||||||
* user demands brake (=zero stick input).
|
|
||||||
* Otherwise the acceleration limit increases from current acceleration limit
|
|
||||||
* towards MPC_ACC_HOR_MAX/MPC_ACC_UP_MAX with jerk limit
|
|
||||||
*
|
*
|
||||||
* @unit m/s/s/s
|
* Limit the maximum jerk of the vehicle (how fast the acceleration can change).
|
||||||
* @min 0.0
|
* A lower value leads to smoother vehicle motions, but it also limits its
|
||||||
* @max 15.0
|
* agility (how fast it can change directions or break).
|
||||||
* @increment 1
|
*
|
||||||
* @decimal 2
|
* Setting this to the maximum value essentially disables the limit.
|
||||||
* @group Multicopter Position Control
|
*
|
||||||
*/
|
* Note: this is only used when MPC_POS_MODE is set to a smoothing mode.
|
||||||
PARAM_DEFINE_FLOAT(MPC_JERK_MAX, 0.0f);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Minimum jerk in manual controlled mode for BRAKING to zero
|
|
||||||
*
|
*
|
||||||
* @unit m/s/s/s
|
* @unit m/s/s/s
|
||||||
* @min 0.5
|
* @min 0.5
|
||||||
* @max 10.0
|
* @max 500.0
|
||||||
* @increment 1
|
* @increment 1
|
||||||
* @decimal 2
|
* @decimal 2
|
||||||
* @group Multicopter Position Control
|
* @group Multicopter Position Control
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(MPC_JERK_MIN, 1.0f);
|
PARAM_DEFINE_FLOAT(MPC_JERK_MAX, 20.0f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Velocity-based jerk limit
|
||||||
|
*
|
||||||
|
* If this is not zero, a velocity-based maximum jerk limit is used: the applied
|
||||||
|
* jerk limit linearly increases with the vehicle's velocity between
|
||||||
|
* MPC_JERK_MIN (zero velocity) and MPC_JERK_MAX (maximum velocity).
|
||||||
|
*
|
||||||
|
* This means that the vehicle's motions are smooth for low velocities, but
|
||||||
|
* still allows fast direction changes or breaking at higher velocities.
|
||||||
|
*
|
||||||
|
* Set this to zero to use a fixed maximum jerk limit (MPC_JERK_MAX).
|
||||||
|
*
|
||||||
|
* Note: this is only used when MPC_POS_MODE is set to a smoothing mode.
|
||||||
|
*
|
||||||
|
* @unit m/s/s/s
|
||||||
|
* @min 0
|
||||||
|
* @max 30.0
|
||||||
|
* @increment 1
|
||||||
|
* @decimal 2
|
||||||
|
* @group Multicopter Position Control
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_FLOAT(MPC_JERK_MIN, 8.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Altitude control mode.
|
* Altitude control mode.
|
||||||
|
|||||||
Reference in New Issue
Block a user