Change vbat calc notation

This commit is contained in:
borisbstyle 2016-02-15 00:13:30 +01:00 committed by mikeller
parent d159b46a71
commit 588b7641d6
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ float calculateVbatPidCompensation(void) {
float batteryScaler = 1.0f;
if (batteryConfig->vbatPidCompensation && feature(FEATURE_VBAT) && batteryCellCount > 1) {
// Up to 25% PID gain. Should be fine for 4,2to 3,3 difference
batteryScaler = constrainf((1.0f / ((float) vbat)) * ((float)batteryConfig->vbatmaxcellvoltage * batteryCellCount), 1.0f, 1.25f);
batteryScaler = constrainf((( (float)batteryConfig->vbatmaxcellvoltage * batteryCellCount ) / (float) vbat), 1.0f, 1.25f);
}
return batteryScaler;