Skip to content

Commit b9039d0

Browse files
authored
fix(EvseManager): Clear evse_manager/MREC5OverVoltage error on unplug. Previously, the software over voltage monitoring was raising the error but it was never cleared (#1894)
Additionally stopping voltage monitors on unplug or PowerOff Signed-off-by: Piet Gömpel <pietgoempel@gmail.com>
1 parent 3a34627 commit b9039d0

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

modules/EVSE/EvseManager/Charger.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2182,6 +2182,7 @@ void Charger::clear_errors_on_unplug() {
21822182
error_handling->clear_isolation_resistance_fault("Resistance");
21832183
error_handling->clear_isolation_resistance_fault("VoltageToEarth");
21842184
error_handling->clear_cable_check_fault();
2185+
error_handling->clear_over_voltage_error();
21852186
error_handling->clear_voltage_plausibility_fault();
21862187
}
21872188

modules/EVSE/EvseManager/ErrorHandling.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ void ErrorHandling::raise_over_voltage_error(Everest::error::Severity severity,
133133
process_error();
134134
}
135135

136+
void ErrorHandling::clear_over_voltage_error() {
137+
if (p_evse->error_state_monitor->is_error_active("evse_manager/MREC5OverVoltage", "")) {
138+
p_evse->clear_error("evse_manager/MREC5OverVoltage", "");
139+
}
140+
process_error();
141+
}
142+
136143
// Find out if the current error set is fatal to charging or not
137144
void ErrorHandling::process_error() {
138145
const auto fatal = errors_prevent_charging();

modules/EVSE/EvseManager/ErrorHandling.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class ErrorHandling {
8080
void clear_overcurrent_error();
8181

8282
void raise_over_voltage_error(Everest::error::Severity severity, const std::string& description);
83+
void clear_over_voltage_error();
8384

8485
void raise_internal_error(const std::string& description);
8586
void clear_internal_error();

modules/EVSE/EvseManager/EvseManager.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,11 +1161,14 @@ void EvseManager::ready() {
11611161
if (not r_over_voltage_monitor.empty() and event == CPEvent::CarUnplugged) {
11621162
r_over_voltage_monitor[0]->call_reset_over_voltage_error();
11631163
}
1164-
if (internal_over_voltage_monitor and event == CPEvent::CarUnplugged) {
1164+
if (not r_over_voltage_monitor.empty() and (event == CPEvent::CarUnplugged or event == CPEvent::PowerOff)) {
1165+
r_over_voltage_monitor[0]->call_stop();
1166+
}
1167+
if (internal_over_voltage_monitor and (event == CPEvent::CarUnplugged or event == CPEvent::PowerOff)) {
11651168
internal_over_voltage_monitor->stop_monitor();
11661169
internal_over_voltage_monitor->reset();
11671170
}
1168-
if (voltage_plausibility_monitor and event == CPEvent::CarUnplugged) {
1171+
if (voltage_plausibility_monitor and (event == CPEvent::CarUnplugged or event == CPEvent::PowerOff)) {
11691172
voltage_plausibility_monitor->stop_monitor();
11701173
}
11711174

modules/EVSE/EvseManager/tests/ChargerTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,8 @@ void ErrorHandling::clear_overcurrent_error() {
757757

758758
void ErrorHandling::raise_over_voltage_error(Everest::error::Severity severity, const std::string& description) {
759759
}
760+
void ErrorHandling::clear_over_voltage_error() {
761+
}
760762

761763
void ErrorHandling::raise_internal_error(const std::string& description) {
762764
}

modules/EVSE/EvseManager/voltage_plausibility/VoltagePlausibilityMonitor.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@ VoltagePlausibilityMonitor::~VoltagePlausibilityMonitor() {
3333
}
3434

3535
void VoltagePlausibilityMonitor::start_monitor() {
36-
EVLOG_info << "VoltagePlausibilityMonitor, start monitoring";
36+
if (!running_.load()) {
37+
EVLOG_info << "VoltagePlausibilityMonitor, start monitoring";
38+
}
3739
fault_latched_.store(false);
3840
cancel_fault_timer();
3941
running_.store(true);
4042
}
4143

4244
void VoltagePlausibilityMonitor::stop_monitor() {
43-
EVLOG_info << "VoltagePlausibilityMonitor, stop monitoring";
45+
if (running_.load()) {
46+
EVLOG_info << "VoltagePlausibilityMonitor, stop monitoring";
47+
}
4448
running_.store(false);
4549
cancel_fault_timer();
4650
}

0 commit comments

Comments
 (0)