mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 15:43:37 +08:00
mc_att_control: remove useless parameter MC_YAW_FF
It scales the yawspeed setpoint arbitrarily by default with 0.5. This makes no sense because when you give a setpoint of 1rad/s then you expect the setpoint to get executed. If you want manual yawspeed response to be less agressive on the stick use the scaling parameter for the stick MPC_MAN_Y_MAX.
This commit is contained in:
committed by
Lorenz Meier
parent
b5731e0ccd
commit
cc0bc05156
@@ -204,8 +204,6 @@ private:
|
||||
(ParamFloat<px4::params::MC_YAWRATE_D>) _yaw_rate_d,
|
||||
(ParamFloat<px4::params::MC_YAWRATE_FF>) _yaw_rate_ff,
|
||||
|
||||
(ParamFloat<px4::params::MC_YAW_FF>) _yaw_ff, /**< yaw control feed-forward */
|
||||
|
||||
(ParamFloat<px4::params::MC_DTERM_CUTOFF>) _d_term_cutoff_freq, /**< Cutoff frequency for the D-term filter */
|
||||
|
||||
(ParamFloat<px4::params::MC_TPA_BREAK_P>) _tpa_breakpoint_p, /**< Throttle PID Attenuation breakpoint */
|
||||
|
||||
@@ -430,16 +430,14 @@ MulticopterAttitudeControl::control_attitude(float dt)
|
||||
_rates_sp = eq.emult(attitude_gain);
|
||||
|
||||
/* Feed forward the yaw setpoint rate.
|
||||
* The yaw_feedforward_rate is a commanded rotation around the world z-axis,
|
||||
* yaw_sp_move_rate is the feed forward commanded rotation around the world z-axis,
|
||||
* but we need to apply it in the body frame (because _rates_sp is expressed in the body frame).
|
||||
* Therefore we infer the world z-axis (expressed in the body frame) by taking the last column of R.transposed (== q.inversed)
|
||||
* and multiply it by the yaw setpoint rate (yaw_sp_move_rate) and gain (_yaw_ff).
|
||||
* and multiply it by the yaw setpoint rate (yaw_sp_move_rate).
|
||||
* This yields a vector representing the commanded rotatation around the world z-axis expressed in the body frame
|
||||
* such that it can be added to the rates setpoint.
|
||||
*/
|
||||
Vector3f yaw_feedforward_rate = q.inversed().dcm_z();
|
||||
yaw_feedforward_rate *= _v_att_sp.yaw_sp_move_rate * _yaw_ff.get();
|
||||
_rates_sp += yaw_feedforward_rate;
|
||||
_rates_sp += q.inversed().dcm_z() * _v_att_sp.yaw_sp_move_rate;
|
||||
|
||||
|
||||
/* limit rates */
|
||||
|
||||
@@ -263,19 +263,6 @@ PARAM_DEFINE_FLOAT(MC_YAWRATE_D, 0.0f);
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(MC_YAWRATE_FF, 0.0f);
|
||||
|
||||
/**
|
||||
* Yaw feed forward
|
||||
*
|
||||
* Feed forward weight for manual yaw control. 0 will give slow responce and no overshot, 1 - fast responce and big overshot.
|
||||
*
|
||||
* @min 0.0
|
||||
* @max 1.0
|
||||
* @decimal 2
|
||||
* @increment 0.01
|
||||
* @group Multicopter Attitude Control
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(MC_YAW_FF, 0.5f);
|
||||
|
||||
/**
|
||||
* Max roll rate
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user