Charger.num_batteries moved to DcBus.series_multiplier

The reason is that the voltage disconnect thresholds used in the load outputs
need to be multiplied with number of batteries aswell. As the DcBus class
should contain all voltage-relevant information, it is the right place for the
multiplier.
This commit is contained in:
Martin Jäger
2020-03-01 09:48:35 +01:00
parent 651f66616b
commit 1a9c290485
9 changed files with 72 additions and 62 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ void LoadOutput::control()
flags_set(&error_flags, ERR_LOAD_BUS_SRC_CURRENT);
}
if (bus->voltage < bus->src_droop_voltage(disconnect_voltage)) {
if (bus->voltage < bus->src_control_voltage(disconnect_voltage)) {
flags_set(&error_flags, ERR_LOAD_SHEDDING);
lvd_timestamp = uptime();
}
@@ -86,7 +86,7 @@ void LoadOutput::control()
// load is off: check if errors are resolved and if load can be switched on
if (flags_check(&error_flags, ERR_LOAD_SHEDDING) &&
bus->voltage > bus->src_droop_voltage(reconnect_voltage) &&
bus->voltage > bus->src_control_voltage(reconnect_voltage) &&
uptime() - lvd_timestamp > lvd_recovery_delay)
{
flags_clear(&error_flags, ERR_LOAD_SHEDDING);