fw pos ctrl: set idle throttle in landed conditions

also set the default idle throttle to zero as most PX4 applications use electric motors
This commit is contained in:
Thomas Stastny 2022-07-13 11:02:36 +02:00 committed by Daniel Agar
parent ceb432aacb
commit 217efcb12d
2 changed files with 11 additions and 6 deletions

View File

@ -1722,7 +1722,7 @@ FixedwingPositionControl::control_auto_landing(const hrt_abstime &now, const flo
/* set the attitude and throttle commands */
// TECS has authority (though constrained) over pitch during flare, throttle is killed
// TECS has authority (though constrained) over pitch during flare, throttle is hard set to idle
_att_sp.pitch_body = get_tecs_pitch();
// flaring is just before touchdown, align the yaw as much as possible with the landing vector
@ -1731,7 +1731,9 @@ FixedwingPositionControl::control_auto_landing(const hrt_abstime &now, const flo
// enable direct yaw control using rudder/wheel
_att_sp.fw_control_yaw = true;
_att_sp.thrust_body[0] = 0.0f;
// idle throttle may be >0 for internal combustion engines
// normally set to zero for electric motors
_att_sp.thrust_body[0] = _param_fw_thr_idle.get();
} else {
@ -1791,7 +1793,7 @@ FixedwingPositionControl::control_auto_landing(const hrt_abstime &now, const flo
// enable direct yaw control using rudder/wheel
_att_sp.fw_control_yaw = false;
_att_sp.thrust_body[0] = (_landed) ? 0.0f : get_tecs_thrust();
_att_sp.thrust_body[0] = (_landed) ? _param_fw_thr_idle.get() : get_tecs_thrust();
}
_tecs.set_equivalent_airspeed_min(_param_fw_airspd_min.get()); // reset after TECS calculation

View File

@ -338,8 +338,11 @@ PARAM_DEFINE_FLOAT(FW_THR_MIN, 0.0f);
*
* This is the minimum throttle while on the ground
*
* For aircraft with internal combustion engine this parameter should be set
* above desired idle rpm.
* For aircraft with internal combustion engines, this parameter should be set
* above the desired idle rpm. For electric motors, idle should typically be set
* to zero.
*
* Note that in automatic modes, "landed" conditions will engage idle throttle.
*
* @unit norm
* @min 0.0
@ -348,7 +351,7 @@ PARAM_DEFINE_FLOAT(FW_THR_MIN, 0.0f);
* @increment 0.01
* @group FW L1 Control
*/
PARAM_DEFINE_FLOAT(FW_THR_IDLE, 0.15f);
PARAM_DEFINE_FLOAT(FW_THR_IDLE, 0.0f);
/**
* Climbout Altitude difference