Skip to content

Commit

Permalink
Fix: Don't check shading for max increase when inverter limit is belo…
Browse files Browse the repository at this point in the history
…w 15%
  • Loading branch information
AndreasBoehm committed Dec 28, 2024
1 parent ca9fcf8 commit 21e21f7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/PowerLimiterSolarInverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<MpptNum_t> dcMppts = _spInverter->getMppts();
size_t dcTotalMppts = dcMppts.size();
Expand All @@ -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<float>(_config.ScalingThreshold) / 100.0);
}
Expand Down

0 comments on commit 21e21f7

Please sign in to comment.