change pidloop constraint when dshot bidir is enabled

This commit is contained in:
Nicola De Pasquale 2020-03-26 17:17:22 +01:00
parent 5b374c6fe0
commit aa9e8bdbde
1 changed files with 3 additions and 0 deletions

View File

@ -657,6 +657,9 @@ void validateAndFixGyroConfig(void)
}
} else {
const float pidLooptime = samplingTime * pidConfig()->pid_process_denom;
if (motorConfig()->dev.useDshotTelemetry) {
motorUpdateRestriction *= 2;
}
if (pidLooptime < motorUpdateRestriction) {
uint8_t minPidProcessDenom = motorUpdateRestriction / samplingTime;
if (motorUpdateRestriction / samplingTime > minPidProcessDenom) {