Browse Source

Copter: Don't reset yaw rate when disarmed or ground idle in Heli Stab and Acro

gps-1.3.1
Leonard Hall 4 years ago committed by Andrew Tridgell
parent
commit
df9470d8af
  1. 2
      ArduCopter/mode_acro.cpp
  2. 4
      ArduCopter/mode_acro_heli.cpp
  3. 2
      ArduCopter/mode_althold.cpp
  4. 2
      ArduCopter/mode_drift.cpp
  5. 2
      ArduCopter/mode_poshold.cpp
  6. 2
      ArduCopter/mode_sport.cpp
  7. 4
      ArduCopter/mode_stabilize_heli.cpp

2
ArduCopter/mode_acro.cpp

@ -27,7 +27,7 @@ void ModeAcro::run() @@ -27,7 +27,7 @@ void ModeAcro::run()
switch (motors->get_spool_state()) {
case AP_Motors::SpoolState::SHUT_DOWN:
// Motors Stopped
attitude_control->reset_target_and_rate();
attitude_control->reset_target_and_rate(true);
attitude_control->reset_rate_controller_I_terms();
break;

4
ArduCopter/mode_acro_heli.cpp

@ -45,14 +45,14 @@ void ModeAcro_Heli::run() @@ -45,14 +45,14 @@ void ModeAcro_Heli::run()
switch (motors->get_spool_state()) {
case AP_Motors::SpoolState::SHUT_DOWN:
// Motors Stopped
attitude_control->reset_target_and_rate();
attitude_control->reset_target_and_rate(false);
attitude_control->reset_rate_controller_I_terms();
break;
case AP_Motors::SpoolState::GROUND_IDLE:
// If aircraft is landed, set target heading to current and reset the integrator
// Otherwise motors could be at ground idle for practice autorotation
if ((motors->init_targets_on_arming() && motors->using_leaky_integrator()) || (copter.ap.land_complete && !motors->using_leaky_integrator())) {
attitude_control->reset_target_and_rate();
attitude_control->reset_target_and_rate(false);
attitude_control->reset_rate_controller_I_terms_smoothly();
}
break;

2
ArduCopter/mode_althold.cpp

@ -50,7 +50,7 @@ void ModeAltHold::run() @@ -50,7 +50,7 @@ void ModeAltHold::run()
case AltHold_MotorStopped:
attitude_control->reset_rate_controller_I_terms();
attitude_control->reset_yaw_target_and_rate();
attitude_control->reset_yaw_target_and_rate(false);
pos_control->relax_z_controller(0.0f); // forces throttle output to decay to zero
break;

2
ArduCopter/mode_drift.cpp

@ -91,7 +91,7 @@ void ModeDrift::run() @@ -91,7 +91,7 @@ void ModeDrift::run()
switch (motors->get_spool_state()) {
case AP_Motors::SpoolState::SHUT_DOWN:
// Motors Stopped
attitude_control->reset_yaw_target_and_rate();
attitude_control->reset_yaw_target_and_rate(false);
attitude_control->reset_rate_controller_I_terms();
break;

2
ArduCopter/mode_poshold.cpp

@ -102,7 +102,7 @@ void ModePosHold::run() @@ -102,7 +102,7 @@ void ModePosHold::run()
case AltHold_MotorStopped:
attitude_control->reset_rate_controller_I_terms();
attitude_control->reset_yaw_target_and_rate();
attitude_control->reset_yaw_target_and_rate(false);
pos_control->relax_z_controller(0.0f); // forces throttle output to decay to zero
loiter_nav->clear_pilot_desired_acceleration();
loiter_nav->init_target();

2
ArduCopter/mode_sport.cpp

@ -76,7 +76,7 @@ void ModeSport::run() @@ -76,7 +76,7 @@ void ModeSport::run()
case AltHold_MotorStopped:
attitude_control->reset_rate_controller_I_terms();
attitude_control->reset_yaw_target_and_rate();
attitude_control->reset_yaw_target_and_rate(false);
pos_control->relax_z_controller(0.0f); // forces throttle output to decay to zero
break;

4
ArduCopter/mode_stabilize_heli.cpp

@ -50,14 +50,14 @@ void ModeStabilize_Heli::run() @@ -50,14 +50,14 @@ void ModeStabilize_Heli::run()
switch (motors->get_spool_state()) {
case AP_Motors::SpoolState::SHUT_DOWN:
// Motors Stopped
attitude_control->reset_yaw_target_and_rate();
attitude_control->reset_yaw_target_and_rate(false);
attitude_control->reset_rate_controller_I_terms();
break;
case AP_Motors::SpoolState::GROUND_IDLE:
// If aircraft is landed, set target heading to current and reset the integrator
// Otherwise motors could be at ground idle for practice autorotation
if ((motors->init_targets_on_arming() && motors->using_leaky_integrator()) || (copter.ap.land_complete && !motors->using_leaky_integrator())) {
attitude_control->reset_yaw_target_and_rate();
attitude_control->reset_yaw_target_and_rate(false);
attitude_control->reset_rate_controller_I_terms_smoothly();
}
break;

Loading…
Cancel
Save