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