From 9f50cd14d1084f5132170f11a58aa1e2647b7658 Mon Sep 17 00:00:00 2001 From: Jason Short Date: Sun, 16 Oct 2011 15:41:54 -0700 Subject: [PATCH] tweaked Alt hold PIDs, loiter PIDs based on SIM testing and feedback. Increased distance error for loiter for faster return to center. --- ArduCopter/config.h | 13 +++++++------ ArduCopter/navigation.pde | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 692644cf5f..7d4f8a176d 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -441,7 +441,7 @@ // Navigation control gains // #ifndef LOITER_P -# define LOITER_P .5 // +# define LOITER_P .3 // #endif #ifndef LOITER_I # define LOITER_I 0.0 // @@ -451,7 +451,7 @@ #endif #ifndef NAV_P -# define NAV_P 4.0 // +# define NAV_P 3.0 // #endif #ifndef NAV_I # define NAV_I 0.25 // this feels really low, 4s to move 1 degree pitch... @@ -473,15 +473,16 @@ #endif #ifndef THR_HOLD_P -# define THR_HOLD_P 0.80 // +# define THR_HOLD_P 0.5 // #endif #ifndef THR_HOLD_I -# define THR_HOLD_I 0.00 // with 4m error, 12.5s windup +# define THR_HOLD_I 0.01 // with 4m error, 12.5s windup #endif #ifndef THR_HOLD_IMAX -# define THR_HOLD_IMAX 00 +# define THR_HOLD_IMAX 300 #endif +// RATE control #ifndef THROTTLE_P # define THROTTLE_P 0.6 // #endif @@ -489,7 +490,7 @@ # define THROTTLE_I 0.10 // with 4m error, 12.5s windup #endif #ifndef THROTTLE_IMAX -# define THROTTLE_IMAX 300 +# define THROTTLE_IMAX 50 #endif diff --git a/ArduCopter/navigation.pde b/ArduCopter/navigation.pde index 5718bb619e..8c4f1ff6cb 100644 --- a/ArduCopter/navigation.pde +++ b/ArduCopter/navigation.pde @@ -55,7 +55,7 @@ static void calc_location_error(struct Location *next_loc) lat_error = next_loc->lat - current_loc.lat; // 0 - 500 = -500 pitch NORTH } -#define NAV_ERR_MAX 400 +#define NAV_ERR_MAX 800 static void calc_loiter(int x_error, int y_error) { x_error = constrain(x_error, -NAV_ERR_MAX, NAV_ERR_MAX);