SoC based threshold detection fix (#320)
This commit is contained in:
parent
8b01fa07cc
commit
18c464e524
@ -587,9 +587,8 @@ bool PowerLimiterClass::isStartThresholdReached(std::shared_ptr<InverterAbstract
|
|||||||
// Check if the Battery interface is enabled and the SOC start threshold is reached
|
// Check if the Battery interface is enabled and the SOC start threshold is reached
|
||||||
if (config.Battery_Enabled
|
if (config.Battery_Enabled
|
||||||
&& config.PowerLimiter_BatterySocStartThreshold > 0.0
|
&& config.PowerLimiter_BatterySocStartThreshold > 0.0
|
||||||
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000
|
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000) {
|
||||||
&& Battery.stateOfCharge >= config.PowerLimiter_BatterySocStartThreshold) {
|
return Battery.stateOfCharge >= config.PowerLimiter_BatterySocStartThreshold;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise we use the voltage threshold
|
// Otherwise we use the voltage threshold
|
||||||
@ -608,9 +607,8 @@ bool PowerLimiterClass::isStopThresholdReached(std::shared_ptr<InverterAbstract>
|
|||||||
// Check if the Battery interface is enabled and the SOC stop threshold is reached
|
// Check if the Battery interface is enabled and the SOC stop threshold is reached
|
||||||
if (config.Battery_Enabled
|
if (config.Battery_Enabled
|
||||||
&& config.PowerLimiter_BatterySocStopThreshold > 0.0
|
&& config.PowerLimiter_BatterySocStopThreshold > 0.0
|
||||||
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000
|
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000) {
|
||||||
&& Battery.stateOfCharge <= config.PowerLimiter_BatterySocStopThreshold) {
|
return Battery.stateOfCharge <= config.PowerLimiter_BatterySocStopThreshold;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise we use the voltage threshold
|
// Otherwise we use the voltage threshold
|
||||||
@ -674,9 +672,8 @@ bool PowerLimiterClass::useFullSolarPassthrough(std::shared_ptr<InverterAbstract
|
|||||||
// Check if the Battery interface is enabled and the SOC stop threshold is reached
|
// Check if the Battery interface is enabled and the SOC stop threshold is reached
|
||||||
if (config.Battery_Enabled
|
if (config.Battery_Enabled
|
||||||
&& config.PowerLimiter_FullSolarPassThroughSoc > 0.0
|
&& config.PowerLimiter_FullSolarPassThroughSoc > 0.0
|
||||||
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000
|
&& (millis() - Battery.stateOfChargeLastUpdate) < 60000) {
|
||||||
&& Battery.stateOfCharge >= config.PowerLimiter_FullSolarPassThroughSoc) {
|
return Battery.stateOfCharge >= config.PowerLimiter_FullSolarPassThroughSoc;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise we use the voltage threshold
|
// Otherwise we use the voltage threshold
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user