Improved Digital Twin of Li-Ion Battery Based on Generic MATLAB Model

: The paper describes the digital twin of a Li-ion battery cell based on the MATLAB/Simulink generic model. The digital twin is based on measured data for constant current/constant voltage charging and discharging cycles with State of Health (SoH) up to 79%, also including fast charging. Mathematical equations used for the digital twin are obtained by 3D data ﬁtting of measured SoH, battery capacity, and battery cell current. The input to the proposed digital twin is only the measured battery cell current, and its output includes State of Charge (SoC), SoH, and battery cell voltage. The designed digital twin is tested and compared with MATLAB/Simulink generic model and battery cell measurements for constant discharging current and dynamically generated discharging current proﬁle. The results show signiﬁcant improvement in the generic MATLAB/Simulink model.


Introduction
With rapid development in electric vehicles and consumer electronics, smart grids, etc., energy storage systems are becoming an important sector.Electrical energy generation is shifting from predictable and stable sources such as power plants to less predictable and stable sources such as renewable energy sources.Carbon neutrality, for example, net-zero greenhouse gas emissions, which the EU aims to reach by 2050 [1], will place significant emphasis on highly reliable battery energy storage systems (BESS) and advanced smart grids.As the world's second-largest producer of motor vehicles after China, the EU aims for zero-emission vehicles from 2035 [2].All these applications require high-energy BESS to meet the demand for reliable systems used for a short time and highly efficient energy storage.The BESS are small in size, portable, and can be placed everywhere.Batteries are electrochemical energy storage systems; the energy stored in the battery cannot be accessed directly as in chemical storage systems such as hydrogen.This implies that it is not easy to assess the battery state-of-charge (SoC) instantaneously.The SoC is one of the most important parameters of the BESS.In general, the battery SoC is defined as the current capacity ratio to the battery's nominal capacity.Moreover, the BESS must be safe during the whole life cycle as the battery performance gradually deteriorates.Lithiumion (Li-ion) batteries are preferred over other battery chemistry in various applications because of their long life, small self-discharge, high energy density, no requirement for complete discharge (the memory effect), and lighter weight.The battery management system (BMS) is responsible for ensuring that the BESS is operated within a safe operating range.However, many accidents are being reported as a result of faults in the BESS [3].In this regard, the current research of BMS is focused on precise battery State-of-Health (SoH) estimation, and Remaining-Useful-Life (RUL), which need to be monitored to prevent failure [3,4].The SoH is defined as a ratio of the maximal instantaneous releasable capacity to the new battery's capacity [5].The RUL is a subjective estimate of the remaining number of months or years that the BESS is estimated to be able to function in accordance with its purpose before it will need to be replaced [4].
The basic property of a battery is its SoC, which needs to be precisely monitored by BMS.The existing methods for SoC estimation can be divided into three categories: direct, indirect, and adaptive [4].Direct methods are based on measuring the physically accessible battery properties such as the battery voltage, or battery current [6][7][8].Indirect methods are data-based and use a database of measured battery properties within a cycle [9,10].Finally, adaptive methods use adaptive filters formed from Fuzzy logic [11], artificial neural networks [12], and the Kalman filter [12], which are based on adaptive algorithms for adjusting parameters.The direct methods combining coulomb counting and open circuit voltage measurements are the easiest to implement and provide reliable results in periodic battery cycling [6][7][8][9][10][11][12][13].
The SoH is critical for the proper operation of the BMS as it represents the current state of the battery within its lifetime.Four approaches are used for battery degradation modelling [10]: physical-based models, equivalent circuit models, machine learning models, and empirical and semi-empirical models.Empirical models are simple and easy to implement as they contain only mathematical formulas which try to describe complex electrochemical processes.This approach is intuitive for non-chemical engineers; however, the empirical models often over-simplify the complex behaviour of Li-ion batteries.Empirical models are based on curve fitting the relationship of various factors influencing the performance of the battery, such as cut-off charge voltage, temperature, SoH, DoD etc.Large data sets are necessary to decouple their mutual influence.Data sets for various charging (usually constant current followed by constant voltage) and discharging profiles with variable temperatures are available as open data [9,[14][15][16][17].They are used for developing ageing models, for example, for LiFePO4 with fast-charging up to 10C [18] or for LiCoO2 degradation modelling [19].However, these datasets usually do not include fast charging and consider galvanostatic discharging.
MATLAB/Simulink has been used for many applications in estimations of SoC and SoH of a battery cell, including the Extended Kalman filter, artificial neural networks, neurofuzzy systems and various equivalent circuit models.In [20], the battery SoC estimation equivalent circuit provided in MATLAB has been modified by adding the 3-RC pairs in series with its internal resistance.In [21], authors propose a MATLAB function with the objective of providing a public tool that estimates the battery SoC and terminal voltage at different temperatures using a second-order resistor-capacitor (2RC) ECM along with an extended Kalman filter (EKF).In [22], authors propose a unified OCV-SOC model that is intended for both SOC estimation and SoH monitoring.In [23], a universal method for tuning the cell model against any standard dataset is proposed.A cell model of 1-RC pair was developed using MATLAB/Simulink.A new methodology is adopted to better estimate SoC by tuning the cell parameters.In [24], the authors propose a method for estimating the SoH of a Li-ion battery based on the assumption that limited data is obtained through a small number of reference performance tests (RPT).Performing frequent RPTs causes unnecessary degradation of the Li-ion battery.The authors design a neural network for SoH estimation using RPT-reduced experimental data proposed for achieving economic efficiency and mitigating the dispensable degradation due to RPT operation.
The paper describes the development of an empirical battery model based on a proprietary data set obtained by battery cycling for Samsung INR18650-25R cell (Figure 1b) and also includes fast charging and its influence on battery lifetime.The empirical battery model is developed in MATLAB/Simulink environment and is based on the generic battery model from MATLAB/Simulink.SoC estimation is based on coulomb counting, as the only measured variable which enters the model is the battery current.The initial capacity of the battery cell (corresponding to the initial SoH) is measured by a single charge and discharge cycle by a precise power analyser.The SoH model is based on data obtained from cell cycling up to SoH equal to 80% of the initially measured SoH.The data for empirical model creation, thus, contains information about the whole life cycle.The created model can be easily implemented for battery management system development.Comparison between measured data and the designed empirical model shows a good correlation even for randomly generated discharging profiles.Li-ion batteries are produced in various shapes (cylindrical, prismatic, button, pouch, etc.) (Figure 1a).In Section 2, the basic charging and discharging parameters of Li-ion batteries regarding the lifetime of the battery are presented.Section 3 describes a methodology for collecting the data set used for model creation.Section 4 describes the test bench used for data collection during the cyclic test.In Section 5, the battery tests are described and obtained data sets are presented for SoH up to 79%.Section 6 presents the empirical model and its concept.Moreover, data fitting and the final model are described in Section 6.In Section 7, the comparison between measured data and created model summarises the properties of the model for randomly generated battery discharging profile.

Li-Ion Batteries
Li-ion battery cells have many advantages when compared to other battery chemistry.They offer relatively high capacities (188 mAh/g for NCA cathode cell) and high energy density (260 Wh/kg for NCA cathode cell) whilst being lightweight, accept fast charging, have very low self-discharge (0.35-2.5% per month) and have a long lifespan of the battery cell [26][27][28][29].They also have relatively high nominal voltage (2.5 V-4.2 V) and no memory effect.Li-ion batteries can be operated in a wide temperature range from −20 °C to +60 °C One of their disadvantages is that if we want to achieve a long service life for the battery cell, it is necessary to treat them according to certain requirements: Li-ion battery cells have a lifespan of approximately 300-2000 cycles, depending on the cathode chemistry, Depth of Discharge (DoD), and temperature [30].As can be seen in Figure 1a, Li-ion batteries are produced in various shapes (cylindrical, prismatic, button, pouch, etc.) and in most cases have a nominal voltage of 3.6 V or 3.7 V [30][31][32].

Testing Method of Li-Ion Batteries
Batteries can be tested from several points of view, such as the electrical, mechanical or thermal properties.The main task was to retrieve models based on measured data from cycling testing accurately.This section focuses on the proper charging and discharging process of Li-ion batteries.In addition, this section also describes the protections that must be ensured during these processes.For this purpose, it was necessary to build test equipment that performs cyclic charging and discharging of battery cells.The performed tests were focused precisely on the electrical properties of the battery cell.These tests take into account the battery's ability to deliver a certain voltage, current and capacity.Such testing takes place by repeatedly charging and discharging battery cells [33,34].

Charging
The optimal charging process for Li-ion cells is called CC/CV (Constant Current/ Constant Voltage) and consists of two phases:

•
The constant current (CC) phase is the phase during which a regulated current with a constant value flows into the battery cell.A constant current in the range of 0.5-1 C is usually chosen (if the cell has a capacity of 2500 mAh 1C = 2.5 A), depending on the exact type of the battery cell.This current must be maintained by a converter with current control.Thus, the current is constant, and the voltage on the battery cell slowly begins to increase.This first phase, i.e., the constant current phase, is used until the moment when the battery cell's maximum allowable voltage, determined by the manufacturer, appears on the battery cell terminals.In most cases, it is a value of around 4.2 V.After reaching this voltage value, the charging process continues with the next phase [35,36].

•
The constant voltage phase (CV) is followed by the CC phase and is the phase during which the battery cell is no longer able to receive a current with the value used in the first phase without its output voltage increases above the maximum allowed voltage value set by the manufacturer.Since the battery cell is not yet fully charged at the beginning of this phase, the charger creates a constant voltage applied to the cell with the maximum value determined by the manufacturer.In most cases, this value is around 4.2 V. Thanks to this, the battery will not exceed this voltage value at its terminals.However, a current will start flowing to the battery cell and will charge it up to 100%.The cell current is exponentially decreasing during the CV phase.The current value decreases until the minimum current value when the battery is considered fully charged and the charging process is terminated [35,36].
The overall charging process described above can be seen graphically in Figure 2. The length of the individual phases is significantly influenced by the exact type of battery and especially by the maximum current in the first phase.The boost charging method uses an additional higher current at the beginning of the charging cycle to shorten the charging time without compromising the cycle life.Moreover, the charging time is influenced by the value of the changing current in the classical CC-CV charging method [37][38][39].

Discharging
From the operation point of view, the discharge process of the battery cell is significantly simpler as it consists only of one phase.The discharge profile can be set to constant current (e.g., galvanostatic) and is terminated by reaching the cut-off voltage.However, in real applications, the discharging current is variable, and it is important to monitor the current during discharge, the minimum (cut-off) voltage and the temperature of the cell.The DoD significantly influences the cell cycle life as Li-ion cells prefer shallow discharge, and lowering DoD increases the cyclability of the battery cell [41,42].
Discharging with higher than permitted currents, under-discharging below minimum voltages and discharging the battery cell outside the working temperature range have a significant impact on its lifetime.Typical discharge characteristics for various current values can be seen in Figure 3.During discharging with low current, the cell remains relatively cold and discharging lasts longer.With higher discharging current also increase cell temperature and decreases discharging time.The discharging, which includes microcycling, for example, a small swing in the state of charge, can have a significant impact on the cycle life of the battery cell and its influence on the cycle life needs to be studied [42].

Device for Cyclic Testing of Battery Cells
The battery cell data, such as its voltage and current during charging and discharging, are necessary to create the empirical model of the cell.These data can be found in open access databases such as [14], but we have decided to obtain our own data for the modelled battery cell Samsung INR18650-25R.There are many different types of battery testers with different features and prices on the market, but we have decided to use our own tester whose design was part of a PhD thesis.The designed testing device for battery cell cycling ensures the charging and discharging of battery cells throughout its lifetime and is used for testing the chosen battery cell model.The designed device can also be extended by a thermal box with very precise temperature control in the future.The requirements for the test equipment are as follows: Based on these requirements, the concept of the entire test equipment was designed.

Concept
A concept with one master unit and several slave units was chosen for the development of the device for cycling testing.In this concept, every battery cell was measured by a dedicated device with its own microcontroller, which is able to work independently of the remaining test devices.The advantage of this solution is the robustness of the system when the devices will be able to work even in the event of failures on the remaining devices.Figure 4 shows a block diagram of the cycling battery cell tester.The blocks are divided into three groups with different colours.The power parts and paths where a higher current is expected are shown in red.The sensing, control and communication parts of the device are marked by blue.The yellow colour shows the controllers.In the case of digital control, these regulators were implemented in a microcontroller.According to the requirements, we want to test at least six battery cells together in one group.It means that at least six test modules will be connected to the master processor equipped with the HMI interface [44,45].

Developed Test Device
The test device, which was developed based on requirements, is shown in Figure 5.The device is based on Cortex M4 single-core ARM architecture microcontroller from the STM32 family.The microcontroller provides a sufficient number of GPIO pins, PWM pins and pins for the AD converter.The microcontroller also offers a hardware interface for CAN bus connection.
The power stage of the device is based on two buck DC/DC converters connected in parallel.The first converter ensures the charging of the battery cell.The second DC/DC converter ensures discharging battery cell through 0.05 Ω resistor with rated power 100 W. Measured data are collected to the SD card.

Cell Tests
The Li-ion cell Samsung INR18650-25R was chosen as a reference for testing.The parameters of this battery cell are shown in Figure 6.The designed testing device for cycling tests uses the Nucleo STM32F303-K8 microcontroller with 12-bit ADC.The resolution for charging and discharging current was 4.8 mA and 13.3 mA, respectively.To keep the error low, an open-loop hall-effect current sensor was used for charging and discharging current measurements.The sampling rate of the ADC was set to 10 ksps.The testing device was used only to "wear out" the battery cells, and current sensors were needed to maintain constant charging and discharging current.Data for model creation and curve fitting (discharging curves and SoH measurement) was by a programmable DC load IT8518E and precision power analyser LMG500.The discharge process was terminated by reaching the cut-off voltage set in the programmable DC load.The accuracy of the current and voltage measurement for discharge curves and SoH measurement (Figures 7-12) was 0.045% and 0.05%, respectively.The battery cell was subjected to several hundreds of charge and discharge cycles, and then the SoH was measured.The following series of tests were performed on this type of Li-ion cell with the aim of obtaining the maximum possible amount of data to create an accurate empirical model of the Li-ion cell: 1.
Determining the maximum number of cycles which the battery cell can perform before its SoH drops to 80% at nominal charging and discharging current.

2.
Determining the influence of discharging current changes to the battery cell ageing with nominal charging current and discharging current 5A, 10A, 20A to 80% SoH.

3.
Determining the influence of change charging current to battery cell ageing with nominal discharging current and different charging current up to 80% SoH. 4.
Fast charging with maximal current and subsequent discharging with current up to 20 A till the SoH reached 80% 5.
Measuring of battery capacity with different charging and discharging currents and different SoH up to 80% SoH. 6.
Measuring shapes of charging and discharging curves for different charging and discharging currents and different SoH up to 80% SoH.
Measured results are shown in the figures below.In Figure 7, discharging characteristics for SoH 100% reflect the ability to supply high current while preserving high capacity-it can be achieved by a small voltage drop on the internal resistance of the battery cell.
Figure 7 also shows a ripple in discharging part of the curve for current 1 A. This ripple does not apply to higher current curves.
where: Q max -maximal capacity for a given cycle in which SoH is being calculated, Q nom -initial capacity of a new cell measured by one charge and discharge cycle.
One cycle consisted of a CC-CV charge with an initial current value of 0.4 C followed by a predefined constant current discharge (from 0.4 C to 8 C) until the cut-off voltage was reached.Then the next cycle was initiated without any rest period.
Characteristics in Figure 8 were measured at SoH = 94%.The effect of increasing internal resistance elements between curves for currents of 5 A and 10 A is clearly visible.It is also possible to see nonlinearities at less than the nominal current for this SoH.It can be seen that the cell at SoH = 94% does not achieve such excellent results, especially at currents higher than 10 A. At SoH = 94% and a current of 20 A, it is able to deliver only about 78% of the nominal capacity of the battery cell.As the SoH decreases, the increase in the losses on the internal elements of the battery cell, which results in lower voltage values, is present.The battery cell is able to deliver only a smaller capacity.In this case, it is only around 73% of the battery cell's nominal capacity for the maximum permitted current.
With further reduction of SoH, this trend continues.Losses on the internal elements of the battery cell increase.It confirms Figure 10 for SoH 85% and Figure 11 for SoH 79%.
Figure 12 shows the changes in the shape of the curves at a current of 5 A; it is possible to see how the shape changes, especially in the end positions of the curves, i.e., in SoC = 100% and SoC = 0%.In addition to these measured curves, changes in the battery cell's capacity based on the currents taken were also measured.A comparison of discharge capacities for different currents can be seen in Figure 13.The cell's maximal capacity is significantly influenced by the drawn current.Waveforms in Figures 14 and 15 show the dependence of battery cell ageing depending on charge/discharge currents.The y-axes show the number of cell cycles which the cell is able to perform before reaching SoH = 80%.The value of the SoH was obtained by measuring one charge and discharge cycle with a power analyzer after a certain number of charge and discharge cycles and comparing it to the reference first cycle with SoH = 100%.Measured data also allows us to describe capacity degradation due to a number of cycles and charging and discharging current.Waveforms in Figure 16 show dependency between capacity degradation and the number of cycles with constant charging current and different discharging currents.Based on these measured data, all the necessary dependencies were obtained to accurately determine the value of the voltage during discharge at every moment of the cell's lifetime.

Proposed Model
The concept of the battery cell model was designed depending on measured data and parts of the generic battery model from MATLAB.From MATLAB, a part for coulomb counting was used, and other parts of the proposed model were derived based on fitting functions of measured data.We took into account all relationships between these measured data, and the overall concept of the battery cell model is in Figure 17.The proposed model consists of eight blocks with defined relationships.

•
Current Sensor block, which measures the charging and discharging current of the battery cell model.
• Coulomb Counting and SoC evaluation-these two blocks can be combined into one block.The Coulomb counting block integrates the value of current from the current sensor over time.Subsequently, the current SoC value is determined.These phenomena can be described by the following equations:  • Actual capacity calculation block-the block recalculates the currently maximum available capacity of the battery cell based on SoH and current consumption.These values are then fed back to the SoC evaluation block.The calculations in the block are based on real measured data, which can be seen in Table 1.
Values of SoH were defined during measurements.A new cell from the manufacturer was tested with one charge and discharge cycle to determine the initial reference SoH.The SoH of the cell was considered equal to 100% after this first cycle.As initial capacity was considered, the capacity is given by the manufacturer in the datasheet.After that first cycle, all further measurements were taken, and the SoH of cells decreasing during these measurements was captured.Values of SoH for Table 1 were intended by decreasing capacity during measurements compared to the nominal capacity specified by the manufacturer.All measured data were transferred to a 3D graph, where they were fitted by a MATLAB extension-Curve Fitter (Figure 19).By using this extension, we found the bestfitting functions for measured data.In this case, the founded fitting function is a polynomial of degree 2 when the fitting method used was a nonlinear least square.1.
All fitting functions mentioned above were selected as the best compromise between accuracy and simplicity for using these functions in the Li-ion battery model.
The final equation for actual cell capacity unify the format.
Figure 20 shows the connection of the block based on (4).This block has 4 outputs.The first output gives us information about the maximum capacity at the actual load current.The second output represents nominal cell capacity at actual SoH.The remaining two outputs recalculate the capacitance value based on the temperature.Data for determining the temperature equations were obtained from the battery cell datasheet.• SoH evaluation block-the main goal of this block is to recalculate the SoH state during the simulation and adjust model parameters.The state of SoH changes during its ageing.The calculation of ageing in the model is based on the ageing coefficient ε, which assumes a value of zero at the beginning of the lifetime and 1 at its end-80% SoH for in our case.
For determination of the actual SoH, we used [46]: Coefficients DoD are obtained from the DoD Calculation block, while the last unknown in this block is the value of the coefficient N, which indicates the maximum estimated number of cycles at the actual testing current and the DoD.It can be described by the following equation [46]: where: -

•
Block Output voltage calculation-the output of this block is the battery cell voltage.Block is based on dependencies listed in (7). where: -I-actual load current (A) -SoC-state of charge (%) -SoH-state of health (%) -Q/Q nom -actual/nominal capacity of the battery cell (Ah) The battery cell voltage accordingly depends on load current, SoC, SoH, actual capacity and nominal capacity.All of these dependencies can be defined by one equation.We obtain this equation by fitting data from Figures 7-11.For fitting were tested different polynomial, exponential and Furier-based fitting functions.Some of these functions did not achieve accuracy in SoC > 95% and SoC < 5% areas.As a best final fitting function was selected exponential function of the third degree listed below: This one equation describes every measured current waveform at all selected values of SoH.Subsequently, the individual coefficients of the equation were compared between different current waveforms for one selected SoH.Dependencies between these coefficients were fitted by a polynomial of degree 2, and final equations for individual coefficients we can see below the equation for U batt : where a = a1 The value of coefficient f is equal for all current waveforms with constant value f = 100.Therefore, the equation for coefficient f is not described.Equations of coefficients are second-degree polynomial functions Based on these equations of coefficients; it was possible to include another variable in the equations, namely the current.After fitting all the curves, we can obtain the following three-dimensional model of the battery cell for a given SoH, which is dependent on SoC and current (Figures 22 and 23).After calculating these coefficients for each SoH value, we find out that changes in these coefficients are linearly dependent on each other, and each coefficient is possible to describe with another equation in which SoH will appear as a variable.Equations for description coefficients dependent on SoH are first-degree polynomial functions.As a result, for each coefficient, we obtain an equation that depends on SoC, current and SoH.
A final simulation model of the battery cell is shown in Figure 24.The main outputs of the block Output voltage calculation are outputs for controlling the supplies connected at the dynamic sub-model of the battery cell.These supplies can be seen in Figure 25 and provide the correct function of the overall battery model.In addition to these control outputs, the model also has several information or measurement outputs such as the current value of SoC, SoH, current nominal capacity and, of course, the terminal voltage of the simulated cell.

Comparison of Model and Real Battery Cell
After completing the digital twin, it was necessary to verify its accuracy by comparing it with the real battery cell.Real data from the battery cell was measured using a programmable DC electronic load (IT8518E from Itech, 60 V, 240 A, 6 kW) and a high-precision power analyzer (LMG500 from ZES Zimmer) which were also used for cycling tests.Several measurements took place with a constant value of current.These measurements were static, so the value of the current was constant.Results for different values of discharging current are in Figure 26a.Besides that, several dynamic measurements were performed with a variable current value to determine the accuracy of the model.Some of these measurements were selected for the results section to demonstrate the accuracy of the digital twin.In addition to the data from the real battery cell and the presented empirical model, a battery cell model available in MATLAB/Simulink, called the Generic Battery model, was also added to the comparison.This model was configured according to the manual in MATLAB.A comparison of dynamics of the real battery cell, the developed digital twin and the MATLAB model is in Figure 26b.
The digital twin utilises the Coulomb counting method for SoC estimation, which is prone to integration error due to the current measurement error and simplified integration.Moreover, this error will accumulate over time.Despite these disadvantages, Coulomb counting is still used due to its simplicity.The influence of the current measurement can be minimised by an open-loop hall-effect sensor, which is superior when compared to the shunt current sensing.A detailed discussion and analysis of the Coulomb counting approach for SoC estimation can be found in [47].The SoH is estimated based on the DoD, and, thus, it contains the error generated by SoC estimation.It requires calibration in regular intervals.Another approach to improving the SoC is presented in [48].The authors used the Kalman filter to correct the estimation of SoC by the Kalman filter through the feedback based on the relationship between SoC and OCV.The authors achieved the SoC estimation absolute error of 1.08%.

Conclusions
Battery cell models are a crucial part of any BMS.Successful implementation of a battery cell model into MATLAB/Simulink can help with the development of control methods for cell lifetime optimization.An empirical model of a battery cell can be easily generated from measured data obtained by the battery cell cycling by utilising the curve fitting functions.The empirical SoH model is based on data obtained from cell cycling up to SoH equal to 80% for the NR18650-25R cell.The data for empirical model creation, thus, contains information about the whole life cycle.Hence, the MATLAB/Simulink digital twin of the Li-ion cell from Samsung was developed based on the measured data.The data from battery cell cycling include fast charging, which is well known to accelerate the ageing process of the battery cell.However, it is not always included in publicly available battery cell data sets.The created digital twin provides information about SoC, SoH, cell voltage and cell capacity based only on the cell current.The model was successfully tested and compared to the Generic Simulink model of a Li-ion cell based on the data provided by the manufacturer.From the comparison, one can conclude that the static accuracy of the developed digital twin is better than the accuracy generic Simulink model.However, data used for digital twin creation from cycling tests are obtained by galvanostatic discharging.This leads to less accurate model performance for dynamic current changes.The digital twin could be improved by adding information to the charging and discharging cycles by implementing Hybrid Pulse Power Characterization (HPPC) and micro-cycling.It would enhance the data sets by the dynamical response of the battery cell, which would lead to more realistic parameter estimation.Moreover, the model could be extended to the battery pack.However, this would require a cell balancing technique to prevent the mismatch between cells, as the only parameter that is sensed is the battery current.
(a) Various types of Li-ion cells.Courtesy of RICHTEK (b) Tested Li-ion cell.

•
Do not exceed their maximal charging and discharging current • Maintain Constant Current-Constant Voltage (CC-CV) charging algorithm • Protect the cell from overcharging/undercharging • Protect the cell from over-temperature by proper thermal management.

Figure 5 .
Figure 5. Developed device for cycling battery cell testing.The current version of the developed device has these options: • Constant current load test.Charging current to 5 A and discharging current to 20 A with auxiliary cooling.• Possibility to load discharging profile in .csvformat, which can be modified later.• Possibility to cycle power charging/discharging cells to the defined SoH value.the SoH value can be set in a graphical user interface.• Possibility to simulate the overcharging, undercharging and fast charging.• Implemented protections: overvoltage, undervoltage, overheating and short circuit

Figure 13 .
Figure 13.Influence of discharge current and SoH on maximal capacity.

Figure 14 .
Figure 14.Influence of the charging current on the maximal number of cycles before the battery cell reaches SoH = 80%.

Figure 15 .
Figure 15.Influence of the discharge current on the maximal number of cycles before the battery cell reaches SoH = 80%.

Figure 16 .
Figure 16.Influence of the number of cycles and discharging current on capacity degradation.

Figure 17 .
Figure 17.Concept of the proposed model.Internal connections of this block from MATLAB/Simulink are shown in Figure 18.

Figure 18 .
Figure 18.Coulomb counting and SoC evaluation.Where Q_act parameter computing is based on the equation described below in the Actual capacity calculation block section, i is the actual sensed current.• Average Current calculation block-the block processing the value from the current sensor and distinguishes whether it is a charging or discharging current.The output from this block are two values.The value of Idis_ave corresponds to the average discharge current in the previous cycle, and Ichar_ave corresponds to the charging current.Values of Idis_ave and Ichar_ave are calculated as average integrated current divided by the number of measured samples.• Block DoD Calculation-the block calculates and stores the depth of discharge of the cell from the last three measured cycles.It has 4 outputs, three of which give information about three consecutive DoD states from previous cycles.The fourth output is a coefficient determining the number of transitions between the charging and discharging process.

Figure 19 .
Figure 19.Fitted date based on measurements from Table1.
H-number of cycles at standard currents and DoD = 100% after which cell achieves 80% SoH -DoD(n)-DoD value from the previous cycle ξ-influence DoD coefficient γ 01 ,γ 02 -coefficient for value to percentage γ 11 -exponent for influence of discharge current γ 12 -exponent for influence of charging current -Idis_ave(n)-median of discharging current in previous discharging cycle -Ich_ave(n)-median of charging current in previous charging cycle After transferring these equations into the model, the overall wiring of the ageing estimation block looks like in Figure 21.

Figure 22 .
Figure 22.Data fitted by the third-degree exponential function for SoH = 100%.

Figure 23 .
Figure 23.Data fitted by the third-degree exponential function of for SoH = 89%.

Figure 24 .
Figure 24.Interconnection of an individual block within the model.

Figure 25 .
Figure 25.Final digital twin based on an empirical model of the Li-ion cell.
(a) Comparison during static measurements.(b) Comparison during dynamic measurements.

Table 1 .
Battery cell capacity at different discharge current and different SoH.