Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
DEVICE AND METHOD OF ESTIMATING A REMAINING RUNTIME OF A BATTERY
Document Type and Number:
WIPO Patent Application WO/2020/188285
Kind Code:
A1
Abstract:
A method of estimating a remaining runtime of a battery comprises obtaining a first runtime estimation based on an estimated useable energy of the battery; obtaining a second runtime estimation based on a variation of a voltage of the battery; and calculating an estimated remaining runtime of the battery using both the first and second runtime estimations.

Inventors:
THUNOT ANDRE (GB)
Application Number:
PCT/GB2020/050730
Publication Date:
September 24, 2020
Filing Date:
March 19, 2020
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
DYSON TECHNOLOGY LTD (GB)
International Classes:
G01R31/382; G01R31/3835; G01R31/3842; G01R31/36
Foreign References:
US20100198537A12010-08-05
US20110241693A12011-10-06
EP0566264A11993-10-20
US5371682A1994-12-06
Attorney, Agent or Firm:
WARNER, Thomas et al. (GB)
Download PDF:
Claims:
CLAIMS

1. A method of estimating a remaining runtime of a battery, the method comprising:

obtaining a first runtime estimation based on an estimated useable energy of the battery; obtaining a second runtime estimation based on a variation of a voltage of the battery; and calculating an estimated remaining runtime of the battery using both the first and second runtime estimations.

2. A method according to claim 1 , wherein the first runtime estimation is obtained based on a discharge power of the battery.

3. A method according to claim 2, wherein the useable energy of the battery is estimated by derating an estimated maximum available energy of the battery with an estimated unavailable energy, wherein the estimated unavailable energy is based on a predicted internal resistance of the battery at an end-of-discharge, and wherein the predicted internal resistance of the battery is dependent on the discharge power of the battery.

4. A method according to claim 3, wherein the estimated maximum available energy of the battery is based on an estimated amount of charge of the battery at the end-of-discharge.

5. A method according to claim 3 or 4, comprising selecting the predicted internal resistance from a plurality of power-dependent predicted internal resistances based on the discharge power of the battery.

6. A method according to any of claims 3 to 5, comprising:

in response to the estimated remaining runtime of the battery being different from an observed remaining runtime of the battery, updating the predicted internal resistance.

7. A method according to claim 6, wherein the updating of the predicted internal resistance comprises increasing the predicted internal resistance in response to the estimated remaining runtime of the battery being greater than the observed remaining runtime of the battery.

8. A method according to claim 6 or 7, wherein the updating of the predicted internal resistance comprises decreasing the predicted internal resistance in response to the estimated remaining runtime of the battery being less than the observed remaining runtime of the battery. 9. A method according to any of claims 1 to 8, wherein the estimating of the remaining runtime of the battery uses non-zero-weighted contributions of both of the first and second runtime estimations.

10. A method according to claim 9, wherein the contributions are dependent on the voltage of the battery.

11. A method according to claim 10, wherein as the voltage of the battery decreases, the contribution of the first runtime estimation decreases and the contribution of the second runtime estimation increases.

12. A method according to any of claims 1 to 11 , wherein the first runtime estimation is obtained based on an estimated amount of energy of the battery that has already been used.

13. A method according to any of claims 1 to 12, wherein the second runtime estimation is obtained in response to the voltage of the battery being less than a voltage level threshold.

14. A method according to any of claims 1 to 13, wherein the second runtime estimation is obtained in response to a voltage gradient of the battery being greater than a voltage gradient threshold.

15. A method according to any of claims 1 to 14, comprising obtaining a third runtime estimation based on a variation of a temperature of the battery, wherein the estimating of remaining runtime of the battery further comprises using the third runtime estimation.

16. A method according to claim 15, wherein the third runtime estimation is obtained in response to the temperature of the battery exceeding a battery temperature threshold.

17. A method according to claim 15 or 16, wherein the third runtime estimation is obtained in response to a thermal gradient of the battery exceeding a thermal gradient threshold.

18. A method according to any of claims 15 to 17, comprising using the third runtime estimation as the estimated remaining runtime of the battery in response to the third runtime estimation being less than the calculated remaining runtime.

19. A method according to any of claims 1 to 18, comprising: causing an indication of the estimated remaining runtime of the battery to be displayed on a display.

20. A method of estimating a remaining runtime of a battery, the method being performed by a processor, the method comprising:

using both an estimated useable energy of the battery and a variation of a voltage of the battery to estimate the remaining runtime of the battery.

21. A method of estimating a remaining runtime of a battery, the method being performed by a processor, the method comprising:

at a first point in time, using an energy balance equation to estimate the remaining runtime of the battery; and

at a second, later point in time, using both the energy balance equation and a voltage gradient to estimate the remaining runtime of the battery.

22. A processor configured to perform a method according to any of claims 1 to 21.

23. An electronic device comprising a processor according to claim 22.

24. A computer program comprising instructions which, when executed, cause a method according to any of claims 1 to 21 to be performed.

25. A computer-readable medium comprising instructions which, when executed, cause a method according to any of claims 1 to 21 to be performed.

Description:
DEVICE AND METHOD OF ESTIMATING A REMAINING RUNTIME OF A BATTERY

Technical Field

The present disclosure relates to estimating a remaining runtime of a battery.

Background

In recent years battery powered devices, such has vacuum cleaners, have gained in popularity in comparison to mains-powered machines, for instance due to their generally being smaller, lighter and/or more portable. However, one disadvantage to such machines is the need to charge the battery intermittently. Some battery powered machines calculate the remaining runtime of the battery, for instance so that the runtime can be indicated to the user of the machine so that the user can plan their usage of the device accordingly. For example, a battery powered vacuum cleaner may indicate the remaining runtime of its battery so that the user can judge when best to charge the battery (for instance the runtime indication may clarify to the user whether or not they have time to finish cleaning before it will be necessary to charge the vacuum cleaner).

It is desirable for estimated battery runtime to be estimated accurately, so that decisions based on the runtime estimate are correct. For example if a user of a battery-powered vacuum cleaner will be deciding whether or not they can finish cleaning before charging the vacuum cleaner, it is important that an unacceptably imprecise runtime estimate does not lead the user to the wrong conclusion (for instance if the runtime estimate was longer than the true runtime, the machine may cut out part way through a cleaning operation, causing frustration on the part of the user). However, known techniques often struggle to provide the desired level of precision.

Summary

According to a first aspect of the present invention there is provided a method of estimating a remaining runtime of a battery, the method comprising:

obtaining a first runtime estimation based on an estimated useable energy of the battery; obtaining a second runtime estimation based on a variation of a voltage of the battery; and

calculating an estimated remaining runtime of the battery using both the first and second runtime estimations.

According to a second aspect of the present invention there is provided a method of estimating a remaining runtime of a battery, the method being performed by a processor, the method comprising: using both an estimated useable energy of the battery and a variation of a voltage of the battery to estimate the remaining runtime of the battery.

According to a third aspect of the present invention there is provided a method of estimating a remaining runtime of a battery, the method being performed by a processor, the method comprising:

at a first point in time, using an energy balance equation to estimate the remaining runtime of the battery; and

at a second, later point in time, using both the energy balance equation and a voltage gradient to estimate the remaining runtime of the battery.

According to a fourth aspect of the present invention there is provided a processor configured to perform a method according to the first, second or third aspect of the invention.

According to a fifth aspect of the present invention there is provided an electronic device comprising a processor according to the fourth aspect of the invention.

According to a sixth aspect of the present invention there is provided a computer program comprising instructions which, when executed, cause a method according to the first, second or third aspect of the invention to be performed.

According to a seventh aspect of the present invention there is provided computer- readable medium comprising instructions which, when executed, cause a method according to the first, second or third aspect of the invention to be performed.

Further features will become apparent from the following description, given by way of example only, which is made with reference to the accompanying drawings.

Brief Description of the Drawings

Figure 1 shows schematically an example of a system;

Figure 2 shows schematically another example of a system;

Figure 4 shows a flowchart of an example of a main product loop;

Figure 5 shows a flowchart of an example of a SoC algorithm routine;

Figure 6 shows a flowchart of an example of start-up routine;

Figure 7 shows a flowchart of an example of power-down routine;

Figure 8 shows a flowchart of an example of mode-change routine; Figure 9 shows a flowchart of an example of a current offset error estimation routine; Figure 10 shows a flowchart of an example of a maximum capacity estimation routine; Figure 1 1 shows an example of a graph illustrating several runtime estimation parameters for a 40W, single-cell discharge;

Figure 12 shows a flowchart of an example of a runtime algorithm main routine;

Figure 13 shows a flowchart of an example of an end-of-discharge (EOD) estimation routine;

Figure 14 shows a flowchart of an example of a nominal estimation routine;

Figure 15 shows a flowchart of an example of an EOD predicted resistance recalibration routine;

Figure 16 shows a flowchart of an example of a voltage differential runtime routine; Figure 17 shows schematically an illustration of a voltage differential runtime procedure; and

Figure 18 shows a flowchart of an example of a thermal differential runtime estimation routine.

Detailed Description

Examples described herein relate to practical battery SoC estimation and runtime estimation algorithms. Such algorithms may be used with a range of battery-operated products. The terms “battery-operated products”, “battery-operated electronic devices”, “products”, “electronic devices”, and“systems” are generally used herein interchangeably. In examples, the SoC estimation and runtime estimation algorithms implement subroutines which intelligently and iteratively modify estimation parameters and dynamically evaluate systemic errors. This level of adaptability enables the algorithms to compensate for errors. The errors may relate to product behaviour and/or battery degradation rates. More stable and accurate estimation values may thereby be provided over the lifetime of the product. Although the present disclosure includes separate sections relating to estimating battery SoC and runtime values, features from these separate sections may be combined. For example, some parameters used in the example runtime estimation algorithms are described in relation to the example SoC estimation algorithms. As such, the battery SoC and runtime estimation algorithms may, in some examples, be used together. In other examples, the SoC and runtime estimation algorithms are used separately.

Rapidly changing electronic designs and manufacturing processes favour parameter estimation systems that involve minimal testing, recalibration, and collection of device-specific data. Examples described herein provide accurate SoC and runtime estimations by implementing intelligent methods for incremental improvements to parameter estimations. In examples, the SoC algorithm uses a combination of voltage-sensing and current-sensing methods along with self-recalibrating routines to achieve high levels of accuracy. Such self- adaptive methods allow for correction for internal impedance cell variation from transient effects (for example, current rate) and with ageing. In examples, the implementation of the SoC and runtime estimation algorithms is simplified, as substantial cell-specific data is not used for successful operation. Further, manufacturing deviations may be compensated by the adaptive nature of the SoC and runtime estimation algorithms. Accuracy and stability of the example SoC and runtime estimation algorithms may be achieved via intelligent functions that adapt estimated outputs according to differences between predicted and observed states of the system. Consequently, the behaviour of the SoC and runtime estimation algorithms is, in examples, different for different products, since the degradation of the battery of a particular product is directly affected by different user-profiles and environmental factors, for example temperature. In examples, variations and errors associated with the current measurement integrated circuit (IC) of the printed circuit board (PCB) of the product are estimated through a negative feedback system which aims to minimise accumulated errors within the calculations performed by the algorithms over several iterations.

System Overview

Referring to Figure 1 , there is shown schematically an example of a system 100. The SoC estimation algorithm and/or the runtime estimation algorithm may be implemented in the system 100. In this example, the system 100 comprises a battery data management component 105, denoted“BQ” in Figure 1. The battery data management component 105 may measure voltages, currents and/or temperatures, for example. In this example, the system 100 comprises a BMS (battery management system) 1 10, denoted “BMS” in Figure 1. The battery data management component 105 and the BMS 110 may be implemented using one or more processors. In this example, the system 100 comprises internal memory 1 15. In this example, the internal memory 1 15 comprises persistent internal memory. Battery estimations may link to the internal memory 1 15. In this example, the system 100 implements an SoC algorithm 120. In this example, the SoC algorithm 120 performs battery state estimations. The SoC algorithm 120 may use various battery state estimation parameters to perform battery state estimations. Examples of battery state estimation parameters include, but are not limited to, maximum capacity, Q max , initial capacity, available energy, E batt , and current offset errors, l err . In this example, the system 100 implements a runtime algorithm 125. In this example, the runtime algorithm 125 performs runtime state estimations. The runtime algorithm 125 may use various runtime state estimation parameters to perform runtime state estimations. Examples of runtime state estimation parameters include, but are not limited to, EOD predicted resistances, W eod , and energy loss counters. In this specific example, the SoC and runtime algorithms 120, 125 are constructed in separate class functions. This may facilitate use in future battery-operated products and across multiple platforms. Example communications between the SoC and runtime algorithms 120, 125 and PCB components, along with example data being computed, measured, or stored at each stage, are depicted in Figure 1.

