From 6d0a32cc65448c3ba5b1a28c5084400c995b1cbc Mon Sep 17 00:00:00 2001 From: Jason Short Date: Mon, 7 Nov 2011 12:00:37 -0800 Subject: [PATCH] Alt hold fix --- ArduCopter/Attitude.pde | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ArduCopter/Attitude.pde b/ArduCopter/Attitude.pde index 85e0fa085b..2d06bb0378 100644 --- a/ArduCopter/Attitude.pde +++ b/ArduCopter/Attitude.pde @@ -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