Apply proper calculation to Vbat PID scaler

This commit is contained in:
borisbstyle 2016-02-06 22:23:22 +01:00
parent 3b84cddc3d
commit cec838090d
1 changed files with 1 additions and 1 deletions

View File

@ -208,7 +208,7 @@ void updateCurrentMeter(int32_t lastUpdateAt, rxConfig_t *rxConfig, uint16_t dea
float calculateVbatPidCompensation(void) {
float batteryScaler = 1.0f;
if (batteryConfig->vbatPidCompensation && feature(FEATURE_VBAT) && batteryCellCount > 1) {
batteryScaler = 0.2f + constrainf(batteryWarningVoltage / vbat, 0.80f, 1.0f); // Up to 20% increment. Should be fine for 3,3 to 4,2 difference
batteryScaler = 1.0f + constrainf(1.0f - (batteryWarningVoltage / vbat), 0.75f, 1.0f); // Up to 25% increment. Should be fine for 3,3 to 4,2 difference
}
return batteryScaler;