Skip to content

Commit

Permalink
DPL limit scaling: only for supported models
Browse files Browse the repository at this point in the history
  • Loading branch information
schlimmchen committed Mar 7, 2024
1 parent 64ad4bd commit b0795a2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/PowerLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Huawei_can.h"
#include <VictronMppt.h>
#include "MessageOutput.h"
#include "inverters/HMS_4CH.h"
#include <ctime>
#include <cmath>
#include <frozen/map.h>
Expand Down Expand Up @@ -634,6 +635,14 @@ static int32_t scalePowerLimit(std::shared_ptr<InverterAbstract> inverter, int32
std::list<ChannelNum_t> dcChnls = inverter->Statistics()->getChannelsByType(TYPE_DC);
size_t dcTotalChnls = dcChnls.size();

// according to the upstream projects README (table with supported devs),
// every 2 channel inverter has 2 MPPTs. then there are the HM*S* 4 channel
// models which have 4 MPPTs. all others have a different number of MPPTs
// than inputs. those are not supported by the current scaling mechanism.
bool supported = dcTotalChnls == 2;
supported |= dcTotalChnls == 4 && HMS_4CH::isValidSerial(inverter->serial());
if (!supported) { return newLimit; }

// test for a reasonable power limit that allows us to assume that an input
// channel with little energy is actually not producing, rather than
// producing very little due to the very low limit.
Expand Down

0 comments on commit b0795a2

Please sign in to comment.