|
@@ -259,20 +259,6 @@ static int _soc_is_under_voltage(void) {
|
|
|
bms_health()->discharger_lower_voltage);
|
|
bms_health()->discharger_lower_voltage);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#if 0
|
|
|
|
|
-static int _soc_force_capaticy(uint8_t capaticy){
|
|
|
|
|
- float cap = (float)capaticy / 100.0f;
|
|
|
|
|
- float min = (_soc.coulomb_now - cap * _soc.coulomb_max)/(1.0f - cap);
|
|
|
|
|
- if (min > 0.0f) {
|
|
|
|
|
- _soc.coulomb_min = min;
|
|
|
|
|
- _soc.capacity = capaticy;
|
|
|
|
|
- force_full_ts = 0xFFFFFFFF;
|
|
|
|
|
- return 1;
|
|
|
|
|
- }
|
|
|
|
|
- return 0;
|
|
|
|
|
-}
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
static int ocv_full_count = 0;
|
|
static int ocv_full_count = 0;
|
|
|
//static int ocv_force_capaticy = 0;
|
|
//static int ocv_force_capaticy = 0;
|
|
@@ -291,25 +277,9 @@ static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
}
|
|
}
|
|
|
_soc.capacity = 0;
|
|
_soc.capacity = 0;
|
|
|
return 1;
|
|
return 1;
|
|
|
- }
|
|
|
|
|
-#if 0
|
|
|
|
|
- else if ((!prev_charge_status) && (bms_state_get()->cell_min_vol <= 2900) && (_soc.capacity > 10)) {
|
|
|
|
|
- /* 如果单电芯最小电压小于2.9v,并且容量大于10%,需要校准到10% */
|
|
|
|
|
- if (ocv_force_capaticy++ >= 10) {
|
|
|
|
|
- return _soc_force_capaticy(10);
|
|
|
|
|
- }
|
|
|
|
|
- }else {
|
|
|
|
|
- ocv_force_capaticy = 0;
|
|
|
|
|
- }
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (chargering || prev_charge_status) {
|
|
if (chargering || prev_charge_status) {
|
|
|
- //ocv_force_capaticy = 0;
|
|
|
|
|
- /*
|
|
|
|
|
- if (bms_state_get()->ps_charger_mask && !bms_state_get()->ps_charger_in) { //ps100 上报无充电器,不做处理
|
|
|
|
|
- ocv_full_count = 0;
|
|
|
|
|
- return changed;
|
|
|
|
|
- }*/
|
|
|
|
|
if (bms_health()->sigle_cell_over_voltage) { //单电芯过压强制充满
|
|
if (bms_health()->sigle_cell_over_voltage) { //单电芯过压强制充满
|
|
|
_force_capacity_full();
|
|
_force_capacity_full();
|
|
|
ocv_full_count = 0;
|
|
ocv_full_count = 0;
|