Referring to Figure 2, there is shown schematically another example of a system 200. The SoC estimation algorithm and/or the runtime estimation algorithm may be implemented in the system 200. The system 200 shown in Figure 2 includes features which are the same as, or are similar to, features of the example system 100 shown in Figure 1 and described above. Such features are indicated using the same reference numeral but incremented by 100. In this example, the system 200 comprises a battery pack 230. In this example, the battery pack comprises six cells 231. However, in other examples, a different number of cells could be used. The term“battery” is used herein to mean a device that comprises at least one cell. The term “battery pack” is used herein to mean a device that comprises at least one battery. Unless the use would indicate otherwise, references herein to “battery” and “battery pack” should be understood to include both batteries and battery packs. In this example, the battery pack 230 comprises a shunt resistor 232. In this specific example, the shunt resistor 232 has a resistance of 1 mW. However, the shunt resistor 232 may have a different resistance in other examples. In this example, the system 200 comprises thermocouples 235. In this example, the thermocouples 235 provide battery temperature readings to the battery data management component 205. In this specific example, a first one of the two thermocouples 235 is coupled to a third one of the six cells 231 and a second one of the two thermocouples 235 is coupled to a fourth one of the six cells 231. In this example, the BMS IC 210 implements the SoC and runtime algorithms using data provided by the battery data management component 205. In this example, the system 200 comprises a motor 240. In this example, the system comprises a user interface PCB (Ul PCB) 245. In this example, the system 200 comprises a display 250. In this example, the display 250 comprises a 128 x 128 TFT screen. However, the display may be of a different type in other examples. In this example, the Ul PCB 245 determines how data is to be displayed on the display 250. For example, the Ul PCB 245 may apply runtime smoothing and/or data conditioning. In other examples, however, smoothing and/or conditioning may be performed elsewhere in the system or not at all.

The example systems 100, 200 shown in Figures 1 and 2 may be provided in a variety of battery-powered products. In some examples, the battery-powered product comprises a vacuum cleaner. While a variety of battery-powered products may benefit from the example SoC algorithms and runtime algorithms described herein, in this specific example, the system comprises a battery pack assembled with 18650 batteries. Each battery has a rated capacity of 2.80Ah. The example SoC algorithms and runtime algorithms may, however, be used with other system designs, PCBs and/or or battery packs. Alterations may be made to the SoC algorithms and runtime algorithms described herein accordingly. For example, initial conditions and/or reference parameters may be adjusted such that stable and accurate estimation results are generated over the lifetime of the product based on properties of the specific product. In examples, runtime estimation errors are only applicable during discharge.

SoC Algorithm

An efficient and practical SoC algorithm which may operate without using complex, equivalent-circuit models and/or without using substantial computational power is described herein. In examples, the SoC algorithm makes use of some established practices, such as Coulomb-counting and OCV references. OCV references relate OCV values to corresponding SoC values. OCV references may correspond to OCV tables and/or OCV curves. An OCV curve may be used to represent an OCV table visually. However, in contrast to known techniques, in accordance with examples, the SoC algorithm introduces recalibration routines that iteratively estimate measurement errors and adapt internal parameters to improve future estimations. The SoC algorithm may not involve extensive offline training, as may be the case with artificial neural networks (ANNs), for example. The SoC algorithm may not use extensive cell-specific data. Instead or as well as OCV references, other cell-specific data may be used, however, such as EOD predicted (internal) resistance values, W eod , cutoff voltages, V cutoff , and maximum capacities, Q max , for example. Systemic current measurement errors may be estimated online. The SoC algorithm may be used with and/or adapted to most commercially- available, rechargeable Lithium-ion cells. The SoC algorithm may be used with and/or adapted to a variety of different battery pack configurations. The SoC algorithm may be programmed and executed on a low-cost microcontroller with a relatively small amount of persistent data. The SoC algorithm may be of low computational complexity and may operate in real-time. The SoC algorithm may use integer values and may not use floating-point arithmetic modules. As such, a lower-cost, quicker, faster microcontroller may be used, compared to floating-point arithmetic modules being used. The present disclosure provides a SoC estimation method which can handle both cell degradation and systemic errors present in practical battery-operated systems, to achieve and maintain accurate estimations over the lifetime of the product.

As described above, the SoC of a battery pack is generally defined as the available capacity of the battery pack, Q available , expressed as a percentage of the nominal rated capacity of the battery pack, or the maximum useable capacity after cycling, Q max . Capacity is generally expressed in ampere hours (Ah). Capacity may be considered to represent how many amps the battery pack can deliver for one hour, or the amount of electric charge the battery pack stores. The equation for SoC may be generalised as:

Coulomb-counting may be used to estimate SoC. Coulomb-counting may provide a relatively simple and practical implementation with respect to both hardware and software considerations. However, Coulomb-counting suffers from accumulated errors over extended periods of time. The accumulated errors may be caused by current measurement offsets, non- linearities, integration errors, rounding errors, and other noise sources. Such errors may manifest in measured current values, even if the errors are not directly related to current measurement. Coulomb-counting may be implemented by accumulating, or subtracting, the measured amount of current, / measured , through the battery pack as:

SoC(0) is an initial SoC condition at t = 0 . As will be described in more detail below, t = 0 corresponds to the start of a recalibration period for recalibrating an estimated current offset error, I err , or for recalibrating an estimated maximum capacity, Q max , of the battery pack. t r is the final time, when current flow is terminated. The plus sign in the above SoC equation is used in accordance with the convention used herein that during discharge current has a negative value, and during charge current has a positive value. As such, if, for example, SoC( 0) = 100%, and the product is discharged such that the measured current, / measured , is positive, the value of SoC(t f ) will be less than SoC( 0) = 100%. In this example, the SoC algorithm uses a Coulomb counter, DC, and an energy counter, DE. The terms “DC" and “DCoulomb” are used interchangeably herein. The terms“ DE” and“ DEnergy” are also used interchangeably herein. In some examples, the runtime estimation algorithm uses the energy counter, DE, and the SoC algorithm does not use the energy counter, DE. In some examples, the Coulomb counter, DC, and/or the energy counter, DE, are calculated from an approximate integral discrete function, via the trapezoidal numerical method, from the sampled battery pack current, I measured (t, and power, P measured (t respectively. In this example, a sampling time, t s , of approximately 250ms is used. However, different sampling times, t s , may be used in other examples. DC and DE may be calculated for a time period from t = a to t = b as:

and

where t 1 = a , and t N+1 = b. In some examples, the following initial conditions are applied in relation toDC and DE after a recalibration routine is executed and after a mode change routine is executed: DC(0) = DE(0) = 0. As such, the Coulomb counter, DC, and the energy counter, DE, are, in effect, reset after recalibration routines and mode-change routines are executed.

Current Offset Error and Maximum Capacity Estimation

As indicated above, Coulomb-counting involves accumulating, or subtracting, the current through the battery pack, / measured , as measured by the BMS. However, the measured current, I measured , is not necessarily the actual current, l actual , through the battery pack. The difference may result from various current-measurement error sources, examples of which are provided above. As such, the actual current, l actual may be expressed as the sum of the measured current, / measured , and a current offset error, l err , such that:

The current offset error, I err , may be considered to be an offset applied to the measured current, / measured , to account for errors that manifest in the measured current, / measured . Coulomb-counting is then performed based on the measured current, / measured , but adjusted by the current offset error, I err . In examples, the current offset error, I err , is estimated by the product. This differs from a preconfigured current offset error, I err , being used, where the current offset error, I err , is preconfigured during assembly of the product and is a static value. In some examples, the current offset error, I err , is estimated multiple times throughout the lifetime of the product. Estimating the current offset error, I err , can provide more accurate SoC values, than where a predetermined and fixed current offset error, I err , is used or where no current offset error, I err , is used. In the present example, an assumed current value rather than a measured current value is used when the product is at rest. This is described in more detail below. The assumed current value may be zero, but where the product is left at rest for long periods of time it may be preferably to use a non-zero value. By adjusting the measured current, / measured , in this way, Coulomb-counting is performed more accurately. In examples, a “predicted” SoC of the battery pack is obtained based on the Coulomb-counting technique. In examples, an“observed” SoC of the battery pack is also obtained by measuring a voltage of the battery pack and using an empirically-established, nonlinear relationship between the measured voltage of the battery pack and the observed SoC. In examples, this involves using an OCV reference. In examples, the predicted SoC and the observed SoC are compared. Comparing the predicted SoC and the observed SoC may involve subtracting the predicted SoC from the observed SoC. Differences between the predicted SoC and the observed SoC are used during a current offset error recalibration period to recalibrate the estimation of the current offset error, I err . The current offset error, I err , may be estimated such that the differences between the predicted SoC and the observed SoC are minimised. In a subsequent current offset error recalibration period, the predicted SoC of the battery pack is obtained based on the Coulomb- counting technique and using the estimated current offset error, I err , from the previous current offset error recalibration period. The predicted SoC and the observed SoC during the subsequent current offset error recalibration period are compared, and the estimated current offset error, I err , is recalibrated accordingly. As such, in examples, the current offset error, I err , is iteratively recalibrated. In examples, the estimated current offset error, I err , becomes stable after a number of current offset error recalibration periods. In examples, the estimated current offset error, I err , is then fixed, at least temporarily. In examples, the current offset error, l err , is estimated during a first recalibration phase. In examples, the maximum capacity, Q max , is fixed during the first recalibration phase. In examples, once the estimated current offset error, I err , is fixed, the SoC algorithm enters a second recalibration phase in which the maximum capacity, Q max , is recalibrated. In examples, the current offset error, I err , is fixed during the second recalibration phase. The second recalibration phase accounts for capacity degradation of the battery pack over time. Since SoC is a function of the maximum capacity, Q max , a more accurate estimation of the maximum capacity, Q max , can lead to more accurate SoC estimation.

Main Product Loop

Referring to Figure 3, there is shown a flowchart of an example of a main product loop. In this example, the main product loop includes SoC algorithm and runtime algorithm subroutines. Figure 3 represents a continuous loop, which is run by the product at a target sampling rate. In this example, the target sampling rate is 250ms. In this example, the SoC algorithm is executed for every state of the product. In this example, the states are charging, discharging and resting. In this example, the resting state corresponds to the product being switched on but not being triggered. Where the product corresponds to a vacuum cleaner, the charging state may correspond to the vacuum cleaner being charged (for example by plugging the vacuum cleaner into a docking station), the discharging state may correspond to the vacuum cleaner being used (for example as a result of a user having depressed a trigger on the vacuum cleaner), and the resting state may correspond to the vacuum cleaner being powered up but not being used. In this example, the runtime algorithm is only executed during discharge. As explained above, in examples, Coulomb-counting involves integrating current through the battery. In this example, the SoC algorithm uses a non-zero, predefined PCB current consumption value, as opposed to a measured current value, when the product is not being charged and remains in the resting state for more than a threshold amount of time. This accounts for the potential of current measurement at rest not being particularly accurate. For example, the current drawn by the product at rest is likely to be small compared to the current drawn by the product during discharge. For example, the current drawn at rest may be around 10mA or 20mA (potentially around 100mA), compared to a current level of around 20A to 30A when the product is discharging. In examples, Coulomb-counting is still performed during resting even though the current values may be small. In particular, the product may be in the resting state for a longer amount of time than when the product is being discharged. Since the Coulomb counter, DC , is based on both current and time, a small current over a long time period can be significant. For example, a 10mA current draw for 30 minutes corresponds to 10% of a current draw of 30A for 1 minute. If the currents are rest were higher, for example 100mA or more, the impact of Coulomb-counting during resting is even more pronounced. In other examples, and as described above, the predefined PCB current consumption value is set to zero such that the Coulomb counter, DC , does not account for current drawn while the product is resting, or Coulomb-counting could be bypassed altogether while the product is resting. Although this may simplify Coulomb-counting calculations, inaccuracies would be introduced as some current will be drawn by the PCB when the product is resting. As such, in this example, total system current consumptions exceeding a null value are included in the current measurement calculations of the SoC algorithm if they are maintained for more than a predetermined amount of time. In this specific example, current consumptions over 10mA are included if they are maintained for more than thirty minutes. Such consumptions may be maintained as a separate offset variable.

Referring again to Figure 3, at item S3a, the main product loop starts. At item S3b, the product has been switched on and a start-up routine is run. At item S3c, it is determined whether the product is charging. If the result of the determination at item S3c is that the product is charging, then the SoC algorithm runs at item S3d and the main product loop then progresses to item S3e where it is determined whether the product is powering down. If the result of the determination at item S3e is that the product is not powering down, then main product loop returns to item S3c. If the result of the determination at item S3e is that the product is powering down, then the product is being switched off and a power-down routine is run at item S3f. After item S3f, the main product loop progresses to item S3g, where the main product loop ends. If the result of the determination at item S3c is that the product is not charging, then it is determined at item S3h whether the product is resting. If the result of the determination at item S3h is that the product is resting, then, at item S3i, the battery current is set to be the average PCB current draw at rest. The average PCB current draw at rest corresponds to the predefined PCB current consumption referred to above. As such, in this example, when the product is resting, the battery pack current used for Coulomb-counting is an assumed current value, rather than a measured current value. At item S3j, the SoC algorithm runs and the main product loop moves to item S3e. If the result of the determination at item S3h is that the product is not resting, then it is determined at item S3k whether the product is discharging. If the result of the determination at item S3k is that the product is discharging, then the SoC algorithm runs at item S3I and, subsequently, the runtime algorithm runs at item S3m. The main product loop then progresses to item S3e.

