|
|
@@ -373,21 +373,19 @@ int soc_update_by_ocv(void){
|
|
|
|
|
|
|
|
|
static void soc_calibrate(uint8_t prev_charge_status){
|
|
|
- static int cali_full_count = 0;
|
|
|
if (!(_soc.flags & SOC_FLAG_CALIBRATED)){
|
|
|
if (chargering){//ÓÃocv½øÐÐÑϸñУ׼
|
|
|
if (_soc.capacity != 100){
|
|
|
- if ((measure_value()->load_current <= FULL_MIN_CURRENT) && (bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_CHARGING)){
|
|
|
- cali_full_count ++;
|
|
|
- }
|
|
|
- if (cali_full_count >= 20 || bms_health()->sigle_cell_over_voltage) {
|
|
|
- soc_debug("calibrate Capacity to 100, measure_value()->load_current %d\n", measure_value()->load_current);
|
|
|
+ if ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_CHARGING) && (_soc.charger_coulomb >= (0.1f * 3600.0f))){
|
|
|
+ _force_capacity_full();
|
|
|
+ push_event(Charger_Full, 10);
|
|
|
+ }else if (bms_health()->sigle_cell_over_voltage) {
|
|
|
_force_capacity_full();
|
|
|
push_event(Charger_Full, 1);
|
|
|
}
|
|
|
}
|
|
|
}else if (prev_charge_status){
|
|
|
- if((_soc.capacity != 100) && ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE) || bms_health()->sigle_cell_over_voltage)){
|
|
|
+ if((_soc.capacity != 100) && ((bms_state_get()->pack_voltage >= FULL_MAX_VOLTAGE_CHARGING) || bms_health()->sigle_cell_over_voltage)){
|
|
|
soc_debug("calibrate Capacity to 100\n");
|
|
|
_force_capacity_full();
|
|
|
push_event(Charger_Full, 2);
|