From 09c4bbe46eac0aaf8b49bbc32a7249a4b9f4605b Mon Sep 17 00:00:00 2001 From: Jason Short Date: Fri, 13 Jan 2012 08:49:55 -0800 Subject: [PATCH] Added simple constrain for Alt d term --- ArduCopter/Attitude.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArduCopter/Attitude.pde b/ArduCopter/Attitude.pde index f4cc3b9ab5..38ae8970b1 100644 --- a/ArduCopter/Attitude.pde +++ b/ArduCopter/Attitude.pde @@ -190,7 +190,7 @@ get_nav_throttle(int32_t z_error) rate_d = ((rate_d + climb_rate)>>1) * 1; // replace with gain // slight adjustment to alt hold output - output -= rate_d; + output -= constrain(rate_d, -25, 25); // light filter of output output = (old_output * 3 + output) / 4;