TECS: apply FW_LND_THRTC_SC to altitude error time constant

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2020-10-28 15:41:39 +01:00
committed by Roman Bapst
parent 3d3ff75495
commit dca89763b3
2 changed files with 9 additions and 9 deletions
@@ -638,7 +638,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
/* restore TECS parameters, in case changed intermittently (e.g. in landing handling) */ /* restore TECS parameters, in case changed intermittently (e.g. in landing handling) */
_tecs.set_speed_weight(_param_fw_t_spdweight.get()); _tecs.set_speed_weight(_param_fw_t_spdweight.get());
//_tecs.set_time_const_throt(_param_fw_t_thro_const.get()); _tecs.set_height_error_time_constant(_param_fw_t_h_error_tc.get());
Vector2f curr_wp{0.0f, 0.0f}; Vector2f curr_wp{0.0f, 0.0f};
Vector2f prev_wp{0.0f, 0.0f}; Vector2f prev_wp{0.0f, 0.0f};
@@ -842,9 +842,9 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
if (pos_sp_next.type == position_setpoint_s::SETPOINT_TYPE_LAND && pos_sp_next.valid if (pos_sp_next.type == position_setpoint_s::SETPOINT_TYPE_LAND && pos_sp_next.valid
&& _l1_control.circle_mode() && _param_fw_lnd_earlycfg.get()) { && _l1_control.circle_mode() && _param_fw_lnd_earlycfg.get()) {
// We're in a loiter directly before a landing WP. Enable our landing configuration (flaps, // We're in a loiter directly before a landing WP. Enable our landing configuration (flaps,
// landing airspeed and potentially tighter throttle control) already such that we don't // landing airspeed and potentially tighter altitude control) already such that we don't
// have to do this switch (which can cause significant altitude errors) close to the ground. // have to do this switch (which can cause significant altitude errors) close to the ground.
//_tecs.set_time_const_throt(_param_fw_thrtc_sc.get() * _param_fw_t_thro_const.get()); _tecs.set_height_error_time_constant(_param_fw_thrtc_sc.get() * _param_fw_t_h_error_tc.get());
mission_airspeed = _param_fw_lnd_airspd_sc.get() * _param_fw_airspd_min.get(); mission_airspeed = _param_fw_lnd_airspd_sc.get() * _param_fw_airspd_min.get();
_att_sp.apply_flaps = true; _att_sp.apply_flaps = true;
} }
@@ -864,7 +864,7 @@ FixedwingPositionControl::control_position(const hrt_abstime &now, const Vector2
_att_sp.roll_body = 0.0f; _att_sp.roll_body = 0.0f;
} }
//_tecs.set_time_const_throt(_param_fw_thrtc_sc.get() * _param_fw_t_thro_const.get()); _tecs.set_height_error_time_constant(_param_fw_thrtc_sc.get() * _param_fw_t_h_error_tc.get());
} }
tecs_update_pitch_throttle(now, alt_sp, tecs_update_pitch_throttle(now, alt_sp,
@@ -1329,8 +1329,8 @@ FixedwingPositionControl::control_landing(const hrt_abstime &now, const Vector2f
// if they have been enabled using the corresponding parameter // if they have been enabled using the corresponding parameter
_att_sp.apply_flaps = vehicle_attitude_setpoint_s::FLAPS_LAND; _att_sp.apply_flaps = vehicle_attitude_setpoint_s::FLAPS_LAND;
// Enable tighter throttle control for landings // Enable tighter altitude control for landings
//_tecs.set_time_const_throt(_param_fw_thrtc_sc.get() * _param_fw_t_thro_const.get()); _tecs.set_height_error_time_constant(_param_fw_thrtc_sc.get() * _param_fw_t_h_error_tc.get());
// save time at which we started landing and reset abort_landing // save time at which we started landing and reset abort_landing
if (_time_started_landing == 0) { if (_time_started_landing == 0) {
@@ -394,12 +394,12 @@ PARAM_DEFINE_FLOAT(FW_LND_FL_PMAX, 15.0f);
PARAM_DEFINE_FLOAT(FW_LND_AIRSPD_SC, 1.3f); PARAM_DEFINE_FLOAT(FW_LND_AIRSPD_SC, 1.3f);
/** /**
* Throttle time constant factor for landing * Altitude time constant factor for landing
* *
* Set this parameter to less than 1.0 to make the TECS throttle loop react faster during * Set this parameter to less than 1.0 to make TECS react faster to altitude errors during
* landing than during normal flight (i.e. giving efficiency and low motor wear at * landing than during normal flight (i.e. giving efficiency and low motor wear at
* high altitudes but control accuracy during landing). During landing, the TECS * high altitudes but control accuracy during landing). During landing, the TECS
* throttle time constant (FW_T_THRO_CONST) is multiplied by this value. * altitude time constant (FW_T_ALT_TC) is multiplied by this value.
* *
* @unit * @unit
* @min 0.2 * @min 0.2