1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 06:45:16 +03:00

Add yaw smoothing back // adjust defaults // KISS fc remove some shared timers

This commit is contained in:
borisbstyle 2016-08-05 00:02:38 +02:00
parent 7d119ae669
commit 06be182e50
4 changed files with 5 additions and 12 deletions

View file

@ -203,10 +203,10 @@ static void resetPidProfile(pidProfile_t *pidProfile)
pidProfile->P8[ROLL] = 45;
pidProfile->I8[ROLL] = 40;
pidProfile->D8[ROLL] = 25;
pidProfile->D8[ROLL] = 20;
pidProfile->P8[PITCH] = 60;
pidProfile->I8[PITCH] = 60;
pidProfile->D8[PITCH] = 30;
pidProfile->D8[PITCH] = 25;
pidProfile->P8[YAW] = 80;
pidProfile->I8[YAW] = 45;
pidProfile->D8[YAW] = 20;
@ -244,7 +244,7 @@ static void resetPidProfile(pidProfile_t *pidProfile)
// Betaflight PID controller parameters
pidProfile->ptermSetpointWeight = 75;
pidProfile->dtermSetpointWeight = 200;
pidProfile->dtermSetpointWeight = 120;
pidProfile->pidMaxVelocityYaw = 200;
pidProfile->toleranceBand = 20;
pidProfile->toleranceBandReduction = 40;

View file

@ -194,7 +194,7 @@ static void pidBetaflight(const pidProfile_t *pidProfile, uint16_t max_angle_inc
configD[axis] = pidProfile->D8[axis];
}
// Limit abrupt yaw inputs
// Limit abrupt yaw inputs / stops
if (axis == YAW && pidProfile->pidMaxVelocityYaw) {
float yawCurrentVelocity = setpointRate[axis] - yawPreviousRate;
if (ABS(yawCurrentVelocity) > yawMaxVelocity) {

View file

@ -263,9 +263,7 @@ void processRcCommand(void)
}
if (readyToCalculateRate || isRXDataNew) {
// Don't smooth yaw axis
int axisToCalculate = (isRXDataNew) ? 3 : 2;
for (int axis = 0; axis < axisToCalculate; axis++) setpointRate[axis] = calculateSetpointRate(axis, rcCommand[axis]);
for (int axis = 0; axis < 3; axis++) setpointRate[axis] = calculateSetpointRate(axis, rcCommand[axis]);
isRXDataNew = false;

View file

@ -29,11 +29,6 @@ const uint16_t multiPPM[] = {
PWM1 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM5 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM6 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM8 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM9 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM10 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM11 | (MAP_TO_MOTOR_OUTPUT << 8),
PWM12 | (MAP_TO_MOTOR_OUTPUT << 8),
0xFFFF
};