mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 15:23:57 -04:00
AP_MotorsHeli: better governor power recovery from autorotation
This commit is contained in:
parent
40d18f46cf
commit
eba850d9ef
@ -293,6 +293,7 @@ void AP_MotorsHeli_RSC::output(RotorControlState state)
|
||||
_starting = true;
|
||||
_autorotating = false;
|
||||
_bailing_out = false;
|
||||
_gov_bailing_out = false;
|
||||
|
||||
// ensure _idle_throttle not set to invalid value
|
||||
_idle_throttle = get_idle_output();
|
||||
@ -341,8 +342,11 @@ void AP_MotorsHeli_RSC::output(RotorControlState state)
|
||||
} else {
|
||||
_idle_throttle = get_idle_output();
|
||||
}
|
||||
_use_bailout_ramp = false;
|
||||
}
|
||||
// this resets the bailout feature if the aircraft has landed.
|
||||
_use_bailout_ramp = false;
|
||||
_bailing_out = false;
|
||||
_gov_bailing_out = false;
|
||||
}
|
||||
_control_output = _idle_throttle;
|
||||
break;
|
||||
@ -409,6 +413,7 @@ void AP_MotorsHeli_RSC::update_rotor_ramp(float rotor_ramp_input, float dt)
|
||||
if (!_bailing_out) {
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "bailing_out");
|
||||
_bailing_out = true;
|
||||
if (_control_mode == ROTOR_CONTROL_MODE_AUTOTHROTTLE) {_gov_bailing_out = true;}
|
||||
}
|
||||
_rotor_ramp_output += (dt / bailout_time);
|
||||
} else {
|
||||
@ -561,14 +566,19 @@ void AP_MotorsHeli_RSC::autothrottle_run()
|
||||
_governor_fault_count = 0; // reset fault count if the fault doesn't persist
|
||||
}
|
||||
} else if (!_governor_engage && !_governor_fault) {
|
||||
// if governor is not engaged and rotor is overspeeding by more than 2% due to misconfigured
|
||||
// throttle curve or stuck throttle, set a fault and governor will not operate
|
||||
if (_rotor_rpm > (_governor_rpm + _governor_range)) {
|
||||
// if governor is not engaged and rotor is overspeeding by more than governor range due to
|
||||
// misconfigured throttle curve or stuck throttle, set a fault and governor will not operate
|
||||
if (_rotor_rpm > (_governor_rpm + _governor_range) && !_gov_bailing_out) {
|
||||
_governor_fault = true;
|
||||
governor_reset();
|
||||
gcs().send_text(MAV_SEVERITY_WARNING, "Governor Fault: Rotor Overspeed");
|
||||
_governor_output = 0.0f;
|
||||
|
||||
// when performing power recovery from autorotation, this waits for user to load rotor in order to
|
||||
// engage the governor
|
||||
} else if (_rotor_rpm > _governor_rpm && _gov_bailing_out) {
|
||||
_governor_output = 0.0f;
|
||||
|
||||
// torque rise limiter accelerates rotor to the reference speed
|
||||
// this limits the max torque rise the governor could call for from the main power loop
|
||||
} else if (_rotor_rpm >= (_governor_rpm * 0.5f)) {
|
||||
@ -577,6 +587,7 @@ void AP_MotorsHeli_RSC::autothrottle_run()
|
||||
if (_rotor_rpm >= ((float)_governor_rpm - torque_ref_error_rpm)) {
|
||||
_governor_engage = true;
|
||||
_autothrottle = true;
|
||||
_gov_bailing_out = false;
|
||||
gcs().send_text(MAV_SEVERITY_NOTICE, "Governor Engaged");
|
||||
}
|
||||
} else {
|
||||
|
@ -166,6 +166,7 @@ private:
|
||||
bool _autorotating; // flag that holds the status of autorotation
|
||||
bool _bailing_out; // flag that holds the status of bail out(power engagement)
|
||||
float _idle_throttle; // current idle throttle setting
|
||||
bool _gov_bailing_out; // flag that holds the status of governor bail out
|
||||
|
||||
// update_rotor_ramp - slews rotor output scalar between 0 and 1, outputs float scalar to _rotor_ramp_output
|
||||
void update_rotor_ramp(float rotor_ramp_input, float dt);
|
||||
|
Loading…
Reference in New Issue
Block a user