Main SoC Algorithm Routine

Referring to Figure 4, there is shown a flowchart of an example of an SoC algorithm routine. The SoC algorithm routine performs several calculations which are used to evaluate the SoC of the battery pack. In this example, the code is executed approximately every 250ms, which corresponds to the target sampling rate in this example. Further calculations are performed when the product is discharging, since the runtime algorithm uses additional parameters to those used by the SoC algorithm. In this example, the SoC algorithm also keeps track of the accumulated time used throughout integration, referred to herein as the “accumulated integration time” or the“integration time”. Such integration may correspond to the trapezoidal approximation described above. In this example, the accumulated integration time is used to estimate the current offset error, I err . Using the accumulated integration time may enhance performance of the SoC algorithm compared to the accumulated integration time not being used. As will be described in more detail below, the integration time is the total time over which SoC errors have been accumulated during a particular recalibration period. This may correspond to the sum of all the (approximately) 250ms sampling periods during that recalibration period. The integration time may be used to calculate an SoC value based on Coulomb-counting. This, in turn, is used to estimate the current offset error, I err . The integration time may also be used to check that enough time has passed over which SoC errors have been accumulated, where the SoC errors correspond to differences between predicted and observed SoC values.

Referring again to Figure 4, at item S4a, the SoC algorithm routine starts. At item S4b, it is determined whether the mode of the product has changed. In this example, this relates to the mode of the product either changing from charging to discharging or changing from discharging to charging. In this example, discharging, followed by resting, and then followed by discharging again is not treated as a mode change. If the result of the determination at item S4b is that the mode has changed, then a mode change routine runs at item S4c. If the result of the determination at item S4b is that the mode has not changed, then, at item S4d, a time delay parameter, Time Delay, is set as Time Delay = Current— Previous Time, where Current (Time) is a current time parameter and Previous Time is a previous time parameter. Where the target sampling rate is 250ms, the value of Time Delay is expected to be 250ms. However, in this example, the SoC algorithm routine calculates the time delay parameter, as opposed to setting it as the target value. Calculating the time delay results in more accurate SoC than setting the time delay as the target value. At item S4d, the Previous Time parameter is also set as the current time, Current Time. As such, the value of the Previous Time parameter the next time the SoC algorithm routine runs will be the present Current Time value. At item 4e, the battery pack current parameter, Battery Pack Current, is obtained. In this example, the Battery Pack Current corresponds to the measured current level, / measured , but compensated with the estimated current offset error, I err . At item S4f, it is determined whether the product is charging. If the result of the determination at item S4f is that the product is not charging (in other words, if the product is discharging), then various runtime state parameters used by the runtime algorithm are obtained at item S4g. In this example, the runtime state parameters include the battery pack average voltage (in other words, the average voltage of the cells of the battery pack) and the battery pack voltage range (in other words, the difference between the maximum voltage and the minimum voltage of the cells of the battery pack). In this example, the runtime state parameters include a computed battery pack power. In this example, the runtime state parameters include temperature values (run through an analog-to-digital- converter) for the battery pack, converted into °C. In this example, the runtime state parameters include an energy counter value, DE, which is computed as DE = (DPower/ 2) x Time Delay. Following the processing at item S4g, or if the result of the determination at item S4f is that the product is charging, then various battery state estimation parameters used by the SoC algorithm are obtained at item S4h. In this example, the battery state estimation parameters include an initial capacity parameter, which is calculated as Initial Capacity = Initial SoC x Max Capacity. In this example, Initial Capacity is the capacity at t = 0, which corresponds to the Initial Capacity at the start of the present recalibration period and not necessarily at the start of the present loop of the SoC algorithm routine. In this example, the battery state estimation parameters include a Coulomb counter value, calculated as DCoulomb -= (DCurrent /2) x Time Delay, where DC urrent corresponds to the battery current during the Time Delay period based on the measured current, / measured , with the estimated current offset error, I err . The“-=” notation indicates that the DCoulomb value for the present loop of the SoC algorithm routine equals the DCoulomb value for the previous loop of the SoC algorithm routine minus the (DCurrent/ 2) x Time Delay value of the present loop. As such, DCoulomb corresponds to an accumulated charge, accumulated over the integration time. As indicated above, in this example, DCurrent will have a negative sign when the product is discharging and will have a positive sign when the product is charging. In this example, the battery state estimation parameters include a current capacity parameter which is calculated as Current Capacity = Initial Capcity— DCoulomb. In this example, Current Capacity therefore corresponds to the initial capacity at the beginning the present recalibration period, minus the total accumulated change in capacity during the recalibration period. In this example, the battery state estimation parameters include an SoC parameter, calculated as SoC = Current Capacity /Max Capacity. At item S4i, it is determined whether the current offset error, I err , is static. Whether or not the current offset error, I err , is static may be determined in various different ways. In this example, the current offset error, l err , is considered to be static once it has been estimated a predetermined number of times. In other examples, the current offset error, I err , may be considered to be static once it differs from a previously-estimated current offset error, I err , by less than a threshold value. If the result of the determination at item S4i is that the current offset error, I err , is not static, then the integration time is accumulated at item S4j. Accumulating the integration time may correspond to adding the value of the Time Delay parameter to an existing integration time value. The SoC algorithm routine then finishes at item S4k. If the result of the determination at item S4i is that the current offset error, l err , is static, then the SoC algorithm routine finishes at item S4k. In this example, once the current offset error, I err , is static, the integration time is no longer accumulated. This is because, in this example, the integration time is used to estimate the current offset error, l err . In this example, the integration time is not used to estimate the maximum capacity of the battery, Q max , which, in this example, occurs once the current offset error, I err becomes static.

Start-up Routine

Referring to Figure 5, there is shown a flowchart of an example of start-up routine. In this example, the start-up routine is executed when the product is triggered from a shut-down state. This happens only once, when the product is first turned on, for example during product assembly. Persistent data is initialised during product assembly when the battery pack and BMS PCB are joined together. In this example, the start-up routine waits until the battery data management chip is operational so that the battery data management chip can successfully read the battery pack cell voltages. This may correspond to a delay of around one second. In this example, a minimum cell voltage condition of 2.50V is implemented such that the start-up algorithm does not erroneously initialise the persistent data if the BMS PCB is powered up without a battery pack. This is because voltages lower than 2.50V may be used during testing without a battery pack being connected. Further conditions may be used to enable the initialisation process to be executed correctly. For example, the start-up routine may identify which cells are being used in the battery pack. Different instances of the core BMS code may be used for different cell types and/or chemistries. However, the production line may check that the BMS code and cells being assembled are matched correctly.

