diff --git a/ArduPlane/Attitude.cpp b/ArduPlane/Attitude.cpp index 33be706141..da5fe31667 100644 --- a/ArduPlane/Attitude.cpp +++ b/ArduPlane/Attitude.cpp @@ -595,6 +595,11 @@ void Plane::calc_nav_yaw_coordinated(float speed_scaler) plane.guided_state.last_forced_rpy_ms.z > 0 && millis() - plane.guided_state.last_forced_rpy_ms.z < 3000) { commanded_rudder = plane.guided_state.forced_rpy_cd.z; + } else if (control_mode == &mode_autotune && g.acro_yaw_rate > 0 && yawController.rate_control_enabled()) { + // user is doing an AUTOTUNE with yaw rate control + const float rudd_expo = rudder_in_expo(true); + const float yaw_rate = (rudd_expo/SERVO_MAX) * g.acro_yaw_rate; + commanded_rudder = yawController.get_rate_out(yaw_rate, speed_scaler, false); } else { if (control_mode == &mode_stabilize && rudder_in != 0) { disable_integrator = true; diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index f000c2434c..a3b2730bcf 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -546,7 +546,7 @@ const AP_Param::Info Plane::var_info[] = { // @Param: ACRO_YAW_RATE // @DisplayName: ACRO mode yaw rate - // @Description: The maximum yaw rate at full stick deflection in ACRO mode. If this is zero then rudder is directly controlled by rudder stick input + // @Description: The maximum yaw rate at full stick deflection in ACRO mode. If this is zero then rudder is directly controlled by rudder stick input. This option is only available if you also set YAW_RATE_ENABLE to 1. // @Units: deg/s // @Range: 0 500 // @Increment: 1 diff --git a/ArduPlane/control_modes.cpp b/ArduPlane/control_modes.cpp index a03f1eccc4..2ba1937da4 100644 --- a/ArduPlane/control_modes.cpp +++ b/ArduPlane/control_modes.cpp @@ -164,6 +164,7 @@ void Plane::autotune_start(void) gcs().send_text(MAV_SEVERITY_INFO, "Started autotune"); rollController.autotune_start(); pitchController.autotune_start(); + yawController.autotune_start(); } /* @@ -173,6 +174,7 @@ void Plane::autotune_restore(void) { rollController.autotune_restore(); pitchController.autotune_restore(); + yawController.autotune_restore(); gcs().send_text(MAV_SEVERITY_INFO, "Stopped autotune"); }