From 0aac828eeb6bd4248851ff920a04894138bd1c98 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 6 Nov 2011 17:47:24 +0800 Subject: [PATCH] Altitude hold bug fix - changed g.throttle_cruise to be updated to steal I term from correct controller --- ArduCopter/ArduCopter.pde | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index ac612127f5..bc98f41e50 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -1280,14 +1280,14 @@ adjust_altitude() // we remove 0 to 100 PWM from hover manual_boost = g.rc_3.control_in - 180; manual_boost = max(-120, manual_boost); - g.throttle_cruise += g.pi_alt_hold.get_integrator(); + g.throttle_cruise += g.pi_throttle.get_integrator(); g.pi_alt_hold.reset_I(); g.pi_throttle.reset_I(); }else if (g.rc_3.control_in >= 650){ // we add 0 to 100 PWM to hover manual_boost = g.rc_3.control_in - 650; - g.throttle_cruise += g.pi_alt_hold.get_integrator(); + g.throttle_cruise += g.pi_throttle.get_integrator(); g.pi_alt_hold.reset_I(); g.pi_throttle.reset_I();