Skip to content

Commit

Permalink
Feature: support configuration of the input power threshold for overs…
Browse files Browse the repository at this point in the history
…caling per inverter
  • Loading branch information
AndreasBoehm authored and schlimmchen committed Dec 23, 2024
1 parent caed543 commit 36fc00a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ struct POWERLIMITER_INVERTER_CONFIG_T {
bool UseOverscaling;
uint16_t LowerPowerLimit;
uint16_t UpperPowerLimit;
uint8_t ScalingThreshold;
};
using PowerLimiterInverterConfig = struct POWERLIMITER_INVERTER_CONFIG_T;

Expand Down
1 change: 1 addition & 0 deletions include/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
#define POWERLIMITER_LOWER_POWER_LIMIT 10
#define POWERLIMITER_BASE_LOAD_LIMIT 100
#define POWERLIMITER_UPPER_POWER_LIMIT 800
#define POWERLIMITER_SCALING_THRESHOLD 98
#define POWERLIMITER_IGNORE_SOC true
#define POWERLIMITER_BATTERY_SOC_START_THRESHOLD 80
#define POWERLIMITER_BATTERY_SOC_STOP_THRESHOLD 20
Expand Down
2 changes: 2 additions & 0 deletions src/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void ConfigurationClass::serializePowerLimiterConfig(PowerLimiterConfig const& s
t["use_overscaling_to_compensate_shading"] = s.UseOverscaling;
t["lower_power_limit"] = s.LowerPowerLimit;
t["upper_power_limit"] = s.UpperPowerLimit;
t["scaling_threshold"] = s.ScalingThreshold;
}
}

Expand Down Expand Up @@ -472,6 +473,7 @@ void ConfigurationClass::deserializePowerLimiterConfig(JsonObject const& source,
inv.UseOverscaling = s["use_overscaling_to_compensate_shading"] | POWERLIMITER_USE_OVERSCALING;
inv.LowerPowerLimit = s["lower_power_limit"] | POWERLIMITER_LOWER_POWER_LIMIT;
inv.UpperPowerLimit = s["upper_power_limit"] | POWERLIMITER_UPPER_POWER_LIMIT;
inv.ScalingThreshold = s["scaling_threshold"] | POWERLIMITER_SCALING_THRESHOLD;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/PowerLimiterSolarInverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ uint16_t PowerLimiterSolarInverter::scaleLimit(uint16_t expectedOutputWatts)
// is currently not producing (efficiency is zero in that case)
inverterEfficiencyFactor = (inverterEfficiencyFactor > 0) ? inverterEfficiencyFactor/100 : 0.967;

// 98% of the expected power is good enough
auto expectedAcPowerPerMppt = (getCurrentLimitWatts() / dcTotalMppts) * 0.98;
auto scalingThreshold = static_cast<float>(_config.ScalingThreshold) / 100.0;
auto expectedAcPowerPerMppt = (getCurrentLimitWatts() / dcTotalMppts) * scalingThreshold;

if (_verboseLogging) {
MessageOutput.printf("%s expected AC power per MPPT %.0f W\r\n",
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@
"VoltageLoadCorrectionFactor": "Lastkorrekturfaktor",
"BatterySocInfo": "<b>Hinweis:</b> Die Batterie State of Charge (SoC) Schwellwerte werden bevorzugt herangezogen. Sie werden allerdings nur benutzt, wenn die Batterie-Kommunikationsschnittstelle innerhalb der letzten Minute gültige Werte verarbeitet hat. Andernfalls werden ersatzweise die Spannungs-Schwellwerte verwendet.",
"InverterIsBehindPowerMeter": "Stromzählermessung beinhaltet Wechselrichter",
"ScalingPowerThreshold": "Schwellenwert für Überskalierung",
"ScalingPowerThresholdHint": "Minimale Eingangsleistungsschwelle (%). Eingänge unterhalb dieses Prozentsatzes werden als verschattet/ungenutzt bewertet.",
"InverterIsBehindPowerMeterHint": "Aktivieren falls sich der Stromzähler-Messwert um die Ausgangsleistung des Wechselrichters verringert, wenn dieser Strom produziert. Normalerweise ist das zutreffend.",
"InverterIsSolarPowered": "Wechselrichter wird von Solarmodulen gespeist",
"UseOverscaling": "Verschattetet/Ungenutzte Eingänge ausgleichen",
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@
"VoltageLoadCorrectionFactor": "Load correction factor",
"BatterySocInfo": "<b>Hint:</b> The use of battery State of Charge (SoC) thresholds is prioritized. However, SoC thresholds are only used if the battery communication interface has processed valid SoC values in the last minute. Otherwise, the voltage thresholds will be used as fallback.",
"InverterIsBehindPowerMeter": "PowerMeter reading includes inverter output",
"ScalingPowerThreshold": "Overscaling input power threshold",
"ScalingPowerThresholdHint": "Set the minimum power input threshold (%). Inputs below this percentage are considered shaded/unused.",
"InverterIsBehindPowerMeterHint": "Enable this option if the power meter reading is reduced by the inverter's output when it produces power. This is typically true.",
"InverterIsSolarPowered": "Inverter is powered by solar modules",
"UseOverscaling": "Compensate shaded or unused inputs",
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,8 @@
"VoltageLoadCorrectionFactor": "Load correction factor",
"BatterySocInfo": "<b>Hint:</b> The use of battery State of Charge (SoC) thresholds is prioritized. However, SoC thresholds are only used if the battery communication interface has processed valid SoC values in the last minute. Otherwise, the voltage thresholds will be used as fallback.",
"InverterIsBehindPowerMeter": "PowerMeter reading includes inverter output",
"ScalingPowerThreshold": "Overscaling input power threshold",
"ScalingPowerThresholdHint": "Set the minimum power input threshold (%). Inputs below this percentage are considered shaded/unused.",
"InverterIsBehindPowerMeterHint": "Enable this option if the power meter reading is reduced by the inverter's output when it produces power. This is typically true.",
"InverterIsSolarPowered": "Inverter is powered by solar modules",
"UseOverscaling": "Compensate shaded or unused inputs",
Expand Down
1 change: 1 addition & 0 deletions webapp/src/types/PowerLimiterConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface PowerLimiterInverterConfig {
use_overscaling_to_compensate_shading: boolean;
lower_power_limit: number;
upper_power_limit: number;
scaling_threshold: number;
}

export interface PowerLimiterConfig {
Expand Down
12 changes: 12 additions & 0 deletions webapp/src/views/PowerLimiterAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@
wide
/>

<InputElement
v-if="powerLimiterConfigList.inverters[idx].use_overscaling_to_compensate_shading"
:label="$t('powerlimiteradmin.ScalingPowerThreshold')"
v-model="powerLimiterConfigList.inverters[idx].scaling_threshold"
:tooltip="$t('powerlimiteradmin.ScalingPowerThresholdHint')"
:min="(0).toString()"
:max="(100).toString()"
postfix="%"
type="number"
wide
/>

<InputElement
:label="$t('powerlimiteradmin.LowerPowerLimit')"
:tooltip="$t('powerlimiteradmin.LowerPowerLimitHint')"
Expand Down

0 comments on commit 36fc00a

Please sign in to comment.