Skip to content

Conversation

@florinmihut
Copy link
Contributor

@florinmihut florinmihut commented Jan 13, 2026

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:

  • Power Supply (always available)
  • Powermeter (optional)
  • Isolation Monitor (optional)
  • Over Voltage Monitor (optional)
    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:

  • Requires at least 2 valid sources to compute standard deviation
  • Excludes measurements older than a configurable max age

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

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

Signed-off-by: Florin Mihut <[email protected]>
Signed-off-by: Florin Mihut <[email protected]>
@florinmihut florinmihut force-pushed the feat/voltage_plausibility_monitor branch from 42840ce to f550ae1 Compare January 13, 2026 14:46
Copy link
Contributor

@Pietfried Pietfried left a 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", ""},
Copy link
Contributor

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, ""}},
Copy link
Contributor

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)
Copy link
Contributor

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_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants