mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 10:28:29 -04:00
Alt hold fix
This commit is contained in:
parent
3b51874a70
commit
6d0a32cc65
@ -94,12 +94,10 @@ get_nav_throttle(long z_error)
|
||||
// limit error to prevent I term run up
|
||||
z_error = constrain(z_error, -ALT_ERROR_MAX, ALT_ERROR_MAX);
|
||||
int rate_error = g.pi_alt_hold.get_pi(z_error, .1); //_p = .85
|
||||
|
||||
rate_error = rate_error - climb_rate;
|
||||
|
||||
// limit the rate
|
||||
rate_error = constrain(rate_error, -80, 140);
|
||||
return (int)g.pi_throttle.get_pi(rate_error, .1);
|
||||
return constrain((int)g.pi_throttle.get_pi(rate_error, .1), -120, 180);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user