فهرست منبع

充满校准最小容量,使用0.2的低通滤波

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 4 سال پیش
والد
کامیت
14e556f6fc
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      Application/app/sox/soc.c

+ 4 - 3
Application/app/sox/soc.c

@@ -304,6 +304,7 @@ bool soc_is_force_full(void) {
 	return is_force_full;
 }
 
+#define min_cap_lfp 0.2f
 static void _force_capacity_full(void){
 	_soc.capacity = 100;
 	is_force_full = true;
@@ -318,7 +319,7 @@ static void _force_capacity_full(void){
 		}
 		//don't trust if curr_min_cap big than before
 		if (curr_min_cap < _soc.coulomb_min) {
-			_soc.coulomb_min = (curr_min_cap + _soc.coulomb_min)/2.0f; //lowpass filter
+			_soc.coulomb_min = _soc.coulomb_min * (1.0f - min_cap_lfp) + curr_min_cap * min_cap_lfp; //lowpass filter
 			soc_warning("current real cap %f\n", curr_real_cap);
 			push_event(Min_Cap_For_Full, (u32)curr_real_cap);
 		}
@@ -354,9 +355,9 @@ static int _soc_update_by_ocv(uint8_t prev_charge_status){
 				}else if (health_is_mid_current()) {
 					_soc.coulomb_min = _soc.coulomb_now * 1.0f;
 				}else if (health_is_big_current()){
-					_soc.coulomb_min = _soc.coulomb_now * 0.975f;
-				}else {
 					_soc.coulomb_min = _soc.coulomb_now * 0.95f;
+				}else {
+					_soc.coulomb_min = _soc.coulomb_now * 0.9f;
 				}
 				_soc.coulomb_now = _soc.coulomb_min;
 				soc_warning("calicablite coulomb_min %f\n", _soc.coulomb_min);