mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
TECS: hande pitch and throttle integrator saturation consistently
- don't decay integrator during saturation but prevent it from being learned into the direction which causes more actuator saturation Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
@@ -429,12 +429,11 @@ void TECS::_update_pitch_setpoint()
|
||||
float pitch_integ_input = _SEB_rate_error * _integrator_gain_pitch;
|
||||
|
||||
// Prevent the integrator changing in a direction that will increase pitch demand saturation
|
||||
// Decay the integrator using a 1 second time constant if the pitch demand from the previous time step is saturated
|
||||
if (_pitch_setpoint_unc > _pitch_setpoint_max) {
|
||||
pitch_integ_input = min(pitch_integ_input, (_pitch_setpoint_max - _pitch_setpoint_unc) * climb_angle_to_SEB_rate);
|
||||
pitch_integ_input = min(pitch_integ_input, 0.f);
|
||||
|
||||
} else if (_pitch_setpoint_unc < _pitch_setpoint_min) {
|
||||
pitch_integ_input = max(pitch_integ_input, (_pitch_setpoint_min - _pitch_setpoint_unc) * climb_angle_to_SEB_rate);
|
||||
pitch_integ_input = max(pitch_integ_input, 0.f);
|
||||
}
|
||||
|
||||
// Update the pitch integrator state.
|
||||
|
||||
Reference in New Issue
Block a user