From 21e21f71bd6011f7e0b1ee2b7be0a47288ff0e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bo=CC=88hm?= Date: Sun, 29 Dec 2024 00:43:58 +0100 Subject: [PATCH] Fix: Don't check shading for max increase when inverter limit is below 15% --- src/PowerLimiterSolarInverter.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/PowerLimiterSolarInverter.cpp b/src/PowerLimiterSolarInverter.cpp index 0f1c811b8..4baef515f 100644 --- a/src/PowerLimiterSolarInverter.cpp +++ b/src/PowerLimiterSolarInverter.cpp @@ -27,6 +27,14 @@ uint16_t PowerLimiterSolarInverter::getMaxIncreaseWatts() const return maxTotalIncrease; } + // when the current limit is less than 15% of the max power of the inverter + // the output will not match the limit as the inverters are not able to work + // with those low limits. In this case we assume that the inverter is able to + // provide more power and we return the maximum possible increase. + // thanks spcqike for creating a table that can be found here: + // https://github.com/hoylabs/OpenDTU-OnBattery/issues/1087#issuecomment-2216787552 + if (getCurrentLimitWatts() < getInverterMaxPowerWatts() * 0.15) { return maxTotalIncrease; } + auto pStats = _spInverter->Statistics(); std::vector dcMppts = _spInverter->getMppts(); size_t dcTotalMppts = dcMppts.size(); @@ -37,7 +45,7 @@ uint16_t PowerLimiterSolarInverter::getMaxIncreaseWatts() const auto expectedPowerPercentage = 0.97; // use the scaling threshold as the expected power percentage if lower, - // but only when overscalingis enabled and the inverter does not support PDL + // but only when overscaling is enabled and the inverter does not support PDL if (_config.UseOverscaling && !_spInverter->supportsPowerDistributionLogic()) { expectedPowerPercentage = std::min(expectedPowerPercentage, static_cast(_config.ScalingThreshold) / 100.0); }