mirror of https://github.com/ArduPilot/ardupilot
AP_MotorsHeli: fix cooldown feature with new autorotation RSC library
This commit is contained in:
parent
4ce1c5db90
commit
e30b4bf090
|
@ -295,6 +295,10 @@ void AP_MotorsHeli_RSC::output(RotorControlState state)
|
||||||
|
|
||||||
// ensure _idle_throttle not set to invalid value
|
// ensure _idle_throttle not set to invalid value
|
||||||
_idle_throttle = get_idle_output();
|
_idle_throttle = get_idle_output();
|
||||||
|
|
||||||
|
// reset fast idle timer
|
||||||
|
_fast_idle_timer = 0.0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RotorControlState::IDLE:
|
case RotorControlState::IDLE:
|
||||||
|
@ -330,15 +334,12 @@ void AP_MotorsHeli_RSC::output(RotorControlState state)
|
||||||
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Turbine startup");
|
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Turbine startup");
|
||||||
_starting = false;
|
_starting = false;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (_cooldown_time > 0) {
|
|
||||||
_idle_throttle = get_idle_output() * 1.5f;
|
|
||||||
_fast_idle_timer += dt;
|
|
||||||
if (_fast_idle_timer > (float)_cooldown_time) {
|
|
||||||
_fast_idle_timer = 0.0f;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
_idle_throttle = get_idle_output();
|
_idle_throttle = get_idle_output();
|
||||||
|
if (_fast_idle_timer > 0.0) {
|
||||||
|
// running at fast idle for engine cool down
|
||||||
|
_idle_throttle *= 1.5;
|
||||||
|
_fast_idle_timer -= dt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// this resets the bailout feature if the aircraft has landed.
|
// this resets the bailout feature if the aircraft has landed.
|
||||||
|
@ -353,6 +354,11 @@ void AP_MotorsHeli_RSC::output(RotorControlState state)
|
||||||
// set main rotor ramp to increase to full speed
|
// set main rotor ramp to increase to full speed
|
||||||
update_rotor_ramp(1.0f, dt);
|
update_rotor_ramp(1.0f, dt);
|
||||||
|
|
||||||
|
// set fast idle timer so next time RSC goes to idle, the cooldown timer starts
|
||||||
|
if (_cooldown_time.get() > 0) {
|
||||||
|
_fast_idle_timer = _cooldown_time.get();
|
||||||
|
}
|
||||||
|
|
||||||
// ensure _idle_throttle not set to invalid value due to premature switch out of turbine start
|
// ensure _idle_throttle not set to invalid value due to premature switch out of turbine start
|
||||||
if (_starting) {
|
if (_starting) {
|
||||||
_idle_throttle = get_idle_output();
|
_idle_throttle = get_idle_output();
|
||||||
|
|
Loading…
Reference in New Issue