Fix load overvoltage limit

The setting is now based on LoadOutput menber overvoltage and not
on the bus voltage bounds, which are used for charging setpoint.
This commit is contained in:
Martin Jaeger
2020-02-19 14:34:40 +01:00
committed by Martin Jäger
parent 68e0336279
commit cdb9183c11
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -141,7 +141,7 @@ void LoadOutput::control()
// long-term overvoltage (overvoltage transients are detected as an ADC alert and switch
// off the solar input instead of the load output)
if (port->bus->voltage > port->bus->sink_voltage_bound ||
if (port->bus->voltage > overvoltage ||
port->bus->voltage > LOW_SIDE_VOLTAGE_MAX)
{
ov_debounce_counter++;
@@ -180,7 +180,7 @@ void LoadOutput::control()
}
if (dev_stat.has_error(ERR_LOAD_OVERVOLTAGE) &&
port->bus->voltage < (port->bus->sink_voltage_bound - ov_hysteresis) &&
port->bus->voltage < (overvoltage - ov_hysteresis) &&
port->bus->voltage < (LOW_SIDE_VOLTAGE_MAX - ov_hysteresis))
{
dev_stat.clear_error(ERR_LOAD_OVERVOLTAGE);