Przeglądaj źródła

强制充满不胖的充了多少容量

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 3 lat temu
rodzic
commit
0b5af4679a
1 zmienionych plików z 14 dodań i 9 usunięć
  1. 14 9
      Application/app/sox/soc.c

+ 14 - 9
Application/app/sox/soc.c

@@ -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) {