|
|
@@ -378,27 +378,32 @@ static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
return 1;
|
|
|
}
|
|
|
}
|
|
|
- if (chargering || prev_charge_status) {
|
|
|
- if (chargering && (_soc.capacity != 100)) {
|
|
|
- if (bms_health()->sigle_cell_over_voltage && _is_normal_charging()) { //单电芯过压强制充满
|
|
|
+ if ((chargering || prev_charge_status) && (_soc.capacity != 100)) {
|
|
|
+ if (chargering) {
|
|
|
+ if (bms_health()->sigle_cell_over_voltage) { //单电芯过压强制充满
|
|
|
_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) && _is_normal_charging()){
|
|
|
- if (ocv_full_count++ >= 100) { //连续100次(电流采集25(小于4A)或者5ms一次)电压和电流满足条件,强制充满
|
|
|
+ }else if (bms_state_get()->pack_voltage >= (FULL_MAX_VOLTAGE_CHARGING)){
|
|
|
+ if (ocv_full_count++ >= CELLS_NUM) { //连续100次(电流采集25(小于4A)或者5ms一次)电压和电流满足条件,强制充满
|
|
|
_force_capacity_full();
|
|
|
- push_event(Charger_Full, 4);
|
|
|
+ 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) {
|
|
|
+ _force_capacity_full();
|
|
|
+ push_event(Charger_Full, bms_state_get()->pack_voltage);
|
|
|
+ ocv_full_count = 0;
|
|
|
+ changed = 1;
|
|
|
}else {
|
|
|
ocv_full_count = 0;
|
|
|
}
|
|
|
- } else if (!chargering && prev_charge_status && (_soc.capacity != 100)){
|
|
|
+ } else if (prev_charge_status){
|
|
|
if ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_STOP_CHARGING) && _is_normal_charging()){//充电容量几乎接近最大容量
|
|
|
_force_capacity_full();
|
|
|
- push_event(Charger_Full, 5);
|
|
|
+ push_event(Charger_Full, 1);
|
|
|
changed = 1;
|
|
|
}
|
|
|
}
|
|
|
@@ -424,7 +429,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) && _is_normal_charging()){
|
|
|
+ if ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_CHARGING)){
|
|
|
_force_capacity_full();
|
|
|
push_event(Charger_Full, 10);
|
|
|
}else if (bms_health()->sigle_cell_over_voltage) {
|