Skip to content

Commit

Permalink
main.cpp: stop charging when Capacity limit is reached and timer is n…
Browse files Browse the repository at this point in the history
…ot set
  • Loading branch information
dingo35 committed Dec 27, 2024
1 parent 7ee5375 commit b235c16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SmartEVSE-3/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,8 @@ void CalcBalancedCurrent(char mod) {
}

// check for HARD shortage of power
// with HARD shortage we stop charging
// with SOFT shortage we have a timer running
// IsetBalanced is already set to the minimum needed power to charge all Nodes
bool hardShortage = false;
// guard MaxMains
Expand All @@ -1294,6 +1296,8 @@ void CalcBalancedCurrent(char mod) {
if (((LoadBl == 0 && EVMeter.Type && Mode != MODE_NORMAL) || LoadBl == 1) // Conditions in which MaxCircuit has to be considered
&& (IsetBalanced > (MaxCircuit * 10) - Baseload_EV))
hardShortage = true;
if (!MaxSumMainsTime && LimitedByMaxSumMains) // if we don't use the Capacity timer, we want a hard stop
hardShortage = true;
if (hardShortage && Switching_To_Single_Phase != GOING_TO_SWITCH) { // because switching to single phase might solve the shortage
// ############ HARD shortage of power
NoCurrent++; // Flag NoCurrent left
Expand Down

0 comments on commit b235c16

Please sign in to comment.