Skip to content

Commit

Permalink
Disable debug mode, increasing power threshold for active channel det…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
MalteSchm committed Jul 9, 2023
1 parent 344498d commit 6533dd4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/PowerLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

PowerLimiterClass PowerLimiter;

#define POWER_LIMITER_DEBUG
//#define POWER_LIMITER_DEBUG

void PowerLimiterClass::init() { }

Expand Down Expand Up @@ -495,13 +495,15 @@ bool PowerLimiterClass::setNewPowerLimit(std::shared_ptr<InverterAbstract> inver
std::list<ChannelNum_t> dcChnls = inverter->Statistics()->getChannelsByType(TYPE_DC);
int dcProdChnls = 0, dcTotalChnls = dcChnls.size();
for (auto& c : dcChnls) {
if (inverter->Statistics()->getChannelFieldValue(TYPE_DC, c, FLD_PDC) > 1.0) {
if (inverter->Statistics()->getChannelFieldValue(TYPE_DC, c, FLD_PDC) > 2.0) {
dcProdChnls++;
}
}
if (dcProdChnls > 0) {
MessageOutput.printf("[PowerLimiterClass::setNewPowerLimit] %d channels total, %d producing channels, scaling power limit\r\n",
dcTotalChnls, dcProdChnls);
if (dcProdChnls != dcTotalChnls) {
MessageOutput.printf("[PowerLimiterClass::setNewPowerLimit] %d channels total, %d producing channels, scaling power limit\r\n",
dcTotalChnls, dcProdChnls);
}
effPowerLimit = round(effPowerLimit * static_cast<float>(dcTotalChnls) / dcProdChnls);
if (effPowerLimit > inverter->DevInfo()->getMaxPower()) {
effPowerLimit = inverter->DevInfo()->getMaxPower();
Expand Down

0 comments on commit 6533dd4

Please sign in to comment.