Merge pull request #9642 from IllusionFpv/constrain-pidloop-for-bidir

Change pidloop constraint when dshot bidir is enabled
This commit is contained in:
Michael Keller 2020-03-28 13:51:01 +13:00 committed by GitHub
commit f2ef33cbdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {