Made wpspeed governor run per second so 1hz gps doesn't fail. Gave a 1m/s minimum. Increased WPspeed max to 4.0m/s

This commit is contained in:
Jason Short 2011-10-15 15:35:18 -07:00
parent c3b93d70df
commit 3c51ce6a5f
2 changed files with 7 additions and 2 deletions

View File

@ -451,7 +451,7 @@
#endif
#ifndef WAYPOINT_SPEED_MAX
# define WAYPOINT_SPEED_MAX 300 // for 6m/s error = 13mph
# define WAYPOINT_SPEED_MAX 400 // for 6m/s error = 13mph
#endif

View File

@ -115,7 +115,12 @@ static void calc_nav_rate(int max_speed)
// limit the ramp up of the speed
if(waypoint_speed_gov < max_speed){
waypoint_speed_gov += 10;
waypoint_speed_gov += (int)(150.0 * dTnav); // increase at 1.5/ms
// go at least 1m/s
max_speed = max(100, waypoint_speed_gov);
// limit with governer
max_speed = min(max_speed, waypoint_speed_gov);
}