Skip to content

Commit

Permalink
Delay with minimum current when start solar charging
Browse files Browse the repository at this point in the history
  • Loading branch information
bobosch committed Jul 17, 2022
1 parent 00f9d62 commit 0890c68
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions SmartEVSE2.X/EVSE.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,24 +976,31 @@ void CalcBalancedCurrent(char mod) {
IsumImport = Isum;
#endif

// Automatic StartCurrent detection
MeasurementActive = false;
if (StartCurrent == 0) {
for (n = 0; n < NR_EVSES; n++) {
if(BalancedState[n] == STATE_C && !Node[n].MinCurrent) {
for (n = 0; n < NR_EVSES; n++) {
if (BalancedState[n] == STATE_C) {
// Automatic StartCurrent detection
if (!Node[n].MinCurrent) {
MeasurementActive = true;
if(Node[n].IntTimer >= STARTCURRENT_AUTO_TIMER && SolarChargeTimer >= STARTCURRENT_DECREASE_TIME) {
if (Node[n].IntTimer >= STARTCURRENT_AUTO_TIMER && SolarChargeTimer >= STARTCURRENT_DECREASE_TIME) {
if (Node[n].EVMeter) {
// Request EV current measurement
EVMeasureNode = n;
} else if(!CMMeasureTimer) {
} else if (!CMMeasureTimer) {
// Up to 3 cycles Mains current measurement
CMMeasureNode = n;
CMMeasureTimer = (STARTCURRENT_INCREASE_TIME + STARTCURRENT_DECREASE_TIME) * 3 + STARTCURRENT_DECREASE_TIME + 1;
}
}
if (Node[n].EVMeter || CMMeasured) {
}
// Start with MIN current when measurement active or when start Solar charging
if (MeasurementActive || Node[n].IntTimer < STARTCURRENT_AUTO_TIMER) {
// When EV EM is available, 8 A measured or no measurement active
if (Node[n].EVMeter || CMMeasured || !MeasurementActive) {
// charge with 6 A
Balanced[n] = MinCurrent * 10;
} else {
// else charge with 8 A
Balanced[n] = (MinCurrent + 2) * 10;
}
CurrentSet[n] = true; // mark this EVSE as set.
Expand Down

0 comments on commit 0890c68

Please sign in to comment.