mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Fixing Trad Heli Ext ESC Controller
-Added ramp-down rate instead of instantly setting ramp to zero when throttle is dropped to bottom. This is to allow "warm-restart" if shutdown was unintentional. -Actual ESC still goes to zero while throttle is dropped to the bottom, only the ramp counter winds down slowly behind the scenes.
This commit is contained in:
parent
de85442c36
commit
4ffc5e211a
@ -487,7 +487,7 @@ void AP_MotorsHeli::move_swash(int16_t roll_out, int16_t pitch_out, int16_t coll
|
|||||||
void AP_MotorsHeli::ext_esc_control()
|
void AP_MotorsHeli::ext_esc_control()
|
||||||
|
|
||||||
{
|
{
|
||||||
switch ( AP_MOTORS_ESC_MODE_PASSTHROUGH ) {
|
switch ( AP_MOTORS_EXT_ESC_ACTIVE ) {
|
||||||
|
|
||||||
case AP_MOTORS_ESC_MODE_PASSTHROUGH:
|
case AP_MOTORS_ESC_MODE_PASSTHROUGH:
|
||||||
if( armed() && _rc_8->control_in > 10 ){
|
if( armed() && _rc_8->control_in > 10 ){
|
||||||
@ -513,7 +513,10 @@ void AP_MotorsHeli::ext_esc_control()
|
|||||||
ext_esc_output = ext_gov_setpoint;
|
ext_esc_output = ext_gov_setpoint;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ext_esc_ramp = 0; //Return ESC Ramp to 0
|
ext_esc_ramp--; //Return ESC Ramp to 0
|
||||||
|
if (ext_esc_ramp < 0){
|
||||||
|
ext_esc_ramp = 0;
|
||||||
|
}
|
||||||
ext_esc_output = 1000; //Just to be sure ESC output is 0
|
ext_esc_output = 1000; //Just to be sure ESC output is 0
|
||||||
}
|
}
|
||||||
_rc->OutputCh(AP_MOTORS_HELI_EXT_ESC, ext_esc_output);
|
_rc->OutputCh(AP_MOTORS_HELI_EXT_ESC, ext_esc_output);
|
||||||
|
Loading…
Reference in New Issue
Block a user