Skip to content

Commit

Permalink
Fix: maxIncrease for solar inverter with PDL
Browse files Browse the repository at this point in the history
Use inverter maxPower instead of configuredMaxPower for solar inverters with PDL to calculate the maxIncrease, because the limit will be distributed across MPPTs that can provide power by the inverter and not equally divided.
  • Loading branch information
AndreasBoehm committed Jan 10, 2025
1 parent 0ad1626 commit 0712cc5
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/PowerLimiterSolarInverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ uint16_t PowerLimiterSolarInverter::getMaxIncreaseWatts() const
{
if (isEligible() != Eligibility::Eligible) { return 0; }

// the maximum increase possible for this inverter
int16_t maxTotalIncrease = getConfiguredMaxPowerWatts() - getCurrentOutputAcWatts();

if (!isProducing()) {
// the inverter is not producing, we don't know how much we can increase
// the power, so we return the maximum possible increase
return maxTotalIncrease;
return getConfiguredMaxPowerWatts();
}

// the maximum increase possible for this inverter
int16_t maxTotalIncrease = getConfiguredMaxPowerWatts() - getCurrentOutputAcWatts();

// 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
Expand Down Expand Up @@ -82,14 +82,23 @@ uint16_t PowerLimiterSolarInverter::getMaxIncreaseWatts() const
return maxTotalIncrease;
}

int16_t maxPowerPerMppt = getConfiguredMaxPowerWatts() / dcTotalMppts;
// for inverter with PDL we use the max power of the inverter because each MPPT can deliver its max power,
// for inverters without PDL we use the configured max power, because the limit will be divided equally across the MPPTs by the inverter.
int16_t inverterMaxPower = _spInverter->supportsPowerDistributionLogic() ? getInverterMaxPowerWatts() : getConfiguredMaxPowerWatts();

int16_t maxPowerPerMppt = inverterMaxPower / dcTotalMppts;

int16_t currentPowerPerNonShadedMppt = nonShadedMpptACPowerSum / dcNonShadedMppts;

int16_t maxIncreasePerNonShadedMppt = maxPowerPerMppt - currentPowerPerNonShadedMppt;

// maximum increase based on the non-shaded mppts
return maxIncreasePerNonShadedMppt * dcNonShadedMppts;
// maximum increase based on the non-shaded mppts, can be higher than maxTotalIncrease for inverters
// with PDL when getConfiguredMaxPowerWatts() is less than getInverterMaxPowerWatts() divided by
// the number of used/unshaded MPPTs.
int16_t maxIncreaseNonShadedMppts = maxIncreasePerNonShadedMppt * dcNonShadedMppts;

// maximum increase should not exceed the max total increase
return std::min(maxTotalIncrease, maxIncreaseNonShadedMppts);
}

uint16_t PowerLimiterSolarInverter::applyReduction(uint16_t reduction, bool)
Expand Down

0 comments on commit 0712cc5

Please sign in to comment.