diff --git a/src/main/fc/rc_controls.c b/src/main/fc/rc_controls.c index 49280ef80..0727bf2ee 100644 --- a/src/main/fc/rc_controls.c +++ b/src/main/fc/rc_controls.c @@ -92,6 +92,8 @@ PG_RESET_TEMPLATE(flight3DConfig_t, flight3DConfig, .deadband3d_high = 1514, .neutral3d = 1460, .deadband3d_throttle = 50, + .limit3d_low = 1000, + .limit3d_high = 2000, .switched_mode3d = false ); diff --git a/src/main/fc/rc_controls.h b/src/main/fc/rc_controls.h index c9803754f..55ef28bdb 100644 --- a/src/main/fc/rc_controls.h +++ b/src/main/fc/rc_controls.h @@ -94,6 +94,8 @@ typedef struct flight3DConfig_s { uint16_t deadband3d_high; // max 3d value uint16_t neutral3d; // center 3d value uint16_t deadband3d_throttle; // default throttle deadband from MIDRC + uint16_t limit3d_low; // pwm output value for max negative thrust + uint16_t limit3d_high; // pwm output value for max positive thrust uint8_t switched_mode3d; // enable '3D Switched Mode' } flight3DConfig_t; diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index f55cdef48..fde35caab 100644 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -389,15 +389,15 @@ void initEscEndpoints(void) default: if (feature(FEATURE_3D)) { disarmMotorOutput = flight3DConfig()->neutral3d; - motorOutputLow = PWM_RANGE_MIN; + motorOutputLow = flight3DConfig()->limit3d_low; + motorOutputHigh = flight3DConfig()->limit3d_high; + deadbandMotor3dHigh = flight3DConfig()->deadband3d_high; + deadbandMotor3dLow = flight3DConfig()->deadband3d_low; } else { disarmMotorOutput = motorConfig()->mincommand; motorOutputLow = motorConfig()->minthrottle; + motorOutputHigh = motorConfig()->maxthrottle; } - motorOutputHigh = motorConfig()->maxthrottle; - deadbandMotor3dHigh = flight3DConfig()->deadband3d_high; - deadbandMotor3dLow = flight3DConfig()->deadband3d_low; - break; } diff --git a/src/main/interface/settings.c b/src/main/interface/settings.c index 05aba0a4e..b0a816d41 100644 --- a/src/main/interface/settings.c +++ b/src/main/interface/settings.c @@ -563,6 +563,8 @@ const clivalue_t valueTable[] = { { "3d_deadband_high", VAR_UINT16 | MASTER_VALUE, .config.minmax = { PWM_RANGE_MIDDLE, PWM_PULSE_MAX }, PG_MOTOR_3D_CONFIG, offsetof(flight3DConfig_t, deadband3d_high) }, { "3d_neutral", VAR_UINT16 | MASTER_VALUE, .config.minmax = { PWM_PULSE_MIN, PWM_PULSE_MAX }, PG_MOTOR_3D_CONFIG, offsetof(flight3DConfig_t, neutral3d) }, { "3d_deadband_throttle", VAR_UINT16 | MASTER_VALUE, .config.minmax = { PWM_PULSE_MIN, PWM_PULSE_MAX }, PG_MOTOR_3D_CONFIG, offsetof(flight3DConfig_t, deadband3d_throttle) }, + { "3d_limit_low", VAR_UINT16 | MASTER_VALUE, .config.minmax = { PWM_PULSE_MIN, PWM_RANGE_MIDDLE }, PG_MOTOR_3D_CONFIG, offsetof(flight3DConfig_t, limit3d_low) }, + { "3d_limit_high", VAR_UINT16 | MASTER_VALUE, .config.minmax = { PWM_RANGE_MIDDLE, PWM_PULSE_MAX }, PG_MOTOR_3D_CONFIG, offsetof(flight3DConfig_t, limit3d_high) }, { "3d_switched_mode", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MOTOR_3D_CONFIG, offsetof(flight3DConfig_t, switched_mode3d) }, // PG_SERVO_CONFIG