Merge pull request #2105 from mikeller/adjust_pid_scaling_for_servos
Adjusted PID scaling for the servo mixer.
This commit is contained in:
commit
77f57f7fc8
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#define PID_CONTROLLER_BETAFLIGHT 1
|
#define PID_CONTROLLER_BETAFLIGHT 1
|
||||||
#define PID_MIXER_SCALING 100.0f
|
#define PID_MIXER_SCALING 100.0f
|
||||||
|
#define PID_SERVO_MIXER_SCALING 7.0f
|
||||||
#define YAW_P_LIMIT_MIN 100 // Maximum value for yaw P limiter
|
#define YAW_P_LIMIT_MIN 100 // Maximum value for yaw P limiter
|
||||||
#define YAW_P_LIMIT_MAX 500 // Maximum value for yaw P limiter
|
#define YAW_P_LIMIT_MAX 500 // Maximum value for yaw P limiter
|
||||||
#define PIDSUM_LIMIT 0.5f
|
#define PIDSUM_LIMIT 0.5f
|
||||||
|
|
|
@ -341,9 +341,9 @@ STATIC_UNIT_TESTED void servoMixer(void)
|
||||||
input[INPUT_STABILIZED_YAW] = rcCommand[YAW];
|
input[INPUT_STABILIZED_YAW] = rcCommand[YAW];
|
||||||
} else {
|
} else {
|
||||||
// Assisted modes (gyro only or gyro+acc according to AUX configuration in Gui
|
// Assisted modes (gyro only or gyro+acc according to AUX configuration in Gui
|
||||||
input[INPUT_STABILIZED_ROLL] = axisPIDf[ROLL];
|
input[INPUT_STABILIZED_ROLL] = axisPIDf[ROLL] * PID_SERVO_MIXER_SCALING;
|
||||||
input[INPUT_STABILIZED_PITCH] = axisPIDf[PITCH];
|
input[INPUT_STABILIZED_PITCH] = axisPIDf[PITCH] * PID_SERVO_MIXER_SCALING;
|
||||||
input[INPUT_STABILIZED_YAW] = axisPIDf[YAW];
|
input[INPUT_STABILIZED_YAW] = axisPIDf[YAW] * PID_SERVO_MIXER_SCALING;
|
||||||
|
|
||||||
// Reverse yaw servo when inverted in 3D mode
|
// Reverse yaw servo when inverted in 3D mode
|
||||||
if (feature(FEATURE_3D) && (rcData[THROTTLE] < rxConfig->midrc)) {
|
if (feature(FEATURE_3D) && (rcData[THROTTLE] < rxConfig->midrc)) {
|
||||||
|
|
Loading…
Reference in New Issue