Returning now to Figure 5, at item S5a, the start-up routine starts. At item S5b, an attempt is made to read data from a persistent storage memory location. At item S5c, it is determined whether data has already been written to that location. If the result of the determination at item S5c is that data has not already been written to that location (i.e. if “Data Written == False" is “Yes”), then, at item S5d, the battery pack average voltage is obtained, which involves the start-up routine waiting for the battery data management chip to power up. The start-up routine then proceeds to item S5e, where it is determined whether the average cell voltage is greater than 2.5V. If the result of the determination at item S5e is that the average cell voltage is not greater than 2.5V, then the start-up routine ends at item S5f. If the result of the determination at item S5e is that the average cell voltage is greater than 2.5V, then, at item S5g, the start-up routine identifies which type of cell is being used in the battery pack and relevant static data for the identified cell is selected. The static data may comprise the maximum capacity, Q max , an OCV reference curve for the cell and/or predicted EOD resistance values, W eod . The start-up routine then proceeds to item S5h, where the start-up routine runs an OCV-to-SoC binary search with linear interpolation and stores the results as SocEstimate. The OCV-to-SoC binary search with linear interpolation corresponds, in general, to looking up the SoC value for a given voltage value. In this example, the given voltage value is the battery pack average voltage obtained at item S5d.

Following the OCV-to-SoC binary search with linear interpolation at item S5h, the start- up routine proceeds to item S5i, where persistent data storage is initialised. In this example, this involves storing the following values: D ata Written = True, Flag Current Of f set = 0, PCB Current Offset Error = 0 mA, DC oulomb = 0, DEnergy = 0, Accumulated DSoc = 0, Accumulated Integration Time = 0, Max Capacity = 2800 x 3600 ( mAs ), Initial SoC = SocEstimation (% x 100), Final SoC = SocEstimation (% x 100), and Last State = Discharge. The maximum capacity value is based on the nominal initial capacity value of 2800mAh as described above. At item S5j, the persistent data is copied into a temporary persistent data structure. At item S5k, the start-up routine ends. If the result of the earlier determination at item S5c is that data has already been written to that location (i.e. if “Data Written == false" is“No”), the start-up routine proceeds to item S5j and then item S5k.

Power-down Routine

Referring to Figure 6, there is shown a flowchart of an example power-down routine. In this example, the power-down routine is executed before the product completely shuts down. In this example, shut-down is executed after the product has been resting for thirty minutes. In this example, the SoC estimation is performed prior to shut-down in view of the turn-on time for the battery data management chip and a target turn-on time for the product. The SoC estimation is later used during product start-up within the mode change routine, with little or no effect on the turn-on time of the product. With reference again to Figure 6, at item S6a, the power-down routine starts. At item S6b, it is determined whether the product has been resting for at least a threshold amount of time. In this example, the threshold amount of time is thirty minutes. If the result of the determination at item S6b is that the product has been resting for at least thirty minutes, then, at item S6c, it is determined whether the current offset error, I err , is frozen. The current offset error, I err , being frozen corresponds to the current offset error, l err , being static. It the result of the determination at item S6c is that the current offset error, I err , is frozen, then the power-down routine obtains the battery pack average voltage at item S6d. At item S6e, an OCV-to-SoC binary search with linear interpolation is run and the result is stored as SocEstimation. At item S6f, the temporary persistent data structure is written into persistent storage. At item S6g, the power-down routine ends.

Mode Change Routine

Referring to Figure 7, there is shown a flowchart of an example mode change routine. In this example, the mode change routine evaluates the recalibration steps which should be executed when a specific mode change is detected. A mode change comprises a change from a previous discharge condition to a charge condition or from a previous charge condition to a discharge condition. Resting states that may occur between charging and discharging or between discharging and charging are, in this example, neglected. In this example, the mode change routine evaluates the maximum capacity, Q max , when the current offset error, I err , estimation becomes static and when the average cell voltage from the battery pack is above a voltage level threshold. In this example, the voltage level threshold is 4.00V. The voltage level condition means that the SoC algorithm does not perform unnecessary recalibrations when the product is used within its mid-point operating range, i.e. around 3.70V. In this example, a similar threshold condition is used for the current offset error estimation, which, in this example, is only computed when the average cell voltage is below 3.15V. If the average cell voltage is below 3.15V, the SoC value would, however, be underestimated. In this example, a small SoC offset value is used in conjunction with the estimated SoC value, where the estimated SoC value is computed from the OCV reference curve and binary search function. The SoC offset value may, for example, be +1 %. However, more generally, the SoC offset value, in examples, lies between 0% and +3% SoC. In this example, the offset value corresponds to an SoC adjustment value. The estimated SoC value will always be under-valued for this particular condition. As the voltage decreases, the amount of time taken for the voltage of the battery pack to relax to the OCV value increases. At higher voltages and SoCs, it takes less time for the voltage of the battery pack to relax. As such, at lower voltage levels, the voltage of the battery pack goes to the OCV value more slowly. The OCV reference curves assume that the voltage of the battery pack has relaxed to the OCV value. If the OCV reference curve is used before the voltage of the battery pack has relaxed, the voltage of the battery pack will be less than the OCV value (while the battery is being discharged) and, hence, the SoC based on the measured voltage of the battery pack (i.e. the observed SoC) will be less than the SoC based on the OCV. Instead of waiting for the voltage of the battery pack to relax, the mode change routine uses the SoC adjustment value to account for the fact that the SoC will be underestimated. In this example, an extra 1 % SoC is added to account for the underestimating. The final SoC offset value may be adjusted to improve estimation performance. For example, the SoC offset value may be based on how long the product has been resting, how much the voltage of the battery pack has changed etc. For example, if the product has not been resting for very long, a higher offset value may be used, as the voltage of the battery pack would be further away from the OCV value.

Returning now to Figure 7, at item S7a, the mode change routine starts. At item S7b, it is determined whether the mode change corresponds to a change from a charging condition to a discharging state. If the result of the determination at item S7b is that the mode change does not correspond to a change from charging to discharging (i.e. if the mode change is from discharging to charging), then the battery pack average cell voltage is obtained at item S7c. At item S7d, an OCV-to-SoC binary search with linear interpretation is run based on the battery pack average cell voltage and the result is stored as SocEstimation. At item S7e, it is determined whether the battery pack average cell voltage is less than 3.15V. If the result of the determination at item S7e is that the battery pack average cell voltage is not less than 3.15V, then the mode change routine sets SocEstimation = Final SoC. If the result of the determination at item S7e is that the battery pack average cell voltage is less than 3.15V, then the mode change routine sets SocEstimation+= 100. This means that the mode change routine adds 100 (corresponding to 1 %) to the SocEstimation value obtained at item S7d. At S7h, it is determined whether the current offset error, l err , is static. If the result of the determination at item S7h is that the current offset error, l err , is not static, then the mode change routine sets SocEstimation = Final SoC and the current offset error estimation routine runs. If the result of the determination at item S7h is that the current offset error, I err , is static, then, at item S7j, the mode change routine sets Initial SoC = SocEstimation (% x 100), Final SoC = SocEstimation (% x 100), DCoulomb = 0, DEnergy = 0 and PreviousTime = BQ Initial Time. At item S7k, the mode change routine ends. If the result of the determination at item S7b is that the mode change corresponds to a change from charging to discharging, then, at item S7I, it is determined whether the previous voltage is greater than 4.0V. If the result of the determination at item S7I is that previous voltage is not greater than 4.0V, then, at item S7m, the mode change routine sets SocEstimation = Final SoC and the routine proceeds to item S7j. If the result of the determination at item S7I is that the previous voltage is greater than 4.0V, then, at item S7n, an OCV-to-SoC binary search with linear interpolation is run and the result is stored as SocEstimation. At item S7o, it is determined whether the current offset error, I err , is static. If the result of the determination at S7o is that the current offset error, I err , is not static, then, at item S7p, the mode change routine sets Accumulated DSoC+= (SocEstimation— Final SoC) and the mode change routine proceeds to item S7j (the notation“+=” meaning taking the previous value of Accumulated DSoC and adding ( SocEstimation— Final SoC ) to arrive at the new value for Accumulated DSoC). As will be explained in more detail below, this means that the mode change routine adds the latest difference between the observed and predicted SoC values, denoted, DSoC, to previously accumulated DSoC values. If the result of the determination at S7o is that the current offset error, I err , is static, then, at item S7q, the mode change routine sets Accumulated DSoC = ( SocEstimation— Final SoC), sets Final SoC = SocEstimation (% x 100), runs the maximum capacity estimation routine, and sets Initial SoC = SocEstimation (% x 100). The mode change routine then proceeds to item S7j. In this example, the mode change routine is not run as a loop (for example every 250ms), but is executed when a mode change is detected.

Current Offset Error Estimation Routine

Referring to Figure 8, there is shown a flowchart of an example of a current offset error estimation routine. In this example, the current offset error estimation routine evaluates the current offset error, I err . As described above, the current offset error, I err , is inherently present in the PCB battery pack current measurements at BOL (beginning of life). The current offset error, I err , is computed, in this example, by combining (i) the accumulated SoC errors, DSoC err (also denoted herein as “Accumulated DSoC"), observed during the current offset error recalibration period and (ii) the integration time over which the SoC errors have been accumulated, ATime (also denoted herein as “AcclntegrationTime”). In this example, the current offset error, I err , is calculated as:

where / err (t j ) is the present estimation of the current offset error, I err , I err (t i - 1 is the previous estimation of the current offset error, I err , from the previous current offset error recalibration period, DSoC err is the accumulated SoC error observed during the recalibration period, Q max , is a static maximum capacity of the battery pack and DTime is the accumulated integration time used throughout the Coulomb-counting integration. As such, in this example, the current offset error, / err (t j ), is associated with the accumulated SoC error, DSoC err , which is associated with a difference between a predicted SoC of the battery pack (obtained, for example, via Coulomb counting) and an observed SoC of the battery pack (obtained, for example, via OCV reference). Further, in this example the current offset error, / err (t i ) is calculated based on a previously- calculated current offset error, I err (t i - 1 · This example current offset error estimation routine provides a highly stable response as the output behaviour of the current offset error estimation routine is governed by a negative feedback system, by minimising the accumulated SoC error, DSoC err , such that the predicted current offset error, I err , converges towards the actual the current offset error, I err , when DSoC err = 0. In this example, a predetermined number estimation attempts for the current offset error, l err , is performed in order to achieve convergence. In a specific example, the default predetermined number of estimation attempts is seven. However, in other examples, a different value between five and fifteen attempts is used. As will be explained in more detail below, additional estimation attempts for the current offset error, I err , will in general lead to a more accurate estimation of the current offset error, l err . However, it has been identified that the current offset error, I err , becomes relatively static after around five to fifteen estimation attempts. As will be described in more detail below, after the current offset error, l err , has become static, a maximum capacity estimation routine proceeds to estimate the maximum capacity of the battery pack, Q max · Starting the maximum capacity estimation routine after a relatively small number of current offset error estimation attempts may be effective long-term. As such, performing between five and fifteen attempts allows time for the current offset error, l err , to converge to an acceptable value, whereupon the maximum capacity of the battery pack, Q max , can start to be estimated. In other examples, a single estimation attempt for the current offset error, I err , could be used. This would still provide a degree of recalibration of the current offset error, I err , relative to an initial current offset error, l err , but multiple estimation attempts will in general lead to a more accurate estimation of the current offset error, I err . In this example, the present example current offset error, l err , estimation is attempted only once enough SoC error has accumulated over time. In this example, this is determined using ATime as a proxy. In particular, it is assumed that enough SoC error has accumulated once ATime exceeds a threshold value.

It can be seen from the above example equation for the current offset error, I err , that the current offset error, I err , is dependent on the value of DSoC err . In some examples, the current offset error, l err , may be adjusted based on the value of DSoC err . For example, if DSoC err is positive, then the current offset error, I err , may be increased and if DSoC err is negative, then the current offset error, I err , may be decreased. The amount of the increase or decrease may be related to the value of DSoC err . Although the accumulated SoC error observed during the recalibration period, DSoC err , and the accumulated integration time, ATime, may be used to determine the size of the adjustment to the current offset error, l err , in some examples, the accumulated SoC error and/or the accumulated integration time are not used. For example, a predetermined adjustment value may be used to increase and/or decrease the current offset error, I err , based on DSoC err .

Returning now to Figure 8, at item S8a, the current offset error estimation routine starts. At item S8b, it is determined whether the accumulated integration time exceeds an accumulated integration time threshold. In this specific example, the accumulated integration time threshold is one hour. The accumulated integration time is denoted DIntegration Time in Figure 8. It is envisaged that the accumulated integration time associated with a charge and discharge will, in practice, generally be at least one hour. If the result of the determination at item S8b is that the accumulated integration time does not exceed the accumulated integration time threshold, then the current offset error estimation routine ends at item S8c. If the result of the determination at item S8b is that the accumulated integration time exceeds the accumulated integration time threshold, then it is determined whether the current offset error, I err , is static. If the result of the determination at item S8c is that the current offset error, l err , is static, then the current offset error estimation routine ends at item S8c. If the result of the determination at item S8c is that the current offset error, I err , is not static, then, at item S8d, the current offset error estimation routine increments the value of Current Of f set Attempts by one (denoted “Current Off set Attempts + +”) in Figure 8, sets Final SoC = Initial Soc, sets DCoulomb = 0, sets DEnergy = 0 and calculates / err (t i ) as indicated above. Setting DCoulomb = 0 and DEnergy = 0 reinitialises the Coulomb counter, DC, and the energy counter, DE, ready for the next current offset error estimation recalibration period. At item S8e, the current offset error estimation routine calculates I err,damped (t i ) ( I err (t i ) + I err (t i - 1 ) , where I err,damped is the average of the previous current offset error, / err (t i-1 ), and the present current offset error, / err (t i )· As such, in this example, / err (t i ) is a preliminary current offset error estimation and I err,damped (t i ) is the current offset error estimation that is stored and used for Coulomb-counting. This introduces an element of damping to the current offset error estimation. This, in turn, provides a degree of stability and can assist in mitigating unnecessary oscillations in the current offset error, / err (t i ) . Although, in this example, I err,damped is the average of the previous current offset error, I err (t i - 1 , and the present current offset error, / err (t i ), in other examples, I err,damped is a different function of the previous current offset error, I err (t i - 1 , and the present current offset error, / err (t i ) . In general, non-zero-weighted contributions of both the previous current offset error, I err (t i - 1 , and the present current offset error, / err (t i ), may be used to calculate I err,damped . Where the average value is used, then the non-zero contributions are 50% I err (t i - 1 and 50% / err (t i )· However, the contributions may be different in other examples. At item S8f, the current offset error estimation routine sets DIntegration Time = 0 and Accumulated DSoC = 0, and processing moves to item S8c. This reinitialises the integration time and the accumulated SoC error.

The SoC algorithm adaptively attempts to estimate adaptive parameters relating to current offset errors, I err , and capacity degradations, one-at-a-time. In this example, the SoC algorithm attempts to estimate the current offset error first, I err , while assuming a constant battery pack capacity value, Q max· Once the current offset error, I err , is static, the SoC algorithm then attempts to estimate the battery pack capacity value, Q max , in view of capacity degradations, assuming a constant current offset error, I err . Since the capacity of the battery pack, Q max , is known with relatively high confidence at BOL, the SoC algorithm initially attempts to estimate the current offset error, I err , during the first few cycles when the product is initially used at BOL. In this example, the impact of differences between the estimated current offset error, I err , and the actual value is greater at lower measured current values, and that impact is compounded by being integrated over a longer integration time. The initial current offset error, I err , value may be refined based on the actual error tolerances on the production PCB when these are known. In such cases, the expected current offset error, l err , is likely to be close to the error specified within the datasheet of the production PCB. However, errors over the lifetime of the product may drift from their initial value, for example after prolonged exposure to high levels of humidity and/or temperatures. The SoC algorithm may operate within its production specification even with small changes to the estimated current offset error, I err , for example where the change is less than 10%. In this specific example, the shunt resistance maximum, nominal, and minimum resistance values of the BMS PCB are R max @100°C = 1.03 MW , R nominal @25°C = 1.00 mΩ , and R min @0°C = 0.978 mΩ . In this specific example, the worst-case current offset error is max(/ err ) = 360 mA. In some examples, the current offset error, I err , is recalibrated after it has become static. For example, the SoC algorithm may make five to fifteen attempts to recalibrate the current offset error, I err , then use a static current offset error, I err , for a specified number of cycles while the maximum capacity, Q max , is estimated, and then recalibrate the current offset error, l err , for a specified number of cycles while the latest estimated maximum capacity, Q max , is frozen, and so on. In such examples, the number of number of cycles used for subsequent recalibration of the current offset error, I err , may be less than the number of cycles used for recalibration of the estimated maximum capacity, Q max .

Maximum Capacity Estimation Routine

Referring to Figure 9, there is shown a flowchart of an example of a maximum capacity estimation routine. The maximum capacity estimation routine periodically recalibrates the maximum capacity, Q max · In this example, the maximum capacity estimation routine measures OCV values during steady-state conditions before and after an extended discharge or charge period, determines corresponding SoC values, and integrates the current between the OCV measurements: '

The current used by the Coulomb counter,DC , will be based on the measured current, adjusted using the now-static current offset error, I err . SoC init is the initial, observed SoC estimation value after a mode change is detected. In this example, SoC init is obtained by measuring the battery pack voltage at an initial time and obtaining a corresponding SoC value based on the measured battery pack voltage. In this example, SoC final is the final, observed SoC estimation when the maximum capacity estimation routine is called. In this example, SoC final is obtained by measuring the battery pack voltage at a final time and obtaining a corresponding SoC value based on the measured battery pack voltage. As such, in this example, the maximum capacity, Q max , is estimated based on the Coulomb counter, DC , data which represents the difference between the predicted amount of charge of the battery at the initial time and the predicted amount of charge of the battery at the final time. The predicted amount of charge of the battery at the initial and final times are based on the now-static current offset error, l err . SoC init - SoC final represents a difference between an observed amount of charge of the battery between the initial and final times. The above calculation means, in effect, that the battery pack may not need to be fully charged and discharged in order to determine the maximum capacity, Q max , throughout the lifetime of the product. In this example, the maximum capacity, Q max , is estimated when the initial and final SoC values have been estimated from the OCV-to-SoC reference curve. Using the SoC estimation calculated during runtime through Coulomb-counting evaluates the same maximum capacity, Q max , value. In this example, the computed maximum capacity value, Q max , is averaged out over several estimations. This can provide greater accuracy and robustness than only using a latest estimated value. In this example, the averaging is implemented through a weighting average, where the weighting is based on 3/4 of the previous maximum capacity value and 1/4 of the latest maximum capacity value.

With reference again to Figure 9, at item S9a, the maximum capacity estimation routine starts. At item S9b, it is determined whether the initial SoC, SoC init , (denoted“Initial SoC” in Figure 9) is different from the final SoC, SoC final , (denoted“Final SoC” in Figure 9). If the result of the determination at item S9b is that the initial SoC, SoC init , is the same as the final SoC, SoC final , (i.e. if“Initial Soc ! = Final Soc” is“No”) then the maximum capacity estimation routine ends at item S9c. If the result of the determination at item S9b is that the initial SoC, SoC init , is different from the final SoC, SoC final , (i.e. if“Initial Soc ! = Final Soc” is“Yes”) then, at item S9d, the maximum capacity estimation routine determines whether the threshold of,C oulomb > (Max Coluombs/2 ) is met. In other words, item S9d involves checking whether the change in the Coulomb-counter value is more than half of the maximum capacity of the battery pack, Q max . If the result of the determination at item S9d is that DCoulomb £ (Max Coluombs/2), then the maximum capacity estimation routine proceeds to item S9c. As such, small Coulomb-counter values (relative to the maximum capacity of the battery pack, Q max ) may, in effect, be disregarded. If the result of the determination at item S9d is thatDC oulomb > (Max Coluombs/2), then, at item S9e, the maximum capacity estimation routine determines whether the current offset error, l err , is static. If the result of the determination at S9e is that the current offset error, l err , is not static, then the maximum capacity estimation routine proceeds to item S9c. If the result of the determination at S9e is that the current offset error, I err , is static, then, at item S9f, the maximum capacity estimation routine calculates Q max = DC/(SoC init - SoC final ). At item S9g, the maximum capacity estimation routine determines whether the change in the maximum capacity compared to the previous maximum capacity, DQ max , is less than a maximum capacity change threshold. In this specific example, the maximum capacity change threshold is Q max / 10. If the result of the determination at item S9g is that the change in maximum capacity, DQ max , is not less than the maximum capacity change threshold, then the maximum capacity estimation routine proceeds to item S9c. As such, significant variations between subsequent maximum capacity estimations may be handled. If the result of the determination at item S9g is that the change in maximum capacity, DQ max , is less than the maximum capacity change threshold, then, at item S9h, the maximum capacity estimation routine updates the maximum capacity value, Q max , and the maximum capacity estimation routine proceeds to item S9c.

SoC Algorithm Summary

A practical SoC algorithm has been described above. The SoC algorithm includes adaptive subroutines which attempt to perform online estimations of the capacity degradation over time and analysis of parasitic measurement errors emanating from PCB components and manufacturing variability in order to improve the stability and response of the SoC algorithm over the lifetime of the product.

Examples use the Coulomb-counting technique, in which discharge current is integrated over time, so as to calculate percentage battery charge remaining. In examples, the SoC algorithm makes adjustments to compensate for errors manifesting in current measurement, and for long-term battery degradation. In examples, the SoC algorithm presumes that negligible battery degradation takes place early in the lifetime of the product, and iteratively calculates an offset, I err , to compensate for current measurement errors. After the product has been used sufficiently for iteration of the offset, l err , to have reached a given level of accuracy, the offset, I err , is frozen and is used, in some examples, for the rest of the lifetime of the product. Once the offset, I err , has been frozen, the SoC algorithm periodically recalibrates itself to account for decreasing battery capacity due to degradation, so that remaining charge is not over-estimated. The SoC algorithm differs from, for example, performing a single calibration, to account for current measurement errors, during assembly of a product. Recalibrating the current offset error, I err , during use of the product provides more accurate, ongoing, estimation. The iterative nature of the current offset error calculation has been described above in accordance with some examples. Battery degradation calibration, the damped nature of the iteration of the current offset error, I err , and the point in time at which the offset, I err , is frozen and the SoC algorithm begins accounting for battery degradation have all been described in detail above.

Various measures (for example, methods, processors, systems, products, electronic devices, computer programs and computer-readable media) are provided in relation to estimating an amount of charge (e.g. SoC) of a battery. A current offset error, l err , associated with a difference between a predicted amount of charge of the battery and an observed amount of charge of the battery is calculated. The estimated current offset error, I err , is indicative of an error in a measured amount of current, l measured · The amount of charge of the battery is estimated using the estimated current offset error, I err . The amount of charge may be expressed as an SoC value or otherwise. The battery may be in the form of a battery pack comprising a plurality of cells, or otherwise. The predicted amount of charge may be based on Coulomb-counting. The observed amount of charge may be based on a measured voltage at rest and OCV reference. Using the estimated current offset error, l err , to estimate the amount of charge of the battery may provide a more accurate estimation of the amount of charge of the battery than if no current offset error, I err , is used, or if a preconfigured current offset error, l err , set during assembly is used.

In examples, the calculating of the current offset error, / err (t i ), is based further on a previously-calculated current offset error, I err (t i - 1 . In some such examples, the current offset error, I err , is calculated iteratively, based at least in part on the previously-calculated current offset error, I err (t i - 1 · In some such examples, the predicted amount of charge of the battery is based on the previously-calculated current offset error, I err (t i - 1 . As such, the current offset error, / err (t i ) , which is associated with the predicted amount of charge of the battery, is also based on th e previously-calculated current offset error, / err (t i ). Calculating the current offset error, / err (t i ), in this way may provide more stable estimations than if only one estimation of the current offset error, I err , is used.

In some examples, the calculating of the current offset error, I err,damped (t i ), comprises: (i) calculating a preliminary current offset error, / err (t i ), based on the difference between the predicted amount of charge of the battery and the observed amount of charge of the battery, and (ii) using non-zero-weighted contributions of both the preliminary current offset error, / err (t i ), and the previously-calculated current offset error, I err (t i - 1 , to calculate the current offset error, I err,damped (t i ). In such examples, the current offset error may correspond to the damped current offset error value, I err,damped (t i ) , described above. This provides stability to the current offset error estimation.

In examples, the predicted amount of charge of the battery is based on the previously- calculated current offset error, I err (t i - 1 . As explained above, in examples, the predicted amount of charge of the battery is obtained using Coulomb-counting which involves using a previously-calculated current offset error, I err (t i - 1 , from a previous recalibration period.

In examples, the estimating of the current offset error, / err , is based further on a static maximum battery capacity, Q max . More accurate estimations of the current offset error, / err , may be obtained in this way, compared to estimating both the current offset error, / err , and the maximum battery capacity simultaneously, Q max ·

In examples, the estimating of the amount of charge of the battery is based further on the static maximum battery capacity, Q max · For example, the amount of charge of the battery may be expressed as an SoC value, using the static maximum battery capacity, Q max , and the determined available capacity, Q available ·

In examples, the predicted amount of charge of the battery is based on an amount of current measured during an integration time. As such, the predicted amount of charge of the battery may be based on observed current measurements.

In examples, the calculating of the current offset error, / err , is dependent on the integration time being greater than an integration time threshold. As such, the current offset error, / err , may be evaluated when sufficient SoC errors have accumulated. This may, in turn, increase the accuracy of the current offset error estimation, I err .

In examples, the calculating of the current offset error, / err , is based further on the integration time. This can provide for more accurate current offset error estimation. Using the integration time enables the size of the current offset error estimation, / err , to be determined more accurately.

In examples, the calculating of the current offset error, / err , is in response to detecting a change-of-mode from discharging to charging. Errors based on the current offset error, / err , can thereby be accumulated during charging state such that SoC errors may be determined and accumulated at a higher voltages, where voltages are closer to OCV voltages.

In examples, the predicted amount of charge of the battery and the observed amount of charge of the battery are calculated in response to detecting a change-of-mode from charging to discharging. As such, the predicted and observed amounts of charge are calculated when the voltage is relatively close to the OCV value. This, in turn, provides a more accurate observed amount of charge of the battery than if the observed amount of charge was calculated at a lower voltage, further away from the OCV value. In examples, the change-of-mode from discharging to charging is prior to the change-of- mode from charging to discharging. As such, the SoC accumulation may be based on the current offset error estimation.

In examples, the estimated current offset error, I err , is set as a static current offset error, I err , in response to a trigger event. It has been identified that the estimated current offset error, I err , settles close to its actual value after a relatively small number of cycles. Setting the estimated current offset error, l err , as opposed to carrying on estimating it, provides more efficient processing. Further, inaccuracies in the static current offset error, I err , may be accounted for during the second recalibration phase.

In examples, the trigger event corresponds to current offset error calculation having been performed a predetermined number of times. It has been identified that the current offset error, I err , may effectively be fixed once it has been estimated a predetermined number of times. This provides a relatively efficient mechanism for switching from the first recalibration phase to the second recalibration phase.

In examples, an estimated maximum battery capacity, Q max , is calculated based on: (i) a change, DC , in a predicted amount of charge of the battery between first and second times, the change in the predicted amount of charge of the battery between first and second times being based on the static current offset error, I err , and (ii) a difference, SoC init - SoC final , between an observed amount of charge of the battery between the first and second times. Degradation of the battery may be taken account in relation to estimating the maximum battery capacity, Q max . This can, in turn, lead to more accurate estimations of the amount of charge of the battery.

In examples, the calculating of the estimated maximum battery capacity, Q max , is dependent on a voltage of the battery being above a voltage level threshold. This may enable more accurate estimations of the maximum battery capacity, Q max , to be obtained when the voltage at rest is closer to the OCV value, compared to estimation being performed at any voltage level.

In examples, the observed amount of charge of the battery is based on an OCV reference look-up. Relatively accurate determinations of the observed amount of charge of the battery may thereby be obtained. This, in turn, improves the accuracy of the estimation of the current offset error, I err .

In examples, the observed amount of charge of the battery is caused to be stored in persistent memory in response to detecting a power-down condition, and the observed amount of charge of the battery is retrieved from the persistent memory in response to detecting a start up condition. This may improve performance in terms of responsiveness to user input. Various measures (for example, methods, processors, systems, products, electronic devices, computer programs and computer-readable media) are provided in relation to estimating a current offset error, I err , associated with errors manifesting in current measurements in an electronic device, and using the current offset error, I err , to estimate an amount of charge of a battery comprised in the electronic device. As such, more accurate estimations of the amount of charge of the battery may be obtained based on observed usage, compared to not using a current offset error, I err , or using a current offset error, I err , that is preconfigured at the point of assembly.

Various measures (for example, methods, processors, systems, products, electronic devices, computer programs and computer-readable media) are provided in which a processor of an electronic device comprising a battery estimates, during a first recalibration phase, a current offset error, I err , based on a static maximum capacity, Q max , of the battery, sets the estimated current offset error, I err , as a static current offset error, l err , and estimates, during a second recalibration phase, a maximum capacity of the battery, Q max , based on the static current offset error, I err . Long-term accuracy of the estimations of the amount of charge of the battery may thereby be achieved, by estimating the current offset error, I err , during the first recalibration phase and then estimating the maximum capacity, Q max , to account for long-term degradation of the battery.

Remaining Runtime Estimation

Battery pack runtime estimations are typically inaccurate or behave unpredictably after ageing when a considerable amount of capacity fading of the battery pack has occurred. A battery pack runtime estimation algorithm may relate Coulomb counter data for the battery pack to the remaining runtime. However, most battery-operated systems extract energy at constant power, that is at a variable current rate, so such runtime estimations are unlikely to be reliable. The example runtime algorithms described herein build on top of the SoC framework described herein. In examples, the runtime algorithm employs an energy-balance equation. In examples, the energy-balance equation relates to the useable energy, E batt , of the battery pack and the observed discharge power of the battery pack, P batt . In examples, the runtime algorithm incorporates adaptive and self-calibrating routines to improve the estimation accuracy and stability of the runtime algorithm over the lifetime of the product. In examples, the routines are adaptive in that the example runtime algorithm transitions from one type of estimation (for example, energy-based) to another type of estimation (for example, voltage gradient). In examples, the routines are self-calibrating in that parameters used to estimate the remaining runtime are recalibrated. Such recalibration may improve accuracy of subsequent runtime estimations made by the product. In examples, runtime estimation is based on an energy- balance equation whereby the remaining runtime is extracted (or“estimated”) by combining the usable energy, E batt , of the battery with the observed discharge power, P batt . In examples, the useable energy, E batt is estimated by derating the maximum energy of the battery pack, E max , using an end-of-discharge (EOD) predicted resistance value, W eod . In examples, the maximum energy, E max , is calculated from an OCV reference average, OCV avg , and the maximum available capacity, Q max . In examples, the OCV reference average is the average voltage of the cells in the battery pack, which serves as an OCV reference. In examples, the EOD predicted resistance value, W eod , varies according to the discharge power of the product. In examples, regular updates of estimation parameters are handled through the SoC framework described above. Examples of such estimation parameters include, but are not limited to, the maximum capacity, Q max , and current offset error, I err . In examples, a runtime estimation based on voltage gradients at lower SoC values is used to refine predicted values, for example of the EOD predicted resistance values, W eod , and to correct for errors emanating from the SoC estimation parameters. In examples, a runtime estimation based on thermal gradients at higher temperatures is used when a thermal cut-off condition occurs before a minimum cutoff voltage, V cutoff , is reached.

Runtime Algorithm

As explained above, in examples, the runtime algorithm is based on an energy-balance equation. In such examples, the maximum available energy of the battery pack, E max , is always greater than the predicted output work generated at any given power over time:

As also explained above, in examples, the useable energy of the battery pack, E batt , is approximated by derating the maximum available energy of the battery pack, E max , using a set of power-dependent EOD predicted resistance values, W eod , to generate an estimate of the remaining runtime. In examples, the set of EOD predicted resistance values, W eod , comprises a plurality of preconfigured EOD predicted resistance values, W eod , and the runtime algorithm uses one or more of the plurality of preconfigured EOD predicted resistance values, W eod , to estimate an EOD predicted resistance value, W eod , based on an observed discharge power of the product. In examples, the preconfigured EOD predicted resistance values, W eod , are reconfigured over time. In examples, the EOD predicted resistance values, W eod , are used to estimate energy losses, E loss , caused by internal polarisation voltages. In more detail, a cell in a battery pack experiences a voltage drop as a result of internal resistances. The internal resistances are dependent on the temperature of the cells in the battery pack and the SoC of the battery pack. Internal resistances change over time, in practice, but constant values may be used herein. The constant values may, for example, be the average values over time. The discharge power of the product affects the temperature of the cells in the battery pack. A higher discharge power corresponds to a higher temperature and a lower power corresponds to a lower temperature. The product may be operable in multiple different power modes. For example, the product may operate in a low-power mode, which is associated with relatively low temperatures and relatively high resistance values. The product may be operable in a medium power mode, which is associated with medium-level temperatures and resistance values. The product may be operable in a high-power mode, which is associated with relatively high temperatures and relatively low resistance values, as the battery pack heats up. In examples, the remaining runtime is estimated as follows:

In examples, the runtime algorithm inherits variables and parameters from the SoC estimation framework described above. For example, the runtime algorithm may use persistent data storage and estimation parameters such as SoC values, the current offset error, I err , and the maximum battery capacity, Q max · Similarly, in examples, the runtime algorithm uses the Coulomb counter, DC , and energy counter, DE, variables calculated by the SoC framework described above. As explained above, in some examples, the SoC algorithm does not use the energy counter, DE, itself but may nevertheless calculate it for use by the runtime algorithm. In some examples, the maximum energy of the battery, E max , remains constant after the initialisation routine of the runtime algorithm is executed and is recomputed only after a mode- change event is detected by the product. The maximum energy of the battery, E max , is dependent on the maximum capacity of the battery, Q max · Such recomputing of the maximum energy of the battery, E max , may therefore occur when the current offset error, I err , is static, for example. In particular, as explained above, in examples, the maximum capacity of the battery, Q max , is static during a first recalibration phase in which the current offset error, l err , is estimated, and the maximum capacity of the battery, Q max , is then estimated during a second recalibration phase in which the current offset error, I err , is static. For a completely charged cell, where SoC = 100%, the maximum energy of the battery, E max , may be approximated by multiplying the maximum capacity of the battery pack, Q max , and the OCV reference average voltage (the average of the voltages of all of the cells in the battery pack), OCV avg , with the number of cells in the battery pack in series, N series , such that:

For example, where OCV avg » 3.64 V , Q max = 2.80 Ah, and N series = 7, then E max = 3.64 x 2.80 X 7 » 70 Wh. In examples, the maximum capacity, Q max , is recomputed by the SoC algorithm over the lifetime of the product after, but not before, the current offset error, I err , is static. The maximum capacity, Q max , varies according to usage and/or environmental conditions. For example, there may be more degradation at higher current rates. Examples of environmental conditions include, but are not limited to, temperature and humidity. In examples, the maximum energy approximation set out above is only used when no mode change events have been detected during partial charge or discharge usage and only when parameters have been reinitialised for a fully-charged battery. Otherwise, the SoC of the battery pack would not be 100%. In examples, mode change events detected upon partial charge or partial discharge conditions (in other words, when SoC ¹ 100 %) modify the OCV reference average voltage, OCV avg , by taking the voltage value from the OCV reference array with an index corresponding to half of the SoC initial value, where the SoC initial value is the SoC value when the mode change is detected.

Runtime Formulation

Referring to Figure 10, there is shown an example of a graph illustrating several runtime estimation parameters for a 40W, single-cell discharge. During discharge, the polarisation voltage (in other words, voltage drop), V D , of a cell will reduce the terminal voltage, V cell , of the cell compared to the OCV value of the cell. The polarisation voltage, V D , also reduces the useable capacity, C D , of the cell. This is because the cutoff voltage, V cutoff , of the cell will be reached prematurely. The cutoff voltage, V cutoff , of the cell is a specified minimum voltage at which the cell operates. This can be seen in Figure 10, where the 40W curve reaches the cutoff voltage, V cutoff , at a higher SoC value then the OCV curve. In other words, during discharge, the cell will still have some remaining, unusable capacity when it cuts off at the cutoff voltage, V cutoff , . In the example shown in Figure 10, the remaining capacity corresponds to around 8% SoC. The polarisation voltage, V D , and the useable capacity, C D , of the cell can be expressed as follows:

SoC D is the SoC value at which the terminal voltage, V cell , of the cell equals the cutoff voltage V cutoff , of the cell. This equates to the difference between (i) the OCV of the cell, OCV(SoC), and (ii) the voltage drop, V D , equalling the cutoff voltage V cutoff , of the cell. In this situation, therefore:

According to Ohm's law, the equivalent Ohmic resistance, W , of the cell under load is given by: The Ohmic resistance, W, varies according to various electrochemical phenomena and temperature. Examples of electrochemical phenomena include, but are not limited to, migration and diffusion. Consequently, significant non-linear behaviour will be generated if this resistance value is directly used to estimate the remaining runtime of the battery pack. However, a more relevant parameter for runtime estimation is the internal resistance at EOD, W eod , which can be predicted for a given power. The polarisation voltage (in other words, the voltage drop) at EOD, V D,eod , is given by:

where I eod is the current at EOD. The current at EOD, I eod , may be calculated from:

From this, a more accurate SoC D estimation (in other words, estimation of the SoC value at which the voltage cutoff, V cutoff , occurs) can be calculated as:

This yields the following calculations for the useable capacity, C D , and useable energy, E & , of the cell:

Several estimation parameters used by the runtime algorithm are illustrated in Figure 10. The final formulation of the runtime estimation (presuming no thermal cut-off as discussed below) is, in examples, given by:

Initialisation Routine

The initialisation routine of the runtime algorithm is executed in response to a mode- change detection event or a power-on event. The initialisation of the runtime algorithm may be included within the initialisation routine of the SoC algorithm or may be separated within a different namespace. In this example, the initialisation routine of the runtime algorithm only includes a flag event to notify the system whether or not an EOD predicted resistance value, W eod , has already been updated.

In examples, other parameters and user-specified limits are hard-coded into firmware. Examples of such user-specified limits include, but are not limited to, the voltage cutoff, V cutoff , and thermal cutoff conditions. In this example, the EOD predicted resistance values, W eod , are read from the persistent data memory location and are stored in an integer array. In this example, the integer array includes three EOD predicted resistance values, W eod , one corresponding to a low power, another corresponding to a medium power and a third corresponding to a high power.

Memory Considerations

In this example, the EOD predicted resistance value, W eod , for the low power mode is 40W, for the medium power mode is 17W, and for the high power is 10W. These initial EOD predicted resistance values, W eod , of 40W, 17W and 10W have, in this example, been chosen based on experimental data. The initial EOD predicted resistance values, W eod , used by the system may be subject to adjustments when the battery pack assembly has been finalised or if a different battery type, chemistry, or size is used. These example initial EOD predicted resistance values, W eod , may be found by running the SoC algorithm and runtime algorithm against a set of complete low-, medium-, and high-power discharge profiles. In examples, the runtime algorithm automatically recalibrates the initial EOD predicted resistance values, W eod , over each full or partial discharge profile, with their values stabilising to a nominal value after several iterations. The initial EOD predicted resistance values, W eod , may be recalibrated, as described herein.

Main Routine

Referring to Figure 11 , there is shown a flowchart of an example of a runtime algorithm main routine. In this example, the runtime algorithm is called upon by the main product loop described above, running at the target sampling rate (for example, 250ms). In this example, the runtime algorithm is executed only during discharge. Other methods may be used instead during charging. A runtime feature for a charging regime may use output parameters from the SoC algorithm, for example. In this example, the runtime algorithm main routine is only executed when the discharge power is greater than 30W in absolute terms. This is because discharge powers lower than 30W, or approaching zero, may ultimately yield an infinite runtime value (and because in this case the product is designed to deliver more than 30W as a minimum). Other threshold discharge power values could be used, however. In examples, this means that the signed discharge power will be less than -30W, since power has a negative sign during discharge. In this example, the runtime algorithm includes sub-routines which estimate the runtime based on voltage gradients and thermal gradients. In this example, the voltage gradients and thermal gradients correspond to variations (or“differential changes”) in voltage and temperature respectively. In this example, the sub-routines effectively refine a nominal runtime estimation value, which is based on an energy-balance equation, to increase overall accuracy. Referring again to Figure 1 1 , at item S1 1a, the runtime algorithm main routine starts. At item S1 1 b, the initialisation routine runs. At item S1 1c, it is determined whether the discharge power is less than -30W. If the result of the determination at item S11 c is that the discharge power is not less than -30W, then the runtime is set to zero at item S1 1d and the runtime algorithm main routine ends at item S1 1e. If the result of the determination at item S1 1c is that the discharge power is less than -30W, then an EOD estimation routine runs at item S11f. Processing then proceeds to item S11 g, where a nominal runtime estimation routine runs. Processing then proceeds to item S1 1 h, where a recalibrate EOD predicated resistance routine runs. Processing then proceeds to item S1 1 i, where a voltage differential runtime estimation routine runs. Processing then proceeds to item S11 j, where a thermal differential runtime estimation routine runs. It is then determined at item S1 1 k whether the voltage runtime is less than the thermal runtime. If the result of the determination at item S11 k is that the voltage runtime is less than the thermal runtime, then, at item S11 I, the runtime is set as the voltage runtime and the runtime algorithm main routine ends at item S1 1 e. If the result of the determination at item S1 1 k is that the voltage runtime is not less than the thermal runtime, then, at item S11 m, the runtime is set as the thermal runtime and the runtime algorithm main routine ends at item S11 e.

EOD Resistance Estimation Routine

Referring to Figure 12, there is shown a flowchart of an example of an EOD estimation routine. In this example, the EOD resistance estimation routine evaluates the power mode of the product, denoted “Powerlndex” , in order to recalibrate the appropriate EOD predicted resistance value, W eod , stored in persistent memory. After identifying the power mode and, therefore, the associated EOD predicted resistance value, W eod , the EOD maximum current, I eod , and the EOD voltage drop V D,eod , are computed. In this example, the EOD resistance estimation routine also clips the SoC value evaluated by the SoC framework to be within the expected 0% and 100% range, as discussed previously. Furthermore, in this example, the final EOD predicted resistance value, W eod , (in other words, the EOD predicted resistance value, W eod , that will be used) is, in some examples, linearly interpolated between two known reference EOD predicted resistance values, W eod , via the triangle rule. This enables a reasonable EOD predicted resistance value, W eod , value to be selected when the power is between the baseline values used in the reference EOD predicted resistance value, W eod , array. In this example, this corresponds to power values between the baseline power values of 50W for low power, 250W for medium power, and 660W for high power. For example, for a discharge power of 100W, the EOD predicted resistance values, W eod , associated with the 50W and 250W values are linearly interpolated to give an estimated EOD predicted resistance value, W eod , for the 100W discharge power. The exact value of the reference power values for each power mode may be selected to reflect the main modes under which the product will operate and the data that was used to generate them.

In effect, the system linearly interpolates the EOD predicted resistance values, W eod , for the two closest power modes to the observed discharge power and selects the closest power mode to the observed discharge power. The EOD predicted resistance value, W eod , for that closest power mode is, in examples, then recalibrated as described in more detail below.

Referring again to Figure 12, at item S12a the EOD resistance estimation routine starts. At item S12b, it is determined whether the discharge power is greater than -250W. If the result of the determination at item S12b is that the discharge power is not greater than -250W, then, at item S12c, it is determined whether the discharge power is greater than -150W. If the result of the determination at item S12c is that the discharge power is not greater than -150W, then, at item S12d, the product is determined to be in the low power mode and the power index parameter is set to have a value of zero. Processing then proceeds to item S12e where the maximum current at EOD, I eod , is calculated based on the EOD predicted resistance value, W eod , associated with the power index. If the result of the determination at item S12c is that the discharge power is greater than -150W, then, at item S12f, the product is determined to be in the medium power mode, the power index parameter is set to have a value of one and processing proceeds to item S12f. If the result of the determination at item S12b is that the discharge power is greater than -250W, then, at item S12g, it is determined whether the discharge power is greater than -450W. If the result of the determination at item S12g is that the discharge power is not greater than -450W, then processing proceeds to item S12f. If the result of the determination at item S12g is that the discharge power is greater than -450W, then, at item S12h, the product is determined to be in the high power mode, the power index parameter is set to have a value of two and processing proceeds to item S12e. Once the maximum current at EOD has been calculated at item S12e based on the determined power mode, processing proceeds to item S12i at which the maximum voltage drop at EOD, V D,eod , is calculated from the maximum current at EOD, I eod , and the EOD predicted resistance value, W eod . Then, at item S12j, the battery capacity loss caused by the EOD voltage drop, V D,eod , is calculated. Then, at item S12k, it is determined whether the calculated final SoC value is less than 0%. If the result of the determination at item S12k is that the calculated SoC value is less than 0%, then, at item S12I, the final SoC value is set to 0% and the EOD resistance estimation routine ends at item S12m. If the result of the determination at item S12k is that the calculated SoC value is not less than 0%, then, at item S12n, it is determined whether the calculated final SoC value is greater than 100%. If the result of the determination at item S12n is that the calculated SoC value is greater than 100%, then, at item S12o, the final SoC value is set to 100% and the EOD resistance estimation routine ends at item S12m. If the result of the determination at item S12n is that the calculated SoC value is not greater than 100%, then the EOD resistance estimation routine ends at item S12m.

Nominal Runtime Estimation

Referring to Figure 13, there is shown a flowchart of an example of a nominal estimation routine. In this example, the nominal estimation routine computes the nominal runtime estimation from the final runtime formulation indicated above, namely:

Referring again to Figure 13, at item S13a, the nominal estimation routine starts. At item S13b, the nominal estimation routine calculates:

and

. At item S13c, the runtime algorithm nominal estimation routine ends.

EOD Predicted Resistance Recalibration

Referring to Figure 14, there is shown a flowchart of an example of an EOD predicted resistance recalibration. In this example, the EOD predicted resistance recalibration routine evaluates whether to recalibrate the EOD predicted resistance value, W eod , associated with the current power mode, as indicated by the Powerlndex parameter. In this example, recalibration is only performed when the system has identified a voltage cutoff condition and when the runtime estimation is outside a hysteresis error value. In this example, the voltage condition corresponds to the minimum cell voltage being less than or equal to the cutoff voltage, V cutoff ., The hysteresis error value may be an arbitrary value. In this example, the hysteresis error value is ±10 seconds. In this example, this means that recalibration is performed when the voltage cutoff condition occurs more than ten seconds before the end of the estimated runtime, or when there is more than 10 seconds of estimated runtime remaining when the voltage cutoff condition occurs. In this example, after recalibrating the EOD predicted resistance value, W eod , a flag is set to notify the runtime algorithm that the EOD predicted resistance value, W eod , has already been recalibrated. In this example, the EOD predicted resistance recalibration method takes the form of a simple increment or decrement change in the base value of the EOD predicted resistance value, W eod , of the associated power mode. Other, more complex methods may be used. However, the EOD predicted resistance value, W eod , is not expected to vary considerably over a relatively small number of cycles, for example over ten cycles. Any significant variations may be associated with errors in the SoC estimation or other stochastic factors such as ambient temperature, humidity, or usage. In examples, the EOD predicted resistance recalibration routine may be configured such that the base EOD predicted resistance value, W eod , does not vary by a significant amount as a result of the recalibration. The EOD predicted resistance value, W eod , for each power mode may be interpreted as a lump-sum resistance value that intrinsically accounts for the thermal effects on battery performance, such as lower voltage drops and higher capacities. However, the baseline (or“initial”) EOD predicted resistance values, W eod , for packs operating under different temperatures, for example, experimentally tested between 10°C and 35°C, do not vary considerably. This may be related to a combination of a self-heating effect and overall packaging design. As such, thermal derating methods may, in some examples, not be used for the algorithm. Such methods may add unnecessary complexities. In examples, thermal derating involves use of the Arrhenius relationship. However, an Arrhenius-type derating method may be used, in some examples, when the battery pack operates at subfreezing temperature as the internal resistance of the cells increases exponentially. This leads to a considerable loss in available energy, which may adversely impact the overall accuracy of the runtime algorithm if the thermal derating is not applied.

Referring again to Figure 14, at item S14a, the EOD predicted resistance recalibration routine starts. At item S14b, it is determined whether the minimum voltage of the cells in the battery pack is less than or equal to the cutoff voltage, V cutoff ., If the result of the determination at item S14b is that the minimum voltage of the cells in the battery pack is not less than or equal to the cutoff voltage, V cutoff , then the EOD predicted resistance recalibration routine ends at item S14c. If the result of the determination at item S14b is that the minimum voltage of the cells in the battery pack is less than or equal to the cutoff voltage, V cutoff , then, at item S14d, it is determined whether the value of the EOD flag is false. If the result of the determination at item S14d is that the EOD flag is not false, then the EOD predicted resistance recalibration routine ends at item S14c. If the result of the determination at item S14d is that the EOD flag is false, then, at item S14e, it is determined whether the difference between the maximum and minimum voltage of cells in the battery pack is less than 1.0V. If the result of the determination at item S14e is that the difference between the maximum and minimum voltage of cells in the battery pack is not less than 1.0V (which indicates voltage imbalance within the battery pack), then the runtime algorithm EOD predicted resistance recalibration routine ends at item S14c. If the result of the determination at item S14e is that the difference between the maximum and minimum voltage of cells in the battery pack is less than 1.0V, then it is determined at item S14f whether the runtime is greater than ten seconds. If the result of the determination at item S14f is that the runtime is greater than ten seconds, then, at item S14g the EOD predicted resistance value, W eod , for the current power mode is incremented by one. Increasing the EOD predicted resistance value, W eod , results in the runtime decreasing, as can be seen from the example final runtime formulation given above (assuming other parameters in the final runtime formulation are fixed). If the result of the determination at item S14f is that the runtime is not greater than ten seconds, then, at item S14h, it is determined whether the runtime is less than minus ten seconds. If the result of the determination at item S14h is that the runtime is not less than minus ten seconds, then the EOD predicted resistance recalibration routine ends at item S14c. If the result of the determination at item S14h is that the runtime is less than minus ten seconds, then, at item S14i, the EOD predicted resistance value, W eod , for the current power mode is decreased by one and the EOD predicted resistance recalibration routine ends at item S14c. Decreasing the EOD predicted resistance value, W eod , results in the runtime increasing, as can be seen from the example final runtime formulation given above (assuming other parameters in the final runtime formulation are fixed).

For the avoidance of doubt, in another example the EOD predicted resistance recalibration routine may be executed by comparing the nominal run-time value to other run time estimations (for example the voltage differential runtime described below) using the general procedure described above.

Voltage Differential Runtime

Referring to Figure 15, there is shown a flowchart of an example of a voltage differential runtime routine. Referring to Figure 16, there is shown schematically an illustration of a voltage differential runtime procedure. In this example, the voltage differential runtime routine employs a voltage variation (or“differential voltage”) method to compute the remaining runtime when the battery voltage is below a predefined value. In this example, the predefined value is 3.00V. It will be appreciated that this predefined value is different from the cutoff voltage, V cutoff . In this example, the voltage gradient of the cell with the lowest voltage value in the battery pack (over time) is calculated. In other words, the rate of change of the voltage of the cell with the lowest voltage value is calculated. This is then used, in this example, to compute a runtime estimation value through linear extrapolation. This may be achieved by employing the triangle proportionality theorem in order to compute a remaining runtime estimation value, as illustrated in Figure 16. The method then combines the nominal runtime estimation and the voltage gradient runtime estimations. In this example, a variable weight that is linearly proportional to the decrease in observed voltage from the threshold value is applied. This provides a smooth transition between both the nominal and voltage gradient estimations without sudden variations. In this example, an example time delay of five seconds between subsequent voltage readings is used in conjunction with a 50 mV minimum voltage difference such that the voltage measurement has decreased sufficiently. In this example, the voltage differential routine evaluates different voltage variations of the battery. One example voltage variation is the voltage being less than or equal to a threshold voltage level. Another example voltage variation is the voltage gradient being greater than a threshold voltage gradient.

Referring again to Figure 15, there is shown a flowchart of an example of a voltage differential runtime routine. At item S15a, the voltage differential runtime routine starts. At item S15b, it is determined whether the minimum voltage of cells in the battery pack is less than or equal to the voltage runtime value. If the result of the determination at S15b is that the minimum voltage of cells in the battery pack is not less than or equal to the voltage runtime value, then the voltage differential runtime routine ends at item S15c. If the result of the determination at S15b is that the minimum voltage of cells in the battery pack is less than or equal to the voltage runtime value, then, at, item S15c, a voltage sense timer parameter, VoltageSenseTimer, is decremented by the value TimeDelay and it is then determined, at item S15d, whether the voltage sense timer parameter is less than zero. If the result of the determination at item S15d is that the voltage sense timer parameter is not less than zero, then, at item S15e, the Weight_1 and Weight_ 2 parameters are calculated and the runtime is calculated as:

The voltage differential runtime routine then ends at item S15c. If the result of the determination at item S15d is that the voltage sense timer parameter is less than zero, then, at item S15f, the voltage differential runtime routine calculates Delay = VoltageSenseDelay - VoltageSenseTimer and sets VoltageLow = MinVoltage. Processing then proceeds to item S15g, at which it is determined whether the difference between the VoltageHigh and VoltageLow values is greater than 50mV. In this example, the VoltageHigh value corresponds to a previous lowest voltage of cells in the battery pack and the VoltageLow corresponds to a current lowest voltage of cells in the battery pack. As such, item S15g relates to the temporal difference in voltage levels. If the result of the determination at item S15g is that the difference between VoltageHigh and VoltageLow is greater than 50mV, then, at item S15h, the value of V oltageRuntime is calculated as:

Processing then proceeds to item S15i at which it is determined whether the voltage runtime is less than zero. If the result of the determination at item S15i is that the voltage runtime is less than zero, then, at item S15j, the voltage differential runtime routine sets VoltageHigh = VoltageLow and VoltageSenseTimer = VoltageSenseDelay and the voltage differential runtime routine ends at item S15c. If the result of the determination at item S15i is that the voltage runtime is not less than zero, then, at item S15k, the voltage differential runtime routine sets V oltage Runtime = Runtime and processing proceeds to item S15j. If the result of the determination at item S15g is that the difference between VoltageHigh and VoltageLow is not greater than 50mV, then, at item S15I, the voltage differential runtime routine sets VoltageRuntime = Runtime and processing proceeds to item S15i.

Thermal Differential Runtime

Referring to Figure 17, there is shown a flowchart of an example of a thermal differential runtime estimation routine. In this example, the runtime algorithm employs a thermal differential runtime estimation if the battery pack thermal cutoff condition occurs before the minimum voltage cutoff, V cutoff , is reached. In this example, the thermal differential runtime estimation routine is similar to the voltage differential routine in that a similar delay is used to record two subsequent temperatures. In this example, the thermal differential runtime estimation routine is executed when the temperature of the battery exceeds 50°C and when a positive thermal gradient is computed, in order to avoid any unnecessary code execution. In this example, the variable weight used in the voltage differential routine is not present within the thermal differential runtime estimation routine as the thermal variations of the cell exhibit a highly damped response when compared to the voltage variation of a cell.

In this example, the thermal differential routine evaluates different temperature variations of the battery. One example temperature variation is the temperature exceeding a threshold temperature level. Another example temperature variation is the thermal gradient being greater than a threshold thermal gradient.

Returning now to Figure 17, at item S17a, the thermal differential runtime estimation routine starts. At item S17b, the value of the Temper atureHigh parameter is set as the maximum of the measured temperatures of the cells of the battery pack. At item S17c, it is determined whether the maximum temperature of the cells of the battery pack is above 50°C. If the result of the determination at item S17c is that the maximum temperature of the cells of the battery pack is not above 50°C, then, at item S17d, the thermal differential runtime estimation routine sets ThermalRuntime = Runtime. Processing then proceeds to item S17e, where it is determined whether the thermal runtime is less than the runtime. If the result of the determination at item S17e is that the thermal runtime is not less than the runtime, then the thermal differential runtime estimation routine ends at item S17f. If the result of the determination at item S17e is that the thermal runtime is less than the runtime, then, at item S17g, the runtime is set as the thermal runtime and the thermal differential runtime estimation routine ends at item S17f. If the result of the determination at item S17c is that the maximum temperature of the cells of the battery pack is above 50°C, then, at item S17h, the value of the thermal sense timer parameter is decremented by the value TimeDelay and it is then determined at item S17i whether the value of the thermal sense timer parameter is less than zero. If the result of the determination at S17i is that the value of the thermal sense timer parameter is not less than zero, then, at item S17j, the ThermalRuntime value is decreased by the value of the thermal sense timer parameter and processing proceeds to item S17e. If the result of the determination at S17i is that the value of the thermal sense timer parameter is less than zero, then, at item S17k, the thermal differential runtime estimation routine sets Delay = ThermalS enseDelay - ThermalSenseTimer and processing proceeds to item S17I where it is determined whether the difference between the highest and lowest temperatures of the cells of the battery pack is greater than 2°C. If the result of the determination at item S17I is that the difference between the highest and lowest temperatures of the cells of the battery pack is not greater than 2°C, then, at item S17m, the thermal differential runtime estimation routine sets ThermalRuntime = Runtime and then, at item S17n, sets Temper ature Low = TemperatureHigh and ThermalSenseTimer = ThermalS enseDelay , and then proceeds to item S17e. If the result of the determination at item S17I is that the difference between the highest and lowest temperatures of the cells of the battery pack is greater than 2°C, then, at item S17o, the thermal runtime is calculated and processing proceeds to item S17n.

Runtime Algorithm Summary

A practical runtime algorithm is provided which operates atop the SoC framework described above and incorporates an additional self-calibrating subroutine which attempts to estimate the EOD predicted resistance values, W eod , of the battery pack over the lifetime of the battery pack. The runtime algorithm introduces voltage and thermal differential routines that may improve the final runtime estimation value. The voltage and thermal differential routines may ultimately introduce a degree of non-linear behaviour into the system. Analysis of the response of the runtime algorithm to different environmental conditions (for example, different ambient temperatures) and power modes over an extended cycling period has also been provided herein. Results have demonstrated that the runtime estimation is achieved with varying degrees of linearity for all experimental data. A perceived runtime acceleration or deceleration up to ±30% may be encountered. However, such behaviour is not expected to be noticeable by the end-user as runtime variations are more susceptible to usage. In examples, the runtime estimation algorithm has a ±30 second runtime error at high power levels, a ±45 second runtime error at medium power levels, and a ±60 second runtime error at low power levels. In examples, a discharge runtime resolution of one second is attained.

In examples, the battery pack is discharged at a constant power (i.e. varying current). For example, a motor of a vacuum cleaner may be run at constant power. Calculating remaining runtime using SoC (from a current-counting technique such as Coulomb-counting) would be inaccurate. In examples, runtime calculations use an energy balance equation, where the remaining runtime equals the available energy divided by the discharge power. The resulting remaining runtime value may be displayed to the user. When the battery pack is getting low, in examples, the runtime algorithm begins to calculate, in parallel, an expected runtime based on the rate of change of voltage (referred to herein as the“voltage gradient”) of the battery pack. In examples, the runtime algorithm then adjusts the expected or“nominal” runtime calculated using the energy balance equation, based on the runtime calculated from the voltage gradient, to produce the runtime value displayed to the user. As the battery continues to empty, the influence of the voltage gradient calculation on the on the runtime displayed to the user increases, and the influence of the energy balance equation decreases. When the battery reaches its voltage cutoff point, V cutoff , the user-displayed runtime is based entirely on the voltage gradient calculation. In addition, in examples, the runtime algorithm monitors the temperature of the battery and interpolates the estimated time until the battery will reach a safety cut-off temperature. If this time becomes shorter than the expected runtime calculated based on the nominal and voltage gradient routines, the product displays the time until thermal cut-off as the expected runtime. As such, examples described herein provide a runtime algorithm which transitions from using an energy balance to using a voltage gradient. The gradual nature of the transition from energy balance to voltage gradient, and the temperature-based override features have also been described.

Various measures (for example, methods, processors, systems, products, electronic devices, computer programs and computer-readable media) are provided in relation to estimating a remaining runtime of a battery. A first runtime estimation based on an estimated useable energy of the battery is obtained, a second runtime estimation based on a variation of a voltage of the battery is obtained, and an estimated remaining runtime of the battery using both the first and second runtime estimations is calculated. The first runtime estimation may, for example, be obtained using an energy-balance equation. The second runtime estimation may, for example, be obtained based on the voltage being less than or equal to a threshold voltage level and/or a voltage gradient of the battery exceeding a voltage gradient threshold. As such, more accurate estimations of the remaining runtime may be obtained, particularly as the battery reaches a cutoff voltage.

In examples, the first runtime estimation is obtained based on a discharge power of the battery. As such, accuracy of the runtime estimation may be enhanced. The discharge power may be an observed discharge power.

In examples, the useable energy of the battery is estimated by derating an estimated maximum available energy of the battery with an estimated unavailable energy, the estimated unavailable energy is based on a predicted internal resistance of the battery at an end-of- discharge, and the predicted internal resistance of the battery is dependent on the discharge power of the battery. As such, accuracy of the runtime estimation may be enhanced by factoring in internal resistances at EOD.

In examples, the estimated maximum available energy of the battery is based on an estimated amount of charge of the battery at the end-of-discharge. As such, accuracy of the runtime estimation may be enhanced by factoring in an estimated amount of charge at EOD.

In examples, the predicted internal resistance is selected from a plurality of power- dependent predicted internal resistances based on the discharge power of the battery. As such, accuracy of the runtime estimation may be enhanced by using a predicted internal resistance matched with operating conditions

In examples, in response to the estimated remaining runtime of the battery being different from an observed remaining runtime of the battery, the predicted internal resistance is updated. This can lead to increased accuracy of subsequent runtime estimations.

In examples, the updating of the predicted internal resistance comprises increasing the predicted internal resistance in response to the estimated remaining runtime of the battery being greater than the observed remaining runtime of the battery. This can lead to increased accuracy of subsequent runtime estimations.

In examples, the updating of the predicted internal resistance comprises decreasing the predicted internal resistance in response to the estimated remaining runtime of the battery being less than the observed remaining runtime of the battery. This can lead to increased accuracy of subsequent runtime estimations.

In examples, the estimating of the remaining runtime of the battery uses non-zero weighted contributions of both of the first and second runtime estimations. As such, a smooth transition may be applied in relation to contributions of the first and second runtime estimations.

In examples, the contributions are dependent on the voltage of the battery. As such, runtime estimations may be matched to operating conditions.

In examples, as the voltage of the battery decreases, the contribution of the first runtime estimation decreases and the contribution of the second runtime estimation increases. In such examples, the runtime estimation may be matched with observed influences on remaining runtime.

In examples, the first runtime estimation is obtained based on an estimated amount of energy of the battery that has already been used. Such examples provide more accurate estimations of the useable energy of the battery and, hence, more accurate runtime estimations.

In examples, the second runtime estimation is obtained in response to the voltage of the battery being less than a voltage level threshold. The second runtime estimation is more influential at lower voltages. As such, factoring in the second runtime estimation at lower voltages may provide more accurate runtime estimations.

In examples, the second runtime estimation is obtained in response to a voltage gradient of the battery being greater than a voltage gradient threshold. This may enable extrapolations to be made to predict the remaining runtime.

In examples, a third runtime estimation is obtained based on a variation of a temperature of the battery, wherein the estimating of remaining runtime of the battery further comprises using the third runtime estimation. More accurate runtime estimations may be achieved by factoring in the temperature.

In examples, the third runtime estimation is obtained in response to the temperature of the battery exceeding a battery temperature threshold. Processing associated with the third runtime estimation may be triggered when the temperature of the battery is likely to impact the runtime estimation.

In examples, the third runtime estimation is obtained in response to a thermal gradient of the battery exceeding a thermal gradient threshold. Processing associated with the third runtime estimation may be triggered when the thermal gradient of the battery is likely to impact the runtime estimation.

In examples, the third runtime estimation is used as the estimated remaining runtime of the battery in response to the third runtime estimation being less than the calculated remaining runtime. More accurate runtime estimations may be achieved by using a more appropriate runtime estimation.

In examples, an indication of the estimated remaining runtime of the battery is caused to be displayed on a display.

Various measures (for example, methods, processors, systems, products, electronic devices, computer programs and computer-readable media) are provided in relation to estimating a remaining runtime of a battery. Both an estimated useable energy of the battery and a variation of a voltage of the battery are used to estimate the remaining runtime of the battery. This can provide more accurate runtime estimations than using one but not the other of the useable energy and the voltage variation.

Various measures (for example, methods, processors, systems, products, electronic devices, computer programs and computer-readable media) are provided in relation to estimating a remaining runtime of a battery. A processor uses an energy balance equation to estimate the remaining runtime of the battery at a first point in time and uses both the energy balance equation and a voltage gradient to estimate the remaining runtime of the battery at a second, later point in time. This can provide more accurate runtime estimations than using one but not the other of the energy-balance equation and the voltage gradient. System-level Features

Various system-level features for the SoC and runtime algorithms will now be described. In examples, battery pack power is evaluated from the sum of all individual cell voltages measured by the battery data management chip and multiplied by the effective current flow, which includes an estimated current offset error, I err . In examples, the battery pack power is not evaluated directly from the voltage reading of the battery pack in view of higher cumulative errors associated with such readings. In examples, the system initiates a resting period of at least 200 seconds before charging the product when conditions from the recalibration routines are met. In examples, the recalibration routines are executed at the end of the resting period and before charging occurs. In examples, the system checks that the output data from the battery data management chip is not corrupted during start-up, which may occur from previously stored values in the memory of the chip. In examples, the battery data management chip maintains a consistent sampling rate. In examples, the sampling rate is between 200ms and 350ms. In some examples, the target sampling rate is 250ms. In examples, the battery data management chip calls the SoC algorithm when data is made available. In examples, the target sampling rate is maintained throughout charging, discharging, and resting states. In examples, a persistent data structure records the average cell voltage from the battery pack and updates relevant parameters prior to product complete shutdown. In examples, the persistent data structure is initialised during the production phase of the product, when the battery pack is assembled onto the BMS PCB and the product is tested or triggered throughout assembly. This may involve a small delay (for example, approximately 3 seconds) for the battery data management chip to become active and ready to measure battery pack cell voltages. In examples, the system always attempts to run a recalibration routine, upon detecting a mode change, with the final recorded value of the average cell voltage. In examples, certain conditions should be met for the recalibration to execute fully. In examples, the system uses the previously updated values in persistent data for recalibration purposes if the product is triggered during a shutdown state (i.e. a state where the product is completely switched off, including any screen and any other system-level hardware). This is because the start-up time for the battery data management chip may exceed the target start-up of the product. In examples, the recalibration routine occurs within two seconds after product has being triggered from a shutdown state. In examples, the system does not attempt to estimate both the current offset error, I err , and the battery pack maximum capacity, Q max , simultaneously. In examples, the current offset error, I err , is evaluated at the BOL of the product and remains constant after a predefined number of estimation attempts (for example, seven attempts) have been performed. In examples, the maximum capacity estimation routine of the algorithm is evaluated throughout the lifetime of the product, but only after the current offset error estimation value, l err , becomes static (in other words, constant). In examples, the system is able to identify the cells being used within the battery pack and adjust the initial parameters or references of the algorithms appropriately when the product is first initialised. In examples, adjustments for the SoC algorithm include updates to the OCV reference curve and expected capacity range (i.e. minimum, nominal, maximum) of the battery pack. In examples, additional adjustments are also made for the runtime algorithm parameters. In examples, SoC and runtime algorithm firmware code is stored and executed onto the N248F battery pack BMS board. In examples, the Ul screen requests data from the BMS board indirectly through another board to retrieve SoC or runtime information.

Cell-level Features

In examples, the parameters associated with both the SoC and runtime algorithms are adapted according to the cell(s) being used. Examples described herein relate to Lithium-ion cells. However, other chemistries may be used. Various different parameters may be modified dependent on the type of Lithium-ion, or other, cell used. For example, the OCV reference curve of the cell may be extracted, for example through GITT (galvanostatic intermittent titration technique) at BOL and a 23°C ambient temperature. Such data may be post-processed to generate an array of 101 data points, equally spaced between 0% and 100%. Cell maximum, nominal, and rated capacities may also be obtained, for example as specified by the manufacturer of the cell. The predicted EOD resistances values, W eod , may also be obtained for all power modes (for example, high, medium, and low).

The above embodiments are to be understood as illustrative examples. Further embodiments are envisaged.

In some examples, battery runtime is be estimated when the product is being charged. In some examples, a smoothing interface is provided between the SoC and/or runtime estimations and Ul screen of the product. In some examples, the Ul and/or graphics are adapted based on how the output of the algorithm output estimations are to be displayed. In some examples, the SoC algorithms and runtime algorithms are modified for use with products which do not operate under constant power modes. In some examples described above, it is assumed that voltage and current offset errors, I err , from the BMS PCB remain constant over the lifetime of the product and environmental factors. In other examples, a constant current offset error, I err , may not be assumed. In such other examples, the system may account for errors that deviate considerably with one or both of these factors.

Any feature described in relation to any one embodiment or aspect of the invention may be used alone, or in combination with other features described, and may also be used in combination with one or more features of any other of the embodiments, or any combination of any other of the embodiments. Furthermore, equivalents and modifications not described above may also be employed without departing from the scope of the invention, which is defined in the accompanying claims.