From 8a1638e74b1f04d11419ef2dace849921680d49f Mon Sep 17 00:00:00 2001 From: dingo35 Date: Fri, 15 Dec 2023 13:36:37 +0100 Subject: [PATCH] evse.cpp: Disable phase detection when only MainsMeter is connected, since it has proven to be unreliable --- SmartEVSE-3/src/evse.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/SmartEVSE-3/src/evse.cpp b/SmartEVSE-3/src/evse.cpp index fda38f82..26e67062 100644 --- a/SmartEVSE-3/src/evse.cpp +++ b/SmartEVSE-3/src/evse.cpp @@ -774,15 +774,6 @@ void setState(uint8_t NewState) { } Detecting_Charging_Phases_Timer = PHASE_DETECTION_TIME; // we need time for the EV to decide to start charging } - else if (MainsMeter) { // or else MainsMeter will do - OverrideCurrent_save = OverrideCurrent; - OverrideCurrent = MinCurrent * 10; // for detection of phases we are going to lock the charging current to MinCurrent - for (i=0; i<3; i++) { - Old_Irms[i] = Irms[i]; - _LOG_D("Trying to detect Charging Phases START Irms[%i]=%.1f A.\n", i, (float)Irms[i]/10); - } - Detecting_Charging_Phases_Timer = PHASE_DETECTION_TIME; // we need time for the EV to decide to start charging - } } else //we are loadbalancing: for (i=0; i<3; i++) @@ -2837,10 +2828,6 @@ void Timer1S(void * parameter) { Charging_Prob[i] = 10 * (abs(Irms_EV[i] - Old_Irms[i])) / MinCurrent; //100% means this phase is charging, 0% mwans not charging _LOG_D("Trying to detect Charging Phases END Irms_EV[%i]=%.1f A.\n", i, (float)Irms_EV[i]/10); } //TODO only working in Smart Mode //TODO we start charging with ChargeCurrent but in Smart mode this changes to Balanced[0]; how about Solar? generates error 32? - else if (MainsMeter) { - Charging_Prob[i] = 10 * (abs(Irms[i] - Old_Irms[i])) / MinCurrent; //100% means this phase is charging, 0% mwans not charging - _LOG_D("Trying to detect Charging Phases END Irms_[%i]=%.1f A.\n", i, (float)Irms[i]/10); - } else Charging_Prob[i] = 0; Max_Charging_Prob = max(Charging_Prob[i], Max_Charging_Prob);