diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index cdee0aa035..920a21b971 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -1609,6 +1609,9 @@ void update_roll_pitch_mode(void) { switch(roll_pitch_mode) { case ROLL_PITCH_ACRO: + // copy user input for reporting purposes + control_roll = g.rc_1.control_in; + control_pitch = g.rc_2.control_in; #if FRAME_CONFIG == HELI_FRAME if(g.axis_enabled) { @@ -1651,9 +1654,13 @@ void update_roll_pitch_mode(void) break; case ROLL_PITCH_AUTO: + // copy user input for reporting purposes + control_roll = g.rc_1.control_in; + control_pitch = g.rc_2.control_in; + // copy latest output from nav controller to stabilize controller - nav_roll = auto_roll; - nav_pitch = auto_pitch; + nav_roll += constrain_int32(wrap_180(auto_roll - nav_roll), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second + nav_pitch += constrain_int32(wrap_180(auto_pitch - nav_pitch), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second get_stabilize_roll(nav_roll); get_stabilize_pitch(nav_pitch); @@ -1697,8 +1704,8 @@ void update_roll_pitch_mode(void) } // copy latest output from nav controller to stabilize controller - nav_roll = auto_roll; - nav_pitch = auto_pitch; + nav_roll += constrain_int32(wrap_180(auto_roll - nav_roll), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second + nav_pitch += constrain_int32(wrap_180(auto_pitch - nav_pitch), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second get_stabilize_roll(nav_roll); get_stabilize_pitch(nav_pitch); break; diff --git a/ArduCopter/Parameters.pde b/ArduCopter/Parameters.pde index ce0c7b9d40..180730fd4d 100644 --- a/ArduCopter/Parameters.pde +++ b/ArduCopter/Parameters.pde @@ -444,7 +444,7 @@ const AP_Param::Info var_info[] PROGMEM = { // @DisplayName: Auto Slew Rate // @Description: This restricts the rate of change of the roll and pitch attitude commanded by the auto pilot // @Units: Degrees/Second - // @Range: 1 45 + // @Range: 1 90 // @Increment: 1 // @User: Advanced GSCALAR(auto_slew_rate, "AUTO_SLEW", AUTO_SLEW_RATE), diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 5633cb63b5..27dd2687a2 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -968,7 +968,7 @@ #endif #ifndef AUTO_SLEW_RATE - # define AUTO_SLEW_RATE 30 // degrees/sec + # define AUTO_SLEW_RATE 45 // degrees/sec #endif #ifndef AUTO_YAW_SLEW_RATE