removed D term for rate control for now. It may have been messing things up.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2077 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
jasonshort 2011-05-03 05:24:48 +00:00
parent 9d089920ae
commit 2290deb925
2 changed files with 6 additions and 3 deletions

View File

@ -387,7 +387,7 @@
# define NAV_WP_I 0.0 // leave 0
#endif
#ifndef NAV_WP_D
# define NAV_WP_D 15 // not sure about at all
# define NAV_WP_D 0 // not sure about at all
#endif
#ifndef NAV_WP_IMAX
# define NAV_WP_IMAX 30 // 20 degrees

View File

@ -154,6 +154,7 @@ void calc_rate_nav()
// change to rate error
// we want to be going 450cm/s
int error = WAYPOINT_SPEED - g_gps->ground_speed;
//int error = 450
// which direction are we moving?
long target_error = target_bearing - g_gps->ground_course;
@ -163,8 +164,10 @@ void calc_rate_nav()
//error = (float)error * cos(radians((float)target_error/100));
// Scale response by kP
long nav_lat = g.pid_nav_wp.kP() * error;
int dampening = g.pid_nav_wp.kD() * (g_gps->ground_speed - last_ground_speed);
//long nav_lat = g.pid_nav_wp.kP() * error;
//int dampening = g.pid_nav_wp.kD() * (g_gps->ground_speed - last_ground_speed);
long nav_lat = NAV_WP_P * error;
int dampening = NAV_WP_D * (g_gps->ground_speed - last_ground_speed);
// remember our old speed
last_ground_speed = g_gps->ground_speed;