From 70f91e3cc333679fccab5a20ed3c403035cc5598 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 8 Feb 2012 22:46:32 +0900 Subject: [PATCH] Arducopter - reduced rate of decent when landing using sonar --- ArduCopter/commands_logic.pde | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ArduCopter/commands_logic.pde b/ArduCopter/commands_logic.pde index 8a09f52a71..231f8585c3 100644 --- a/ArduCopter/commands_logic.pde +++ b/ArduCopter/commands_logic.pde @@ -363,6 +363,7 @@ static bool verify_land_sonar() }else{ // begin to pull down on the throttle landing_boost++; + landing_boost = min(landing_boost, 40); } if(current_loc.alt < 200 ){ @@ -371,14 +372,16 @@ static bool verify_land_sonar() if(current_loc.alt < 150 ){ //rapid throttle reduction - int16_t lb = (1.75 * icount * icount) - (7.2 * icount); - icount++; - lb = constrain(lb, 0, 180); - landing_boost += lb; + //int16_t lb = (1.75 * icount * icount) - (7.2 * icount); + //icount++; + //lb = constrain(lb, 0, 180); + //landing_boost += lb; //Serial.printf("%0.0f, %d, %d, %d\n", icount, current_loc.alt, landing_boost, lb); + // if we are low or don't seem to be decending much, increment ground detector if(current_loc.alt < 40 || abs(climb_rate) < 20) { - if(ground_detector++ > 20) { + landing_boost++; // reduce the throttle at twice the normal rate + if(ground_detector++ > 30) { land_complete = true; ground_detector = 0; icount = 1;