From 123545f6798930fe1b3c99b66a3b49378c211d17 Mon Sep 17 00:00:00 2001 From: Jason Short Date: Sat, 18 Aug 2012 09:30:46 -0700 Subject: [PATCH] ACM : Alt hold adjustment - made angle boost work during alt hold changes. increased length of delay when reverting to automatic hold to deal with latency of baro sensor --- ArduCopter/ArduCopter.pde | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 82bb95f4a5..579817c619 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -1768,6 +1768,15 @@ void update_throttle_mode(void) static float throttle_avg = 0; // this is initialised to g.throttle_cruise later #endif + #if FRAME_CONFIG != HELI_FRAME + // calculate angle boost + if(throttle_mode == THROTTLE_MANUAL){ + angle_boost = get_angle_boost(g.rc_3.control_in); + }else{ + angle_boost = get_angle_boost(g.throttle_cruise); + } + #endif + switch(throttle_mode){ case THROTTLE_MANUAL: if (g.rc_3.control_in > 0){ @@ -1777,7 +1786,6 @@ void update_throttle_mode(void) if (control_mode == ACRO){ g.rc_3.servo_out = g.rc_3.control_in; }else{ - angle_boost = get_angle_boost(g.rc_3.control_in); g.rc_3.servo_out = g.rc_3.control_in + angle_boost; } #endif @@ -1813,7 +1821,7 @@ void update_throttle_mode(void) case THROTTLE_HOLD: // allow interactive changing of atitude if(g.rc_3.control_in < 200){ - reset_throttle_counter = 50; + reset_throttle_counter = 150; nav_throttle = get_throttle_rate(-120); g.rc_3.servo_out = g.throttle_cruise + nav_throttle + angle_boost; break; @@ -1840,8 +1848,6 @@ void update_throttle_mode(void) // else fall through case THROTTLE_AUTO: - // calculate angle boost - angle_boost = get_angle_boost(g.throttle_cruise); if(motors.auto_armed() == true){