1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

Add back ESC jump limit // revert p weight limit

This commit is contained in:
borisbstyle 2016-09-06 22:02:55 +02:00
parent d0ceb1167a
commit 9dd135ec80
4 changed files with 19 additions and 3 deletions

View file

@ -862,6 +862,19 @@ void mixTable(void *pidProfilePtr)
}
}
// Anti Desync feature for ESC's. Limit rapid throttle changes
if (escAndServoConfig->maxEscThrottleJumpMs) {
const int16_t maxThrottleStep = constrain(escAndServoConfig->maxEscThrottleJumpMs / (1000 / targetPidLooptime), 5, 10000);
// Only makes sense when it's within the range
if (maxThrottleStep < throttleRange) {
static int16_t motorPrevious[MAX_SUPPORTED_MOTORS];
motor[i] = constrain(motor[i], motorPrevious[i] - maxThrottleStep, motorPrevious[i] + maxThrottleStep);
motorPrevious[i] = motor[i];
}
}
// Disarmed mode
if (!ARMING_FLAG(ARMED)) {
for (i = 0; i < motorCount; i++) {