mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
PositionControl: fix horizontal integral anti-windup
This commit is contained in:
@@ -178,8 +178,9 @@ void PositionControl::_velocityControl(const float dt)
|
||||
|
||||
// Use tracking Anti-Windup for horizontal direction: during saturation, the integrator is used to unsaturate the output
|
||||
// see Anti-Reset Windup for PID controllers, L.Rundqwist, 1990
|
||||
const float arw_gain = 2.f / _gain_vel_p(0);
|
||||
vel_error.xy() = Vector2f(vel_error) - (arw_gain * (thrust_sp_xy - Vector2f(_thr_sp)));
|
||||
const Vector2f acc_sp_xy_limited = Vector2f(_thr_sp) * (CONSTANTS_ONE_G / _hover_thrust);
|
||||
const float arw_gain = 2.f / (_gain_vel_p(0) * (CONSTANTS_ONE_G / _hover_thrust));
|
||||
vel_error.xy() = Vector2f(vel_error) - (arw_gain * (Vector2f(_acc_sp) - acc_sp_xy_limited));
|
||||
|
||||
// Make sure integral doesn't get NAN
|
||||
ControlMath::setZeroIfNanVector3f(vel_error);
|
||||
|
||||
Reference in New Issue
Block a user