@@ -24,25 +24,30 @@ uint16_t PowerLimiterSolarInverter::getMaxIncreaseWatts() const
24
24
return getConfiguredMaxPowerWatts ();
25
25
}
26
26
27
+ // if the inverter is producing only 20W less than the limit, we can increase the power
28
+ if (getCurrentOutputAcWatts () >= getCurrentLimitWatts () - 20 ) {
29
+ return getConfiguredMaxPowerWatts () - getCurrentLimitWatts ();
30
+ }
31
+
32
+ // if we reached this point and can't use overscaling, we can't increase the power
33
+ if (!_config.UseOverscaling || _spInverter->supportsPowerDistributionLogic ()) {
34
+ return 0 ;
35
+ }
36
+
37
+ // TODO(andreasboehm): disallow overscaling until the above solution is verified
38
+ return 0 ;
39
+
27
40
// the maximum increase possible for this inverter
28
41
int16_t maxTotalIncrease = getConfiguredMaxPowerWatts () - getCurrentOutputAcWatts ();
29
42
43
+ auto expectedPowerPercentage = static_cast <float >(_config.ScalingThreshold ) / 100.0 ;
44
+
30
45
auto pStats = _spInverter->Statistics ();
31
46
std::vector<MpptNum_t> dcMppts = _spInverter->getMppts ();
32
47
size_t dcTotalMppts = dcMppts.size ();
33
48
34
49
float inverterEfficiencyFactor = pStats->getChannelFieldValue (TYPE_INV, CH0, FLD_EFF) / 100 ;
35
50
36
- // with 97% we are a bit less strict than when we scale the limit
37
- auto expectedPowerPercentage = 0.97 ;
38
-
39
- // use the scaling threshold as the expected power percentage if lower,
40
- // but only when overscaling is enabled and the inverter does not support PDL
41
- if (_config.UseOverscaling && !_spInverter->supportsPowerDistributionLogic ()) {
42
- expectedPowerPercentage = std::min (expectedPowerPercentage, static_cast <float >(_config.ScalingThreshold ) / 100.0 );
43
- }
44
-
45
- // x% of the expected power is good enough
46
51
auto expectedAcPowerPerMppt = (getCurrentLimitWatts () / dcTotalMppts) * expectedPowerPercentage;
47
52
48
53
size_t dcNonShadedMppts = 0 ;
@@ -72,23 +77,16 @@ uint16_t PowerLimiterSolarInverter::getMaxIncreaseWatts() const
72
77
return maxTotalIncrease;
73
78
}
74
79
75
- // for inverters without PDL we use the configured max power, because the limit will be divided equally across the MPPTs by the inverter.
76
- int16_t inverterMaxPower = getConfiguredMaxPowerWatts ();
77
-
78
- // for inverter with PDL or when overscaling is enabled we use the max power of the inverter because each MPPT can deliver its max power.
79
- if (_spInverter->supportsPowerDistributionLogic () || _config.UseOverscaling ) {
80
- inverterMaxPower = getInverterMaxPowerWatts ();
81
- }
80
+ // we use the inverter's max power, because each MPPT can deliver its max power individually
81
+ int16_t inverterMaxPower = getInverterMaxPowerWatts ();
82
82
83
83
int16_t maxPowerPerMppt = inverterMaxPower / dcTotalMppts;
84
84
85
85
int16_t currentPowerPerNonShadedMppt = nonShadedMpptACPowerSum / dcNonShadedMppts;
86
86
87
87
int16_t maxIncreasePerNonShadedMppt = maxPowerPerMppt - currentPowerPerNonShadedMppt;
88
88
89
- // maximum increase based on the non-shaded mppts, can be higher than maxTotalIncrease for inverters
90
- // with PDL when getConfiguredMaxPowerWatts() is less than getInverterMaxPowerWatts() divided by
91
- // the number of used/unshaded MPPTs.
89
+ // maximum increase based on the non-shaded mppts
92
90
int16_t maxIncreaseNonShadedMppts = maxIncreasePerNonShadedMppt * dcNonShadedMppts;
93
91
94
92
// maximum increase should not exceed the max total increase
0 commit comments