nPM1300-EK+nRF52 DK+NRF5 SDK, charge/discharge current issue

Greetings.


Our team has encountered some difficulties in integrating nPM1300 into a new project. In the project we plan to use nPM1300 in conjunction with NRF52810. To develop the program part we purchased two developer boards: nPM1300-EK and nRF52 DK. NRF5 SDK was chosen as SDK because of the limited amount of resources in the NRF52810.
The npmx driver and the fuel_gauge example adapted for NRF5 SDK were taken as a basis. The main task now is to get a working full gauge.

At the moment the driver is successfully integrated, all necessary interrupts work, but there are some inaccuracies in obtaining charge/discharge current values.
Briefly on the essence of the problem:
A lithium battery is connected to the nPM1300. The NTC pin on the board is shorted to ground via a 10kOhm resistor. Nothing is connected to the load output, no charging is also connected. In this case we see the true values in the console of our program:

<info> app: V: 3.84; I: 0.000; T: 25.21

However, if we connect to the BUCK2 output an electronic load set in CC mode to 100mA, then in this case the current consumption value in the console does not correspond to the real one. The values of voltage and temperature correspond to the real data:
<info> app: V: 3.81; I: 0.124; T: 25.21

With 200mA on load, the picture is as follows:
<info> app: V: 3.77; I: 0.266; T: 25.21

Further, if we disconnect the load and connect the charger (the charging current is set to 300mA via npmx_charger_charging_current_set()), then on the charger ammeter I can see the real consumption of 305mA, but in the console the values are different:
<info> app: V: 3.96; I: -0.026; T: 25.21

With 500mA of charging set, the picture is as follows:
<info> app: V: 4.05; I: -0.026; T: 25.21

So we can see that the voltage set by the nPM1300 is correct, but the current has not changed and still shows 26mA with the real 512mA on the charger.
Looking ahead, I would like to say that the current value when the charger is connected (regardless of the set charging current) will always be displayed in the console as 26-27mA, even in case of simultaneous operation of the charger and the load on the nPM1300 output. Here is an output of simultaneous operation of a 200mA load on the BUCK2 and a charger set to 500mA:
<info> app: V: 4.06; I: -0.027; T: 25.21

The charger ammeter will show 643mA in this case.
Interesting thing is that when we connect nPM1300-EK to a computer using nPM PowerUp 1.3.0, this problem is not observed. Also, this problem does not appear when we build the npm1300_fuel_gauge example under NRF Connect. The current values in both cases correspond to the real ones.
Just in case, I would like to clarify that no changes were made to the driver from our side. Also, we have tried most of the APIs (adc and charger), which, in our opinion, could somehow affect the result of the charge/discharge current values.
Perhaps there is something we have overlooked.
Any help would be appreciated.
Thanks in advance.

Parents
  • Hi GrooVE.

    Thanks for you comprehensive question, the detail is really useful.

    I have taken a closer look at the issues, and there are a couple of bugs in the driver that are responsible for this.

    I have tested the following changes to the driver, and it fixes the issue on my setup.
    Comparing NordicSemiconductor:main...aasinclair:fix-charge-discharge-current-scaling · NordicSemiconductor/npmx (github.com)

    We will be reviewing these changes internally and will update the official release soon.

    Best regards
    Andy

  • Hi, Andy.

    Thanks for the quick response.
    At first glance, it looks like the problem is fixed.
    We'll do some more internal testing. I'll let you know if there are any issues.

    Thank you and best regard

  • Hi, Andy.

    I still get wrong values if the microcontroller starts after the charger has been plugged in. If I reconnect the charger afterwards, or if I connect it after startup, the current values are displayed correctly. Could you please confirm or deny this fact?
    Also, I'm having some difficulty with the initial battery status determination after starting the program. If I call the npmx_core_register_cb() function with the NPMX_CALLBACK_TYPE_EVENT_BAT_CHAR_STATUS callback type, I can track the change of the battery connection or disconnection status inside the callback function, but how can I get its status right after power on, in manual mode? Perhaps you could help me.

    Best regards

  • Hi.

    The USB current limit is reset to the default value when USB is removed,
    could this be the difference you see?

    For example, I have the default fuel gauge configuration (150mA charge current, 500mA USB current limit).  I get the 150mA charge current if I power up with USB connected.

    [00:00:03.283,996] <inf> fuel_gauge: V: 3.706, I: -0.158, T: 24.91, SoC: 31.84,

    After removing and re-inserting USB, the USB current limit will default to 100mA (actual value depends on version of silicon.)

    [00:01:15.629,913] <inf> fuel_gauge: V: 3.676, I: -0.094, T: 24.80, SoC: 32.85,

    To get higher current, you need to call npmx_vbusin_current_limit_set again.

    ---

    To get battery connection status at startup, you can call npmx_charger_status_get

    Best regards
    Andy

  • Thanks, Andy.

    I know about calling npmx_vbusin_current_limit_set(), of course. At power on, I saw a consumption of 150mA set to charge, while in the log I saw only 32mA. Nevertheless, I figured out the cause, thanks.

    But the battery issue is still unresolved. After power on and initialization, npmx_charger_status_get() always returns mask 0, both with battery connected and charging disconnected at startup, and with battery disconnected and charging connected. In both cases, none of the callbacks are triggered at startup. If in case of VBUSIN I can get the state via npmx_vbusin_vbus_status_get(), in case of battery I have not found a way. Maybe you can suggest a working method. Thanks

  • Hi GRooVE.

    Good point.  Looking more closely, charger status won't work, because the battery detection bit is set as part of the charging FSM, so only runs when USB is connected.

    You can check if USB is connected by reading the vbusin status:
    npmx_vbusin_vbus_status_get

    Andy

  • Hi Andy,

    Thank you for the clarification and for your help.
    No further questions at this time.

Reply Children
No Data
Related