Просмотр исходного кода

shutdown power 也需要更新最小容量

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 5 лет назад
Родитель
Сommit
bf1ce3e579
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      Application/app/sox/soc.c

+ 5 - 2
Application/app/sox/soc.c

@@ -108,7 +108,7 @@ void soc_log(void){
 	soc_debug("C pre dischar: %.4f\n", TOHA(_soc.pre_charger_coulomb));
 	soc_debug("C pre dischar: %.4f\n", TOHA(_soc.pre_charger_coulomb));
 	soc_debug("C tol: %.2f\n", _soc.total_coulomb);
 	soc_debug("C tol: %.2f\n", _soc.total_coulomb);
 	soc_debug("C energy: %f\n", _soc.energy);
 	soc_debug("C energy: %f\n", _soc.energy);
-	soc_debug("C delta time %f,%f\n", max_soc_delta_time, soc_delta_time);
+	soc_debug("C delta time %f,%f, -- %d\n", max_soc_delta_time, soc_delta_time, force_full_ts);
 	if (chargering){
 	if (chargering){
 		soc_debug("C remain %d\n", charger_remain_time);
 		soc_debug("C remain %d\n", charger_remain_time);
 	}
 	}
@@ -166,7 +166,9 @@ static void _force_capacity_full(void){
 }
 }
 
 
 static int _soc_is_under_voltage(void) {
 static int _soc_is_under_voltage(void) {
-	return (bms_health()->powerdown_lower_voltage || bms_health()->sigle_cell_lower_voltage || bms_health()->discharger_lower_voltage);
+	return (bms_health()->powerdown_lower_voltage || bms_health()->sigle_cell_lower_voltage || 
+		bms_health()->discharger_lower_voltage || bms_health()->discharger_cell_shutpower_voltage ||
+		bms_health()->discharger_shutpower_voltage);
 }
 }
 
 
 static int _soc_update_by_ocv(uint8_t prev_charge_status){
 static int _soc_update_by_ocv(uint8_t prev_charge_status){
@@ -178,6 +180,7 @@ static int _soc_update_by_ocv(uint8_t prev_charge_status){
 	if (!chargering){
 	if (!chargering){
 		if (bms_health()->is_work_temp_normal) {
 		if (bms_health()->is_work_temp_normal) {
 			if (_soc.capacity && _soc_is_under_voltage()) {
 			if (_soc.capacity && _soc_is_under_voltage()) {
+				soc_warning("judge calib min col %d - %d\n", shark_get_seconds(), force_full_ts);
 				if (can_modify_min_cap()){
 				if (can_modify_min_cap()){
 					_soc.coulomb_min = _soc.coulomb_now; //已经校准过了,而且电池在常温下进入powerdown,最小容量修正为当前容量
 					_soc.coulomb_min = _soc.coulomb_now; //已经校准过了,而且电池在常温下进入powerdown,最小容量修正为当前容量
 					soc_warning("calicablite coulomb_min %f\n", _soc.coulomb_min);
 					soc_warning("calicablite coulomb_min %f\n", _soc.coulomb_min);