SoC values after battery profiling

Hello

Awhile back I profiled my battery using power up app @ 4C 25C and 45C for a battery between 2.75V and 4.2V battery model is attached in zip.

The profiles themselves seem okay, so i think the measurement went well (see graphs below), however in practice i have a couple of problems:

1) Batteries never charge to 100%. I can confirm this by using the PPK2 to power my system instead of the battery. if i set the voltage to 4.2V source mode the SoC measurement comes back as 98% even though my profiles are all set up for VTerm = 4.2V so surely this should give me 100%?

My firmware is set up to listen to events from the NPM1300 to control the LED status and i never seem to get the battery charged event.

2) battery voltages sometimes seem to shift quite a bit post charge. Like they'll get to 98% and quite quickly drop to something like 94%. I've checked the power draw of my PCBs and they are all good, drawing the expected 15uA so I don't think this drop is real.

How does the SoC measurement work, i.e. is there smoothing or do the values update quite rapidly? I'm wondering if it's susceptible to spikes on the VBat supply.

Related to that, i was reviewing my implementation of the NPM1300 versus the EK and I can see I missed putting a capacitor on the battery directly so I wonder if this might make it susceptible to spikes that would cause the battery voltage to dip when a measurement is taken?

I've also included my npm1300 code.

battery_model.zip

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/** ============================================================================
* @file power.c
*
* @brief Power management
*
* ============================================================================
*/
/*******************************************************************************
* INCLUDES
*******************************************************************************/
#include <stdlib.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/regulator.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor/npm1300_charger.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/
#ifdef CONFIG_NRF_FUEL_GAUGE
#include <stdlib.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor/npm1300_charger.h>
#include "nrf_fuel_gauge.h"
#include "tAuditLog.h"
/* nPM1300 CHARGER.BCHGCHARGESTATUS.CONSTANTCURRENT register bitmask */
#define NPM1300_CHG_STATUS_CC_MASK BIT_MASK(3)
static float max_charge_current;
static float term_charge_current;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX