From 8de5c595c272e8175e890cb153ef1efc810363cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Mon, 22 Mar 2021 16:55:15 +0100 Subject: [PATCH] Bat charger: Debounce recharge from trickle state Reduce the recharge voltage threshold and consider it for transition between trickle and bulk charging such that the trickle state is maintained longer and batteries don't get recharged multiple times per day. This is also necessary for nanogrid interface control, which can try to maintain a voltage between recharge and trickle voltage by exporting excess solar energy towards the grid. If the battery voltage is maintained at the trickle voltage, the solar input power might be reduced and not all available power can be used. --- src/bat_charger.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bat_charger.cpp b/src/bat_charger.cpp index 9824514..c2a8e83 100644 --- a/src/bat_charger.cpp +++ b/src/bat_charger.cpp @@ -53,7 +53,7 @@ void battery_conf_init(BatConf *bat, int type, int num_cells, float nominal_capa case BAT_TYPE_GEL: bat->voltage_absolute_max = static_cast(num_cells) * 2.45F; bat->topping_voltage = static_cast(num_cells) * 2.4F; - bat->voltage_recharge = static_cast(num_cells) * 2.3F; + bat->voltage_recharge = static_cast(num_cells) * 2.2F; // Cell-level thresholds based on EN 62509:2011 (both thresholds current-compensated) bat->voltage_load_disconnect = static_cast(num_cells) * 1.95F; @@ -550,7 +550,9 @@ void Charger::charge_control(BatConf *bat_conf) time_target_voltage_reached = uptime(); } - if (uptime() - time_target_voltage_reached > bat_conf->trickle_recharge_time) + if ((uptime() - time_target_voltage_reached > bat_conf->trickle_recharge_time) && + port->bus->voltage_filtered < port->bus->sink_control_voltage( + bat_conf->voltage_recharge)) { // the battery was discharged: trickle voltage could not be reached anymore port->pos_current_limit = bat_conf->charge_current_max;