Added Yaw control when descending in Alt hold
lowered kP & kD for Alt hold a tad
Adjusted RTL behavior to do speed control up to 4m to home, then go into Loiter


git-svn-id: https://arducopter.googlecode.com/svn/trunk@2872 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
jasonshort 2011-07-16 22:12:52 +00:00
parent 05c058148b
commit af8afecbb8
4 changed files with 27 additions and 27 deletions

View File

@ -1151,7 +1151,7 @@ void update_current_flight_mode(void)
adjust_altitude();
// calcualte new nav_yaw offset
nav_yaw = get_nav_yaw_offset(g.rc_4.control_in, g.rc_3.control_in);
nav_yaw = get_nav_yaw_offset(g.rc_4.control_in, 1); // send 1 instead of throttle to get nav control with low throttle
// Roll control
g.rc_1.servo_out = get_stabilize_roll(g.rc_1.control_in);
@ -1191,7 +1191,7 @@ void update_current_flight_mode(void)
case LOITER:
// calcualte new nav_yaw offset
nav_yaw = get_nav_yaw_offset(g.rc_4.control_in, g.rc_3.control_in);
nav_yaw = get_nav_yaw_offset(g.rc_4.control_in, 1); // send 1 instead of throttle to get nav control with low throttle
// allow interactive changing of atitude
adjust_altitude();
@ -1240,34 +1240,34 @@ void update_navigation()
update_nav_wp();
break;
case RTL:
// calculates desired Yaw
update_nav_yaw();
case GUIDED:
update_nav_yaw();
// switch passthrough to LOITER
case LOITER:
case RTL:
if(wp_distance > 20){
// calculates desired Yaw
update_nav_yaw();
}else{
// Don't Yaw anymore
// hack to elmininate crosstrack effect
crosstrack_bearing = target_bearing;
}
// are we Traversing or Loitering?
wp_control = (wp_distance < 50) ? LOITER_MODE : WP_MODE;
//wp_control = LOITER_MODE;
wp_control = (wp_distance < 4 ) ? LOITER_MODE : WP_MODE;
// calculates the desired Roll and Pitch
update_nav_wp();
break;
/*#if YAW_HACK == 1
case SIMPLE:
// calculates desired Yaw
// exprimental_hack
if(g.rc_6.control_in > 900)
update_nav_yaw();
if(g.rc_6.control_in < 100){
nav_yaw = dcm.yaw_sensor;
}
// switch passthrough to LOITER
case LOITER:
// are we Traversing or Loitering?
//wp_control = (wp_distance < 20) ? LOITER_MODE : WP_MODE;
wp_control = LOITER_MODE;
// calculates the desired Roll and Pitch
update_nav_wp();
break;
#endif
*/
}
}

View File

@ -137,11 +137,11 @@ get_throttle(int throttle_input)
}
long
get_nav_yaw_offset(int yaw_input, int throttle_input)
get_nav_yaw_offset(int yaw_input, int reset)
{
long _yaw;
if(throttle_input == 0){
if(reset == 0){
// we are on the ground
return dcm.yaw_sensor;

View File

@ -399,13 +399,13 @@
// Throttle control gains
//
#ifndef THROTTLE_P
# define THROTTLE_P 0.4 // trying a lower val
# define THROTTLE_P 0.25 // trying a lower val
#endif
#ifndef THROTTLE_I
# define THROTTLE_I 0.01 //with 4m error, 12.5s windup
#endif
#ifndef THROTTLE_D
# define THROTTLE_D 0.35 // upped with filter
# define THROTTLE_D 0.25 // upped with filter
#endif
#ifndef THROTTLE_IMAX
# define THROTTLE_IMAX 30

View File

@ -40,7 +40,7 @@ const struct Menu::command main_menu_commands[] PROGMEM = {
};
// Create the top-level menu object.
MENU(main_menu, "AC 2.0.35 Beta", main_menu_commands);
MENU(main_menu, "AC 2.0.36 Beta", main_menu_commands);
void init_ardupilot()
{