-
Notifications
You must be signed in to change notification settings - Fork 127
feat(voltage_plausibility_monitor): Voltage plausibility check during DC charging to detect configuration of hardware inconsistencies #1711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Florin Mihut <[email protected]>
Signed-off-by: Florin Mihut <[email protected]>
42840ce to
f550ae1
Compare
Pietfried
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See some comments in line. Please also add tests for the VoltagePlausibilityMonitor. These can be similar to e.g. https://github.com/EVerest/everest-core/blob/main/modules/EVSE/EvseManager/tests/OverVoltageMonitorTest.cpp
| {"evse_manager/MREC22ResistanceFault", "CX022"}, | ||
| {"evse_manager/MREC11CableCheckFault", "CX011"}, | ||
| {"evse_manager/MREC5OverVoltage", "CX005"}, | ||
| {"evse_manager/VoltagePlausibilityFault", ""}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this doesn't map to any MREC it is not required here
| {"evse_manager/MREC22ResistanceFault", {ocpp::v16::ChargePointErrorCode::OtherError, "CX022"}}, | ||
| {"evse_manager/MREC11CableCheckFault", {ocpp::v16::ChargePointErrorCode::OtherError, "CX011"}}, | ||
| {"evse_manager/MREC5OverVoltage", {ocpp::v16::ChargePointErrorCode::OverVoltage, "CX005"}}, | ||
| {"evse_manager/VoltagePlausibilityFault", {ocpp::v16::ChargePointErrorCode::OtherError, ""}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| } | ||
|
|
||
| void VoltagePlausibilityMonitor::evaluate_voltages() { | ||
| // Check running state and fault latch (these are only modified from main thread, so no mutex needed here) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me it looks like this is not correct, because trigger_fault is called from the timer thread. You can either make running_ and fault_latched_ atomic or protect them using the data_mutex_
Describe your changes
Adds a voltage plausibility check during DC charging to detect inconsistencies between voltage measurements from multiple sources.
Monitors voltage from 4 sources:
Calculates standard deviation between available sources and compares it to a configurable threshold.
Raises a fault if the standard deviation value exceeds the threshold for a configurable duration, trying to prevent false positives from brief spikes.
Handles missing or stale data:
Configuration:
voltage_plausibility_std_deviation_threshold_V: Maximum allowed standard deviation (default: 50.0 V)
voltage_plausibility_fault_duration_ms: Duration SD must exceed threshold before fault (default: 10000 ms)
voltage_plausibility_measurement_max_age_ms: Maximum age of measurements before considered stale (default: 3000 ms)
Implementation
New VoltagePlausibilityMonitor class following the same pattern as OverVoltageMonitor
New error type: evse_manager/VoltagePlausibilityFault (High severity)
This helps detect configuration or hardware issues by comparing voltage readings from independent sources.
Issue ticket number and link
Checklist before requesting a review