mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
Plane: Fix tilt rotor surging during high speed QLOITER flight
This commit is contained in:
parent
dcfffefa07
commit
d14a88b378
@ -3007,21 +3007,24 @@ void QuadPlane::assign_tilt_to_fwd_thr(void) {
|
|||||||
q_fwd_throttle = MIN(q_fwd_thr_gain * tanf(fwd_tilt_rad), 1.0f);
|
q_fwd_throttle = MIN(q_fwd_thr_gain * tanf(fwd_tilt_rad), 1.0f);
|
||||||
|
|
||||||
// Relax forward tilt limit if the position controller is saturating in the forward direction because
|
// Relax forward tilt limit if the position controller is saturating in the forward direction because
|
||||||
// the forward thrust motor could be failed
|
// the forward thrust motor could be failed. Do not do this with tilt rotors because they do not rely on
|
||||||
const float fwd_tilt_range_cd = (float)aparm.angle_max - 100.0f * q_fwd_pitch_lim;
|
// forward throttle during VTOL flight
|
||||||
if (is_positive(fwd_tilt_range_cd)) {
|
if (!tiltrotor.enabled()) {
|
||||||
// rate limit the forward tilt change to slew between the motor good and motor failed
|
const float fwd_tilt_range_cd = (float)aparm.angle_max - 100.0f * q_fwd_pitch_lim;
|
||||||
// value over 10 seconds
|
if (is_positive(fwd_tilt_range_cd)) {
|
||||||
const bool fwd_limited = plane.quadplane.pos_control->is_active_xy() and plane.quadplane.pos_control->get_fwd_pitch_is_limited();
|
// rate limit the forward tilt change to slew between the motor good and motor failed
|
||||||
const float fwd_pitch_lim_cd_tgt = fwd_limited ? (float)aparm.angle_max : 100.0f * q_fwd_pitch_lim;
|
// value over 10 seconds
|
||||||
const float delta_max = 0.1f * fwd_tilt_range_cd * plane.G_Dt;
|
const bool fwd_limited = plane.quadplane.pos_control->is_active_xy() and plane.quadplane.pos_control->get_fwd_pitch_is_limited();
|
||||||
q_fwd_pitch_lim_cd += constrain_float((fwd_pitch_lim_cd_tgt - q_fwd_pitch_lim_cd), -delta_max, delta_max);
|
const float fwd_pitch_lim_cd_tgt = fwd_limited ? (float)aparm.angle_max : 100.0f * q_fwd_pitch_lim;
|
||||||
// Don't let the forward pitch limit be more than the forward pitch demand before limiting to
|
const float delta_max = 0.1f * fwd_tilt_range_cd * plane.G_Dt;
|
||||||
// avoid opening up the limit more than necessary
|
q_fwd_pitch_lim_cd += constrain_float((fwd_pitch_lim_cd_tgt - q_fwd_pitch_lim_cd), -delta_max, delta_max);
|
||||||
q_fwd_pitch_lim_cd = MIN(q_fwd_pitch_lim_cd, MAX(-(float)plane.nav_pitch_cd, 100.0f * q_fwd_pitch_lim));
|
// Don't let the forward pitch limit be more than the forward pitch demand before limiting to
|
||||||
} else {
|
// avoid opening up the limit more than necessary
|
||||||
// take the lesser of the two limits
|
q_fwd_pitch_lim_cd = MIN(q_fwd_pitch_lim_cd, MAX(-(float)plane.nav_pitch_cd, 100.0f * q_fwd_pitch_lim));
|
||||||
q_fwd_pitch_lim_cd = (float)aparm.angle_max;
|
} else {
|
||||||
|
// take the lesser of the two limits
|
||||||
|
q_fwd_pitch_lim_cd = (float)aparm.angle_max;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float fwd_thr_scaler;
|
float fwd_thr_scaler;
|
||||||
|
Loading…
Reference in New Issue
Block a user