Fuel Gauge Learning Behavior and Data Retention Across MCU Resets

Hi Nordic team,

We are currently investigating how to ensure that the fuel gauge continues learning and retaining the battery's charge/discharge profile over time.

In our setup, we are not directly controlling the fuel gauge; instead, it is managed by the PMIC. Our question is: is there a way to keep the fuel gauge “alive” and maintaining its learning state, as long as there is no power-on reset event?

More specifically, we would like to understand what happens during a reset of our MCU. If the MCU experiences a reset (e.g., via the reset pin) and reinitializes the PMIC during its boot process, will the fuel gauge lose the previously learned battery data? Or will it continue using the stored data as long as it has not been completely power-cycled?

Thanks in advance for your support.

Parents
  • Hi levijo,

    when you first initialize the fuel gauge software on the MCU side, the initial state-of-charge will be based on the initial voltage reading. Depending on whether the battery is rested or not, this can give an initial error. For example, if you reset the fuel gauge while the battery is heavily loaded or charging, the initial error can be significant. The state-of-charge will converge towards the correct value as more data is processed.

    The same will happen if the MCU is reset, or you otherwise re-initialize the fuel gauge library.

    In the most recent fuel gauge library version (v1.0.1), we added functionality to copy the fuel gauge state memory from the library. The intention is to handle cases where the MCU wants to power down without RAM retention and it would be beneficial to store the state to non-volatile memory instead. As long as there is no significant drain on the battery during this power down period, the MCU can re-initialize the fuel gauge based on this stored state data and resume where it left off.

    We don't have a good sample for this functionality yet, only this test case: https://github.com/nrfconnect/sdk-nrf/blob/main/tests/lib/nrf_fuel_gauge/src/nrf_fuel_gauge_test.c#L140

    Best regards,

    Audun

Reply
  • Hi levijo,

    when you first initialize the fuel gauge software on the MCU side, the initial state-of-charge will be based on the initial voltage reading. Depending on whether the battery is rested or not, this can give an initial error. For example, if you reset the fuel gauge while the battery is heavily loaded or charging, the initial error can be significant. The state-of-charge will converge towards the correct value as more data is processed.

    The same will happen if the MCU is reset, or you otherwise re-initialize the fuel gauge library.

    In the most recent fuel gauge library version (v1.0.1), we added functionality to copy the fuel gauge state memory from the library. The intention is to handle cases where the MCU wants to power down without RAM retention and it would be beneficial to store the state to non-volatile memory instead. As long as there is no significant drain on the battery during this power down period, the MCU can re-initialize the fuel gauge based on this stored state data and resume where it left off.

    We don't have a good sample for this functionality yet, only this test case: https://github.com/nrfconnect/sdk-nrf/blob/main/tests/lib/nrf_fuel_gauge/src/nrf_fuel_gauge_test.c#L140

    Best regards,

    Audun

Children
No Data
Related