Browse Source

Better Loiter PIDs

Fixed RTL overshoot bug
master
Jason Short 14 years ago
parent
commit
167df79b49
  1. 6
      ArduCopter/ArduCopter.pde
  2. 10
      ArduCopter/config.h

6
ArduCopter/ArduCopter.pde

@ -1,6 +1,6 @@
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#define THISFIRMWARE "ArduCopter V2.0.46 Beta" #define THISFIRMWARE "ArduCopter V2.0.47 Beta"
/* /*
ArduCopter Version 2.0 Beta ArduCopter Version 2.0 Beta
Authors: Jason Short Authors: Jason Short
@ -1124,7 +1124,7 @@ static void update_navigation()
break; break;
case RTL: case RTL:
if(wp_distance > 4){ if((wp_distance <= g.waypoint_radius) || check_missed_wp()){
// calculates desired Yaw // calculates desired Yaw
// XXX this is an experiment // XXX this is an experiment
#if FRAME_CONFIG == HELI_FRAME #if FRAME_CONFIG == HELI_FRAME
@ -1402,8 +1402,6 @@ static void update_nav_wp()
calc_loiter_pitch_roll(); calc_loiter_pitch_roll();
} else { } else {
// for long journey's reset the wind resopnse
// it assumes we are standing still.
// use error as the desired rate towards the target // use error as the desired rate towards the target
calc_nav_rate(g.waypoint_speed_max); calc_nav_rate(g.waypoint_speed_max);
// rotate pitch and roll to the copter frame of reference // rotate pitch and roll to the copter frame of reference

10
ArduCopter/config.h

@ -467,23 +467,23 @@
// Navigation control gains // Navigation control gains
// //
#ifndef LOITER_P #ifndef LOITER_P
# define LOITER_P 1.0 // # define LOITER_P .5 //
#endif #endif
#ifndef LOITER_I #ifndef LOITER_I
# define LOITER_I 0.01 // # define LOITER_I 0.0 //
#endif #endif
#ifndef LOITER_IMAX #ifndef LOITER_IMAX
# define LOITER_IMAX 12 // degrees° # define LOITER_IMAX 12 // degrees°
#endif #endif
#ifndef NAV_P #ifndef NAV_P
# define NAV_P 2.0 // for 4.5 ms error = 13.5 pitch # define NAV_P 4.0 //
#endif #endif
#ifndef NAV_I #ifndef NAV_I
# define NAV_I 0.10 // this feels really low, 4s to move 1 degree pitch... # define NAV_I 0.25 // this feels really low, 4s to move 1 degree pitch...
#endif #endif
#ifndef NAV_IMAX #ifndef NAV_IMAX
# define NAV_IMAX 16 // degrees # define NAV_IMAX 20 // degrees
#endif #endif
#ifndef WAYPOINT_SPEED_MAX #ifndef WAYPOINT_SPEED_MAX

Loading…
Cancel
Save