Overvoltage alert improved for PWM switching

Previously, the alert was sometimes erroneously triggered in PWM charger
absorption phase (constant voltage, PWM switching). Now the overvoltage
alert is inhibited during turn-on in each PWM cycle by an interrupt.
This commit is contained in:
Martin Jaeger
2019-11-08 13:06:17 +01:00
parent 71fd6519bc
commit c26c17221a
4 changed files with 68 additions and 37 deletions
+6
View File
@@ -337,6 +337,12 @@ void Charger::charge_control(BatConf *bat_conf)
enter_state(CHG_STATE_IDLE);
}
if (dev_stat.has_error(ERR_BAT_OVERVOLTAGE) &&
port->voltage < (bat_conf->voltage_absolute_max - 0.5) * num_batteries)
{
dev_stat.clear_error(ERR_BAT_OVERVOLTAGE);
}
// state machine
switch (state) {
case CHG_STATE_IDLE: {