1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

correct drift

This commit is contained in:
Thorsten Laux 2018-05-29 16:29:48 +02:00
parent 8fe07af613
commit bb71b6ec64

View file

@ -783,7 +783,7 @@ void FAST_CODE pidController(const pidProfile_t *pidProfile, const rollAndPitchT
const float gmax = MAX(gyroTargetHigh, gyroTargetLow); const float gmax = MAX(gyroTargetHigh, gyroTargetLow);
const float gmin = MIN(gyroTargetHigh, gyroTargetLow); const float gmin = MIN(gyroTargetHigh, gyroTargetLow);
if (gyroRate >= gmin && gyroRate <= gmax) { if (gyroRate >= gmin && gyroRate <= gmax) {
itermErrorRate = 0.0f; itermErrorRate = acCorrection;
} else { } else {
itermErrorRate = (gyroRate > gmax ? gmax : gmin ) - gyroRate; itermErrorRate = (gyroRate > gmax ? gmax : gmin ) - gyroRate;
} }