mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Anti Desync feature for ESC's // Experimental
This commit is contained in:
parent
935ad7f613
commit
fb7cfffdeb
4 changed files with 13 additions and 1 deletions
|
@ -854,6 +854,15 @@ void mixTable(void)
|
|||
motor[i] = escAndServoConfig->mincommand;
|
||||
}
|
||||
}
|
||||
|
||||
// Experimental Code. Anti Desync feature for ESC's
|
||||
if (escAndServoConfig->escDesyncProtection) {
|
||||
const int16_t maxThrottleStep = escAndServoConfig->escDesyncProtection / (1000 / targetPidLooptime);
|
||||
static int16_t motorPrevious[MAX_SUPPORTED_MOTORS];
|
||||
|
||||
motor[i] = constrain(motor[i], motorPrevious[i] - maxThrottleStep, motorPrevious[i] + maxThrottleStep);
|
||||
motorPrevious[i] = motor[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Disarmed mode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue