Hi,
I am using the nPM1300 in combination with a STM32L431KBU MCU.
Also the code from Nordic to communicate with the nPM1300: https://github.com/NordicSemiconductor/npmx
to get the SOC I am using the fuel gauge lib provided by Nordic in de nRF Connect SDK V2.6.0 (cortex-m4\hard-float\libnrf_fuel_gauge.a).
For discharging the battery the SOC seems to be fine but when charging the battery the SOC value is incorrect.
Every second I update the fuel gauge lib, the SOC will increase 1%. within a 100sec the SOC is at 100% but the battery is still not full. (6 to 7 hours to go with 0.2C charging current)
I have tried to disable the charging module in the nPM1300 for a short period to do a fuel gauge update but as result losing the ADC battery voltage and current measurements.
fuel gauge update code (update interval, 1 sec):
static pm_error_t fuel_gauge_update(void)
{
bool cc_charging = false;
if(pm.charge.state == APP_STATE_VBUS_CONNECTED_CHARGING_CC)
{
cc_charging = true;
}
/*fuel gauge update*/
pm.gauge.delta = ((float)(pm_uptimer_get() - pm.gauge.ref_time)) / 1000.0f;
pm.gauge.soc = nrf_fuel_gauge_process(pm.adc.values.voltage, pm.adc.values.current, pm.adc.values.temp, pm.gauge.delta, NULL);
pm.gauge.tte = nrf_fuel_gauge_tte_get();
pm.gauge.ttf = nrf_fuel_gauge_ttf_get(cc_charging, -pm.gauge.term_charge_current);
return PM_SUCCES;
}
command used for disable charger module:
/* Disable charger before changing charge current. */
npmx_charger_module_disable_set(charger_instance, NPMX_CHARGER_MODULE_CHARGER_MASK | NPMX_CHARGER_MODULE_RECHARGE_MASK);
My questions:
How to get a correct SOC when charging?
Is this possible with the fuel gauge lib from Nordic?