diff --git a/docs/Settings.md b/docs/Settings.md index ee771cb662..6119510962 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -552,16 +552,6 @@ Blackbox logging rate numerator. Use num/denom settings to decide if a frame sho --- -### control_deadband - -Stick deadband in [r/c points], applied after r/c deadband and expo. Used to check if sticks are centered. - -| Default | Min | Max | -| --- | --- | --- | -| 10 | 2 | 250 | - ---- - ### controlrate_profile Control rate profile to switch to when the battery profile is selected, 0 to disable and keep the currently selected control rate profile diff --git a/src/main/fc/fc_core.c b/src/main/fc/fc_core.c index c51519927b..6bee30e572 100644 --- a/src/main/fc/fc_core.c +++ b/src/main/fc/fc_core.c @@ -237,7 +237,7 @@ static void updateArmingStatus(void) /* CHECK: pitch / roll sticks centered when NAV_LAUNCH_MODE enabled */ if (isNavLaunchEnabled()) { - if (isRollPitchStickDeflected(rcControlsConfig()->control_deadband)) { + if (isRollPitchStickDeflected(CONTROL_DEADBAND)) { ENABLE_ARMING_FLAG(ARMING_DISABLED_ROLLPITCH_NOT_CENTERED); } else { DISABLE_ARMING_FLAG(ARMING_DISABLED_ROLLPITCH_NOT_CENTERED); diff --git a/src/main/fc/rc_controls.c b/src/main/fc/rc_controls.c index 9cce60a2a3..6c65736dbe 100644 --- a/src/main/fc/rc_controls.c +++ b/src/main/fc/rc_controls.c @@ -75,13 +75,12 @@ stickPositions_e rcStickPositions; FASTRAM int16_t rcCommand[4]; // interval [1000;2000] for THROTTLE and [-500;+500] for ROLL/PITCH/YAW -PG_REGISTER_WITH_RESET_TEMPLATE(rcControlsConfig_t, rcControlsConfig, PG_RC_CONTROLS_CONFIG, 3); +PG_REGISTER_WITH_RESET_TEMPLATE(rcControlsConfig_t, rcControlsConfig, PG_RC_CONTROLS_CONFIG, 4); PG_RESET_TEMPLATE(rcControlsConfig_t, rcControlsConfig, .deadband = SETTING_DEADBAND_DEFAULT, .yaw_deadband = SETTING_YAW_DEADBAND_DEFAULT, .pos_hold_deadband = SETTING_POS_HOLD_DEADBAND_DEFAULT, - .control_deadband = SETTING_CONTROL_DEADBAND_DEFAULT, .alt_hold_deadband = SETTING_ALT_HOLD_DEADBAND_DEFAULT, .mid_throttle_deadband = SETTING_3D_DEADBAND_THROTTLE_DEFAULT, .airmodeHandlingType = SETTING_AIRMODE_TYPE_DEFAULT, @@ -104,7 +103,7 @@ bool areSticksInApModePosition(uint16_t ap_mode) bool areSticksDeflected(void) { - return (ABS(rcCommand[ROLL]) > rcControlsConfig()->control_deadband) || (ABS(rcCommand[PITCH]) > rcControlsConfig()->control_deadband) || (ABS(rcCommand[YAW]) > rcControlsConfig()->control_deadband); + return (ABS(rcCommand[ROLL]) > CONTROL_DEADBAND) || (ABS(rcCommand[PITCH]) > CONTROL_DEADBAND) || (ABS(rcCommand[YAW]) > CONTROL_DEADBAND); } bool isRollPitchStickDeflected(uint8_t deadband) diff --git a/src/main/fc/rc_controls.h b/src/main/fc/rc_controls.h index ea23eae907..0c9bcb199d 100644 --- a/src/main/fc/rc_controls.h +++ b/src/main/fc/rc_controls.h @@ -19,7 +19,7 @@ #include "config/parameter_group.h" -#define AIRMODE_THROTTLE_THRESHOLD 1300 +#define CONTROL_DEADBAND 10 // Used to check if sticks are centered typedef enum rc_alias { ROLL = 0, @@ -85,7 +85,6 @@ typedef struct rcControlsConfig_s { uint8_t deadband; // introduce a deadband around the stick center for pitch and roll axis. Must be greater than zero. uint8_t yaw_deadband; // introduce a deadband around the stick center for yaw axis. Must be greater than zero. uint8_t pos_hold_deadband; // Deadband for position hold - uint8_t control_deadband; // General deadband to check if sticks are deflected, us PWM. uint8_t alt_hold_deadband; // Defines the neutral zone of throttle stick during altitude hold uint16_t mid_throttle_deadband; // default throttle deadband from MIDRC uint8_t airmodeHandlingType; // Defaults to ANTI_WINDUP triggered at sticks centered diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index 89e21bd750..e3e69c7487 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -1703,11 +1703,6 @@ groups: default_value: 10 min: 2 max: 250 - - name: control_deadband - description: "Stick deadband in [r/c points], applied after r/c deadband and expo. Used to check if sticks are centered." - default_value: 10 - min: 2 - max: 250 - name: alt_hold_deadband description: "Defines the deadband of throttle during alt_hold [r/c points]" default_value: 50