|
|
@@ -321,6 +321,10 @@ static int _soc_is_under_voltage(void) {
|
|
|
bms_health()->discharger_lower_voltage);
|
|
|
}
|
|
|
|
|
|
+static int _is_normal_charging(void) {
|
|
|
+ return (_soc.charger_coulomb >= (0.1f * 3600.0f));
|
|
|
+}
|
|
|
+
|
|
|
static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
static int ocv_full_count = 0;
|
|
|
//static int ocv_force_capaticy = 0;
|
|
|
@@ -353,12 +357,12 @@ static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
}
|
|
|
if (chargering || prev_charge_status) {
|
|
|
if (chargering && (_soc.capacity != 100)) {
|
|
|
- if (bms_health()->sigle_cell_over_voltage && (_soc.charger_coulomb >= (0.1f * 3600.0f))) { //单电芯过压强制充满
|
|
|
+ if (bms_health()->sigle_cell_over_voltage && _is_normal_charging()) { //单电芯过压强制充满
|
|
|
_force_capacity_full();
|
|
|
push_event(Charger_Full, bms_state_get()->pack_voltage);
|
|
|
ocv_full_count = 0;
|
|
|
changed = 1;
|
|
|
- }else if (bms_state_get()->pack_voltage >= (FULL_MAX_VOLTAGE_CHARGING) && (measure_value()->load_current <= FULL_MIN_CURRENT)){
|
|
|
+ }else if (bms_state_get()->pack_voltage >= (FULL_MAX_VOLTAGE_CHARGING) && _is_normal_charging()){
|
|
|
if (ocv_full_count++ >= 100) { //连续100次(小电流采集30ms一次,就是3s时间)电压和电流满足条件,强制充满
|
|
|
_force_capacity_full();
|
|
|
push_event(Charger_Full, 4);
|
|
|
@@ -369,7 +373,7 @@ static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
ocv_full_count = 0;
|
|
|
}
|
|
|
} else if (!chargering && prev_charge_status && (_soc.capacity != 100)){
|
|
|
- if ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE) && (_soc.charger_coulomb >= (0.1f * 3600.0f))){//充电容量几乎接近最大容量
|
|
|
+ if ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_CHARGING) && _is_normal_charging()){//充电容量几乎接近最大容量
|
|
|
_force_capacity_full();
|
|
|
push_event(Charger_Full, 5);
|
|
|
changed = 1;
|
|
|
@@ -397,7 +401,7 @@ static void soc_calibrate(uint8_t prev_charge_status){
|
|
|
push_event(Charger_Full, 13);
|
|
|
}
|
|
|
}else {
|
|
|
- if ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_CHARGING) && (_soc.charger_coulomb >= (0.1f * 3600.0f))){
|
|
|
+ if ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_CHARGING) && _is_normal_charging()){
|
|
|
_force_capacity_full();
|
|
|
push_event(Charger_Full, 10);
|
|
|
}else if (bms_health()->sigle_cell_over_voltage) {
|