Integrated Equivalent Circuit and Thermal Model for Simulation of Temperature-Dependent LiFePO 4 Battery in Actual Embedded Application

: A computational efﬁcient battery pack model with thermal consideration is essential for simulation prototyping before real-time embedded implementation. The proposed model provides a coupled equivalent circuit and convective thermal model to determine the state-of-charge (SOC) and temperature of the LiFePO 4 battery working in a real environment. A cell balancing strategy applied to the proposed temperature-dependent battery model balanced the SOC of each cell to increase the lifespan of the battery. The simulation outputs are validated by a set of independent experimental data at a different temperature to ensure the model validity and reliability. The results show a root mean square (RMS) error of 1.5609 × 10 − 5 for the terminal voltage and the comparison between the simulation and experiment at various temperatures (from 5 ◦ C to 45 ◦ C) shows a maximum RMS error of 7.2078 × 10 − 5 .


Introduction
In recent years, interest has increased for lithium-ion (Li-ion) batteries [1][2][3] in power generation and renewable energy applications such as solar energy systems, wave-operated electrical generation systems, wind turbines, battery electric vehicles (BEVs), and portable power storage devices.Compared with other commonly used batteries like lead acid, nickel cadmium (NiCd) and nickel metal hydride (NiMH), LiFePO 4 is popular due to its high capacity, low self-discharge current, wide temperature operation range, and long service life that make them better candidates for many applications.However, lithium-ion batteries are sensitive to overcharging or discharging that could deteriorate the performance resulting in a shorter lifetime [4].The accurate SOC estimation is, therefore, necessary for a properly functioning LiFePO 4 battery power system.
Since there is no sensor available to measure SOC directly, it is estimated from physical measurements (such as the current, voltage and temperature) via the battery management system (BMS).Currently, a large variety of methods for battery SOC estimation is proposed in the literature.First, the standard measurement-based estimation approaches, such as the coulomb counting method or ampere-hour (Ah) methods, as well as the open-circuit voltage (OCV) and impedance measurement methods [5][6][7][8][9] give a more intuitive and reliable estimation.Second, the machine learning-based estimation method (also called black-box method), such as artificial neural network (ANN) and fuzzy logic (FL) methods [10][11][12][13][14][15][16][17] require high computational effort for extensive training on a large dataset.Lastly, the state-space model-based estimation using Kalman filter (KF) [18][19][20] increases the computational load of the BMS.Hence, these methods have its advantages and disadvantages.They mostly focus on estimating the SOC of a single cell and terminal voltage estimation without considering the SOC and temperature differences between the cells in a battery [13].Few works have been performed to explore the SOC predictions of the battery pack (or multiple cells) system with temperature variations due to the ambient condition and cells.However, the temperature-dependent battery model with the convective heat transfer between the cells are often too complicated to realize for the actual application, and the simulation model is not available.
In this paper, the battery pack model is proposed to simulate the influence of temperature [14,15] between cells and the effect of ambient temperature acting on the cells that are necessary for developing a more reliable SOC estimation and cell balancing algorithm.A total of 12 LiFePO 4 cells in a series are used for the modeling and parameter identification process.The parameters are estimated online by a series of lookup tables to provide a good compromise between the high fidelity and computational effort for integrated BMS implementation, where the lookup table uses an array of data to map input values to output values, approximating a mathematical function.If the lookup table encounters an input that does not match any of the table's pre-defined input values, the block interpolates or extrapolates the output values based on nearby table values.Since table lookups and simple estimations can be faster than mathematical function evaluations, using the lookup table method can result in a faster computational time.The SOC estimation algorithm of the battery pack and cell balancing strategy are implemented and validated using the experimental data collected in a laboratory.The battery model under different temperatures is included to improve the battery model.The experiment results show the feasibility of the proposed model for simulation prototyping before the actual implementation.
In summary, the contributions of the paper include a 12-cell temperature-dependent battery model with the convective heat transfer between cells to estimate the SOC of each cell for automatic passive cell balancing.This work also provides a battery simulation prototyping platform to allow different algorithms and battery cells to be simulated and implemented quickly using the Simulink Coder to generate and execute C code from Simulink with less programming needed.The experiments verify the battery model in both near zero and room temperatures (from 5 • C to 45 • C) using the actual duty cycle.
The paper is organized as follows: Section 2 models the battery pack.It is followed by Section 3 that deals with the experimental setup and data acquisition.The simulation model validation using independent experimental data, SOC estimation of the proposed battery pack and cell balancing are presented in Section 4. Finally, Section 5 concludes the work with the future plan.

Battery Cell Model Description
The electrochemical model is the most accurate battery model for estimating the SOC.However, the electrochemical models are quite complex and involve partial differential equations [13] to solve in real-time.The black-box models using machine learning have recently been proposed.However, they use much computational effort for training large datasets for real-time embedded applications that slow down the system's output and performance in real-time.The alternative approach is to use the equivalent circuit models (ECM) with a combination of voltage sources, resistors, and capacitors to model the battery behaviors that will provide an interpretable structure for online estimation and implementation.

Equivalent Circuit Model
The number of RC blocks typically ranges from one to two for various applications.The dynamic voltage responses of 1 RC model and 2 RC model are compared in Figure 1, as well as the experimental data which is from the LiFePO 4 battery cell test.It is obvious that a higher number of RC increases the computational resources without significantly improving the model accuracy.Therefore, 1 RC battery cell model is proposed for the embedded applications in this paper, the model structure is shown in Figure 2. The nonlinear mapping from the battery's SOC to the open circuit voltage (OCV) is represented by a voltage-controlled voltage source (VCVS) denoted as   . 0 as the internal resistance.The  1 and  1 are polarization resistance and polarization capacitance to simulate the transient response during a charge or discharge process.The whole-charge capacitor is denoted as   , its value is the battery capacity in unit (A • s), the self-discharge energy loss due to long time storage is represented by   .The voltages across  1 are denoted as  1 .The terminal voltage and current are denoted as system output   and system input  , respectively.Define  > 0 when charging;  < 0 when discharging.The governing equation of the battery model is as follows.
As the temperature affects the battery cells' performance, the critical parameters such as OCV,  0 ,  1 and  1 are function of both SOC and temperature .The lookup tables are used to establish a direct correlation between electrochemical phenomena inside the cell and the circuit elements.The method can capture nonlinear electrochemical phenomena and yet avoid lengthy electrochemical process calculations to make the model suitable for embedded applications besides the simulation environment.
SOC is one of the most important variables in the BMS to manage the lithium-ion batteries to their optimal performance.It is necessary to monitor the SOC of the battery cell in real-time to prevent the battery cell from either undercharging or over-discharging as any of these conditions could damage the battery cell permanently.In this paper, the Ah method is used to compute the SOC.The nonlinear mapping from the battery's SOC to the open circuit voltage (OCV) is represented by a voltage-controlled voltage source (VCVS) denoted as   . 0 as the internal resistance.The  1 and  1 are polarization resistance and polarization capacitance to simulate the transient response during a charge or discharge process.The whole-charge capacitor is denoted as   , its value is the battery capacity in unit (A • s), the self-discharge energy loss due to long time storage is represented by   .The voltages across  1 are denoted as  1 .The terminal voltage and current are denoted as system output   and system input  , respectively.Define  > 0 when charging;  < 0 when discharging.The governing equation of the battery model is as follows.
As the temperature affects the battery cells' performance, the critical parameters such as OCV,  0 ,  1 and  1 are function of both SOC and temperature .The lookup tables are used to establish a direct correlation between electrochemical phenomena inside the cell and the circuit elements.The method can capture nonlinear electrochemical phenomena and yet avoid lengthy electrochemical process calculations to make the model suitable for embedded applications besides the simulation environment.
SOC is one of the most important variables in the BMS to manage the lithium-ion batteries to their optimal performance.It is necessary to monitor the SOC of the battery cell in real-time to prevent the battery cell from either undercharging or over-discharging as any of these conditions could damage the battery cell permanently.In this paper, the Ah method is used to compute the SOC.The nonlinear mapping from the battery's SOC to the open circuit voltage (OCV) is represented by a voltage-controlled voltage source (VCVS) denoted as U oc .R 0 as the internal resistance.The R 1 and C 1 are polarization resistance and polarization capacitance to simulate the transient response during a charge or discharge process.The whole-charge capacitor is denoted as C b , its value is the battery capacity in unit (A•s), the self-discharge energy loss due to long time storage is represented by R sd .The voltages across C 1 are denoted as U 1 .The terminal voltage and current are denoted as system output U L and system input I, respectively.Define I > 0 when charging; I < 0 when discharging.The governing equation of the battery model is as follows.
As the temperature affects the battery cells' performance, the critical parameters such as OCV, R 0 , R 1 and C 1 are function of both SOC and temperature T. The lookup tables are used to establish a direct correlation between electrochemical phenomena inside the cell and the circuit elements.The method can capture nonlinear electrochemical phenomena and yet avoid lengthy electrochemical process calculations to make the model suitable for embedded applications besides the simulation environment.
SOC is one of the most important variables in the BMS to manage the lithium-ion batteries to their optimal performance.It is necessary to monitor the SOC of the battery cell in real-time to prevent the Energies 2017, 10, 85 4 of 22 battery cell from either undercharging or over-discharging as any of these conditions could damage the battery cell permanently.In this paper, the Ah method is used to compute the SOC.
where SOC(0) is the initial SOC, C n is the nominal capacity of the battery pack, T is the sampling period, i(t) is the load current at time t, η is coulombic efficiency, and S d is the self-discharging rate.
For LiFePO 4 battery used in this experiment, η > 0.994 under room temperature [1].In this paper, η = 1, and S d = 0 are assumed.The series connected cells' capacity is the quantity of electric charge stored in the cells.Theoretically, the series battery capacity is given by the sum of the minimum capacity that can be charged and discharged [2]: where C series is the usable capacity of the series battery pack, C i is the capacity of the i cell, SOC i is state of charge of the i cell, m is the number of cells connected in a series.

Lumped-Capacitance Thermal Model of the Battery Cell
In this paper, the commercial LiFePO 4 26650 cylindrical cells are selected to be the research objects, which are constructed in a multilayer structure in which the radial thermal conductivity is lower than the axial one.Nevertheless, the thermal resistance by the radial conduction is still much less than the convective thermal resistance, as air is used as the coolant (i.e., the Biot number, Bi = L c h f /k s < 0.1).Therefore, a lumped-capacitance thermal model for battery cells assuming a uniform temperature in each cell is sufficient without compromising accuracy of the numerical analysis.The thermal energy balance of the battery cell is modeled by using the first law of thermodynamics: where U represents the internal energy and is the total energy contained by a thermodynamic system (in joules).Q gen (t) is the generating heating rate, i.e., the rate of the heat generation occurring in the cell.On the other hand, U can be determined by the following.
where m is the mass of the cell (in kilograms), dT cell is the temperature variation of the cell with time (in kelvin), and C P is the specific heat capacity of the cell (in J/kg/K).The volume heat generation rate in a battery body is the sum of numerous local losses such as active heat generation, reaction heat generation, and Ohmic heat generation.In this paper, Q gen (t) is characterized only by ohmic losses because of their simplicity to the model in the embedded applications.Ohmic losses are expressed as follows.
where I is the battery current, I 1 is the current going through by R 1 .Moreover, Q loss (t) is a value of all the heat transfers as a result of a temperature difference between the cells and the connections of the cells and consists of two parts: convective heat transfer Q conv and conductive heat transfer Q cond . 1.

Convective heat transfer
The convective heat transfer Q conv from the cell to the surrounding is determined by where h conv is the convective heat transfer coefficient, S area is the area of heat exchange, T cell is the cell temperature and T air is the ambient temperature.

Conductive heat transfer
The convective heat transfer Q cond represents the thermal diffusion through cell to cell electric connector.It can be modeled by where T cell 2 and T cell 1 are the temperature of battery cell 2 and battery cell 1, respectively.R cond is the thermal resistance of the connection, which includes the top and bottom connection of the battery cell.
In Li-ion battery, the cross-plane thermal conductivity is much smaller than the in-plane thermal conductivity.Heat conduction through the top and bottom of cells are important to the practical system.However, in this study, the experimental battery cells are all brand new, assuming that they are all with good uniformity.The temperature difference ∆T = T cell 2 − T cell 1 is ignored.As a result, the conductive heat transfer is also neglected in the model in the paper.

Coupled Equivalent Circuit Model (ECM) and Thermal Battery Model
A coupled electro-thermal model of the LiFePO 4 battery is proposed.In this model, the inputs are the current battery I and the ambient temperature, T air .In the coupled model, both thermal and electrical are considered since the temperature affects the four main parameters (OCV, R 0 , R 1 and C 1 ).As shown in Figure 3, the parameters at different temperatures provide two-dimensional lookup tables for the ECM to compute the terminal voltage and SOC of each cell while the thermal model determines the temperature within the cells due to convection.

Conductive heat transfer
The convective heat transfer represents the thermal diffusion through cell to cell electric connector.It can be modeled by where and are the temperature of battery cell 2 and battery cell 1, respectively.is the thermal resistance of the connection, which includes the top and bottom connection of the battery cell.
In Li-ion battery, the cross-plane thermal conductivity is much smaller than the in-plane thermal conductivity.Heat conduction through the top and bottom of cells are important to the practical system.However, in this study, the experimental battery cells are all brand new, assuming that they are all with good uniformity.The temperature difference ∆T = − is ignored.As a result, the conductive heat transfer is also neglected in the model in the paper.

Coupled Equivalent Circuit Model (ECM) and Thermal Battery Model
A coupled electro-thermal model of the LiFePO4 battery is proposed.In this model, the inputs are the current battery I and the ambient temperature, .In the coupled model, both thermal and electrical are considered since the temperature affects the four main parameters (OCV, , and ).
As shown in Figure 3, the parameters at different temperatures provide two-dimensional lookup tables for the ECM to compute the terminal voltage and SOC of each cell while the thermal model determines the temperature within the cells due to convection.

Experiment Tests for Battery Characterizations
A test environment for battery characterizations has been built in the laboratory as shown in Figure 4.The commercial LiFePO4 battery cells (ANR26650M1-B from A123 System with Nanophosphate ® lithium-ion chemistry) were used in the experiments.The key specification of the battery cell is tabulated in Table 1.Battery cell or battery pack was placed in the temperature chamber as seen in Figure 5 to perform a series of tests under different controlled temperatures.The ambient temperatures 5 °C, 15 °C, 25 °C, 35 °C and 45 °C were used to determine the model parameters of the 12-cell battery.The load current is created using a programmable DC electronic load, and a programmable DC power supply for charging the battery cells.The power supply is utilized as a controlled voltage or current source with the output voltage from 0 to 36 V and current from 0 to 20 A. A current sensor LEM 50-P is used to measure the charge and discharge current.The NTC temperature sensors are utilized to measure the temperatures of the battery cells and the ambient temperature.The National Instruments DAQ device controlled all input and output data.The host

Experiment Tests for Battery Characterizations
A test environment for battery characterizations has been built in the laboratory as shown in Figure 4.The commercial LiFePO 4 battery cells (ANR26650M1-B from A123 System with Nanophosphate ® lithium-ion chemistry) were used in the experiments.The key specification of the battery cell is tabulated in Table 1.Battery cell or battery pack was placed in the temperature chamber as seen in Figure 5 to perform a series of tests under different controlled temperatures.The load current is created using a programmable DC electronic load, and a programmable DC power supply for charging the battery cells.The power supply is utilized as a controlled voltage or current source with the output voltage from 0 to 36 V and current from 0 to 20 A. A current sensor LEM 50-P is used to measure the charge and discharge current.The NTC temperature sensors are utilized to measure the temperatures of the battery cells and the ambient temperature.The National Instruments DAQ device controlled all input and output data.The host PC communicates with the DAQ device to monitor the power supply and charge and discharge status of the battery in real-time.As the data acquisition rate is limited in the embedded system, it is one sample per second.The host PC performs the model simulation and algorithm development using the battery's data received.A custom-designed pulse relaxation that includes the transient part and non-transient part (rather than simple constant current cycles often adopted in the literature) is employed in the SOC estimation as seen in Figure 7.

Static Capacity Test
As compared to the nominal capacity, the static capacity of a battery cell varies with the load current and the ambient temperature.The battery capacity testing determines the battery cell capacity in ampere-hours at a constant current (CC) discharge rate.This test provides a baseline for a battery cell for the advanced battery management algorithm development (e.g., SOC, SOH, and cell balancing).The test procedure follows the constant current constant voltage (CCCV) protocol and consists of the following steps.

1.
Charge the battery at 0.8 C rate (2 A) to the fully charged state in CCCV mode under the specified temperature.The battery is fully charged to 3.6 V when the current reaches 1 mA.

2.
Apply a 15-hour relaxation period before discharging the battery cell.

3.
Discharge at a constant current 0.8 C rate until the voltage reaches the battery minimum limit of 2.5 V.

4.
Record the data and calculate the static capacity as follows.
where Q d is the static capacity, I d is the discharge current in ampere, and t d is the discharge time in second.

Pulse Discharge Test
The pulse discharge test characterizes the battery voltage response (cell dynamics) at various SOCs and temperatures.The test comprises a series of discharge pulses across the full SOC range under specified temperature points.The test procedure is summarized as follows.

Cycling Aging Test
Cycling aging is a major factor that causes the battery to degrade and lose its capacity.When the capacity reduces to 80% of the beginning life capacity, the battery is considered to have reached its end of life (EOL).The static capacity of the battery is a non-linear function of charge-discharge cycling, Energies 2017, 10, 85 where N c is the charge-discharge cycling number.
The procedure of the one cycling test is illustrated as follows.The initial state of the battery is assumed to be fully discharged.

1.
Charge the battery to a fully charged state, follow step 1 in Section 3.1.

2.
Allow the battery to rest for 15 min until its temperature stabilized.

3.
Discharge at a constant current 0.8 C rate until the voltage reaches the battery minimum limit of 2.5 V.

4.
Record the data and proceed to another cycle after the battery rests for 15 min.
Based on the cycling aging testing designed above and the manufacturer's specifications in Table 1, the test will take around one year to perform.Thus, it is quite time-consuming to conduct such test.Since new battery cells were used in the experiment, the aging effect of the cells is therefore neglected.

Temperature-Dependent Battery Cell Parameters Identification
Many parameter identification methods are proposed in the literature.With its limitation in the embedded system resource, the lookup table approach was implemented in the battery pack model to allow more computation time to perform the SOC estimation and cell balancing.The static capacities of the battery cell were identified from the results of the static capacity test.Table 2 and Figure 6 illustrate the results of the static capacity test under the specified ambient temperatures, respectively.As seen in Figure 6, the static capacity of the battery cell increases as the ambient temperature increases.It reaches a steady state value at around 35 • C. where   is the charge-discharge cycling number.
The procedure of the one cycling test is illustrated as follows.The initial state of the battery is assumed to be fully discharged.
1. Charge the battery to a fully charged state, follow step 1 in Section 3.1.2. Allow the battery to rest for 15 min until its temperature stabilized.
3. Discharge at a constant current 0.8 C rate until the voltage reaches the battery minimum limit of 2.5 V. 4. Record the data and proceed to another cycle after the battery rests for 15 min.
Based on the cycling aging testing designed above and the manufacturer's specifications in Table 1, the test will take around one year to perform.Thus, it is quite time-consuming to conduct such test.Since new battery cells were used in the experiment, the aging effect of the cells is therefore neglected.

Temperature-Dependent Battery Cell Parameters Identification
Many parameter identification methods are proposed in the literature.With its limitation in the embedded system resource, the lookup table approach was implemented in the battery pack model to allow more computation time to perform the SOC estimation and cell balancing.The static capacities of the battery cell were identified from the results of the static capacity test.Table 2 and Figure 6 illustrate the results of the static capacity test under the specified ambient temperatures, respectively.As seen in Figure 6, the static capacity of the battery cell increases as the ambient temperature increases.It reaches a steady state value at around 35 °C .obvious that the difference of the terminal voltage between 45 min and 3 h is 0.02 mV (0.06% of the nominal voltage).Hence, to save the experiment time, 45 min was thought to be enough for relaxation due to the small change in the terminal voltage after 45 min for the selected LiFeO 4 battery.
Compared with low-rate current charge/discharge method, the proposed PDT method to obtain the OCV at certain SOC intervals (e.g., 10%) can reduce the measurement time by around 90%.The comparison of C/50 low-rate discharge profile and the 10% SOC step incremental OCV curve at 25 • C is shown in Figure 8.
Energies 2017, 10, 85 9 of 22 The value of OCV is identified from the results of the pulse discharge test (PDT) in this paper.The relaxation process example of battery PDT under 25 °C is shown in Figure 7. From the figure, it is obvious that the difference of the terminal voltage between 45 min and 3 h is 0.02 mV (0.06% of the nominal voltage).Hence, to save the experiment time, 45 min was thought to be enough for relaxation due to the small change in the terminal voltage after 45 min for the selected LiFeO4 battery.
Compared with low-rate current charge/discharge method, the proposed PDT method to obtain the OCV at certain SOC intervals (e.g., 10%) can reduce the measurement time by around 90%.The comparison of C/50 low-rate discharge profile and the 10% SOC step incremental OCV curve at 25 °C is shown in Figure 8.The value of OCV is identified from the results of the pulse discharge test (PDT) in this paper.The relaxation process example of battery PDT under 25 °C is shown in Figure 7. From the figure, it is obvious that the difference of the terminal voltage between 45 min and 3 h is 0.02 mV (0.06% of the nominal voltage).Hence, to save the experiment time, 45 min was thought to be enough for relaxation due to the small change in the terminal voltage after 45 min for the selected LiFeO4 battery.
Compared with low-rate current charge/discharge method, the proposed PDT method to obtain the OCV at certain SOC intervals (e.g., 10%) can reduce the measurement time by around 90%.The comparison of C/50 low-rate discharge profile and the 10% SOC step incremental OCV curve at 25 °C is shown in Figure 8.   Figure 9 shows a full voltage curve sample of PDT with 45 min relaxation at 25 • C. OCV approximates the terminal voltage of the battery at equilibrium state of every relaxation period.The OCV-SOC relationship curves under different temperatures are shown in Figure 10.As observed in Figure 10a, there is a higher OCV for the SOC value from 0.1 to 0.9.Also reflected in the close Energies 2017, 10, 85 10 of 22 view as shown in Figure 10b, is a different OCV between various temperatures.When SOC is 0.2, the maximum OCV is approximately 25 mV with SOC error of 10% which is between 5 • C and 45 • C. Therefore, the OCV cannot be represented by simply a curve fitting method (that is commonly adopted in the literature) to improve the accuracy of the OCV-SOC curve.From the Figure 8, 11 OCV data points can be gained for a full discharge period, which is 0~1 with the 10% SOC intervals.However, they might be insufficient to reflect all electrode features due to the low resolution.Interpolation is a common method to yield additional data.Here, we applied interpolation method for better resolution and as a result of reducing measurement time.Therefore, a lookup table with interpolation techniques is applied to obtain the real-time OCV under different temperatures.The lookup table is created and stored in the embedded microcontroller.The curves of the OCV are illustrated in Figure 11.With various SOCs and temperatures, the corresponding OCV can be obtained from the lookup table.
Energies 2017, 10, 85 10 of 22 OCV-SOC relationship curves under different temperatures are shown in Figure 10.As observed in Figure 10a, there is a higher OCV for the SOC value from 0.1 to 0.9.Also reflected in the close view as shown in Figure 10b, is a different OCV between various temperatures.When SOC is 0.2, the maximum OCV is approximately 25 mV with SOC error of 10% which is between 5 °C and 45 °C .Therefore, the OCV cannot be represented by simply a curve fitting method (that is commonly adopted in the literature) to improve the accuracy of the OCV-SOC curve.From the Figure 8, 11 OCV data points can be gained for a full discharge period, which is 0~1 with the 10% SOC intervals.However, they might be insufficient to reflect all electrode features due to the low resolution.
Interpolation is a common method to yield additional data.Here, we applied interpolation method for better resolution and as a result of reducing measurement time.Therefore, a lookup table with interpolation techniques is applied to obtain the real-time OCV under different temperatures.The lookup table is created and stored in the embedded microcontroller.The curves of the OCV are illustrated in Figure 11.With various SOCs and temperatures, the corresponding OCV can be obtained from the lookup table.OCV-SOC relationship curves under different temperatures are shown in Figure 10.As observed in Figure 10a, there is a higher OCV for the SOC value from 0.1 to 0.9.Also reflected in the close view as shown in Figure 10b, is a different OCV between various temperatures.When SOC is 0.2, the maximum OCV is approximately 25 mV with SOC error of 10% which is between 5 °C and 45 °C .Therefore, the OCV cannot be represented by simply a curve fitting method (that is commonly adopted in the literature) to improve the accuracy of the OCV-SOC curve.From the Figure 8, 11 OCV data points can be gained for a full discharge period, which is 0~1 with the 10% SOC intervals.However, they might be insufficient to reflect all electrode features due to the low resolution.
Interpolation is a common method to yield additional data.Here, we applied interpolation method for better resolution and as a result of reducing measurement time.Therefore, a lookup table with interpolation techniques is applied to obtain the real-time OCV under different temperatures.The lookup table is created and stored in the embedded microcontroller.The curves of the OCV are illustrated in Figure 11.With various SOCs and temperatures, the corresponding OCV can be obtained from the lookup table.In this Section,  1 ,  1 and  0 are identified from the results of PDT. Figure 12 is the relaxation cycle used to identify these parameters.The DC internal resistance  0 is calculated from the instantaneous rise of voltage using the following equation.
where   is the terminal voltage of sample , and  is the discharge current.
The abovementioned  0 is identified using the segment marked in red color shown in Figure 12.  1 and  1 represent the transient response of the battery voltage during the relaxation period.The identification process starts in the segment marked in green color as shown in Figure 12.The values of each parameter of the RC networks can be identified.The identified values will be tabulated in the 2-D lookup tables as shown in Figures 13-15.The experiments were conducted at the following temperatures 5 °C , 15 °C , 25 °C and 45 °C in order to include the influence of the ambient temperature to parameters  0 ,  1 and  1 .In this paper, a simplified lookup table with interpolation technique is applied to obtain the real-time OCV,  1 and  1 , which is a highly efficient method for the microcontroller in the embedded applications.Compared with other models with a complex identified process such as adaptive least square (ALS) and extended Kalman filter (EKF), this method reduces the burden on the processor greatly without large deficiency in performance.Table 3 shows the comparison result of  0 identification, which obtains the  0 value by the ALS method, EKF method and lookup table method implemented in the MATLAB environment, respectively.As shown in Table 3, the lookup table method can save much identification time without big differences in RMS.In this Section, R 1 , C 1 and R 0 are identified from the results of PDT. Figure 12 is the relaxation cycle used to identify these parameters.The DC internal resistance R 0 is calculated from the instantaneous rise of voltage using the following equation.
where U n is the terminal voltage of sample n, and I is the discharge current.In this Section,  1 ,  1 and  0 are identified from the results of PDT. Figure 12 is the relaxation cycle used to identify these parameters.The DC internal resistance  0 is calculated from the instantaneous rise of voltage using the following equation.
where   is the terminal voltage of sample , and  is the discharge current.
The abovementioned  0 is identified using the segment marked in red color shown in Figure 12.  1 and  1 represent the transient response of the battery voltage during the relaxation period.The identification process starts in the segment marked in green color as shown in Figure 12.The values of each parameter of the RC networks can be identified.The identified values will be tabulated in the 2-D lookup tables as shown in Figures 13-15.The experiments were conducted at the following temperatures 5 °C , 15 °C , 25 °C and 45 °C in order to include the influence of the ambient temperature to parameters  0 ,  1 and  1 .In this paper, a simplified lookup table with interpolation technique is applied to obtain the real-time OCV,  1 and  1 , which is a highly efficient method for the microcontroller in the embedded applications.Compared with other models with a complex identified process such as adaptive least square (ALS) and extended Kalman filter (EKF), this method reduces the burden on the processor greatly without large deficiency in performance.Table 3 shows the comparison result of  0 identification, which obtains the  0 value by the ALS method, EKF method and lookup table method implemented in the MATLAB environment, respectively.As shown in Table 3, the lookup table method can save much identification time without big differences in RMS.The abovementioned R 0 is identified using the segment marked in red color shown in Figure R 1 and C 1 represent the transient response of the battery voltage during the relaxation period.The identification process starts in the segment marked in green color as shown in Figure 12.The values of each parameter of the RC networks can be identified.The identified values will be tabulated in the 2-D lookup tables as shown in Figures 13-15.The experiments were conducted at the following temperatures 5 • C, 15 • C, 25 • C and 45 • C in order to include the influence of the ambient temperature to parameters R 0 , R 1 and C 1 .In this paper, a simplified lookup table with interpolation technique is applied to obtain the real-time OCV, R 1 and C 1 , which is a highly efficient method for the microcontroller in the embedded applications.Compared with other models with a complex identified process such as adaptive least square (ALS) and extended Kalman filter (EKF), this method reduces the burden on the processor greatly without large deficiency in performance.Table 3 shows the comparison result of R 0 identification, which obtains the R 0 value by the ALS method, EKF method and lookup table method implemented in the MATLAB environment, respectively.As shown in Table 3, the lookup table method can save much identification time without big differences in RMS.The model output terminal voltage was compared with the measured terminal voltage at the similar current loads to validate the equivalent circuit battery model.As shown in Figure 16, a cell battery model is implemented in the MATLAB/Simulink platform using the model identified in Section 4.1.The comparisons of the battery terminal voltages for both the experimental data and the simulation outputs under different temperatures such as 5 °C, 15 °C, 25 °C and 45 °C are shown in Figures 17-20, respectively.As seen in the individual error plots across the simulation time, it is evident that the model outputs follow the experimental data closely with a small error throughout the simulation time.The model output terminal voltage was compared with the measured terminal voltage at the similar current loads to validate the equivalent circuit battery model.As shown in Figure 16, a cell battery model is implemented in the MATLAB/Simulink platform using the model identified in Section 4.1.The comparisons of the battery terminal voltages for both the experimental data and the simulation outputs under different temperatures such as 5 °C , 15 °C , 25 °C and 45 °C are shown in Figures 17-20, respectively.As seen in the individual error plots across the simulation time, it is evident that the model outputs follow the experimental data closely with a small error throughout the simulation time.4. The comparison between the simulation and experiment at various temperatures shows a maximum RMS error of 7.2078 × 10 −5 .It shows the battery cell indeed operating quite poorly at a lower temperature (a common characteristic of a battery cell).From the figures, it is evident that the terminal voltage errors due to the suddenly changed current can be converged to around 0 quickly (e.g., within 1.2 × 10 −5 s); this means the model has a certain degree of robustness, which is relevant to the further study of the advanced algorithms.To test the robustness of the model under different ambient temperatures, a set of experimental data under 35 °C (not used for the parameter   4. The comparison between the simulation and experiment at various temperatures shows a maximum RMS error of 7.2078 × 10 −5 .It shows the battery cell indeed operating quite poorly at a lower temperature (a common characteristic of a battery cell).From the figures, it is evident that the terminal voltage errors due to the suddenly changed current can be converged to around 0 quickly (e.g., within 1.2 × 10 −5 s); this means the model has a certain degree of robustness, which is relevant to the further study of the advanced algorithms.To test the robustness of the model under different ambient temperatures, a set of experimental data under 35 °C (not used for the parameter  4. The comparison between the simulation and experiment at various temperatures shows a maximum RMS error of 7.2078 × 10 −5 .It shows the battery cell indeed operating quite poorly at a lower temperature (a common characteristic of a battery cell).From the figures, it is evident that the terminal voltage errors due to the suddenly changed current can be converged to around 0 quickly (e.g., within 1.2 × 10 −5 s); this means the model has a certain degree of robustness, which is relevant to the further study of the advanced algorithms.To test the robustness of the model under different ambient temperatures, a set of experimental data under 35 • C (not used for the parameter identification) was compared with the simulation model.The results in Figure 21 show that the RMS error of the terminal voltage between the simulation and experiment is approximately 1.5609 × 10 −5 .It indicates that the temperature-dependent battery model output can estimate the terminal voltage at a different ambient temperature with an acceptable error for the embedded applications.With the cell battery model validated, a 12-cell battery pack is used for SOC estimation and subsequent cell balancing.Figure 22 shows the power and thermal connection of the battery pack model in the series.The link of the battery cells is physically arranged serially as illustrated in Figure 23.The SOC estimation of the battery pack is different from a single battery cell.Figure 24 is the top level simulation environment for SOC estimation and cell balancing for the battery pack.The SOC estimation block computes the SOC of the 12-cell using the data collected from the experiment.Some researchers considered the whole pack as a single cell without taking into account the differences between the cells.However, the non-uniformity of the cells in the battery pack cannot be neglected for the embedded BMS development.Hence, a different SOC value of each cell is required to be estimated.In this case, the Ah method as shown in Figure 25 is used.With the cell battery model validated, a 12-cell battery pack is used for SOC estimation and subsequent cell balancing.Figure 22 shows the power and thermal connection of the battery pack model in the series.The link of the battery cells is physically arranged serially as illustrated in Figure 23.The SOC estimation of the battery pack is different from a single battery cell.Figure 24 is the top level simulation environment for SOC estimation and cell balancing for the battery pack.The SOC estimation block computes the SOC of the 12-cell using the data collected from the experiment.Some researchers considered the whole pack as a single cell without taking into account the differences between the cells.However, the non-uniformity of the cells in the battery pack cannot be neglected for the embedded BMS development.Hence, a different SOC value of each cell is required to be estimated.In this case, the Ah method as shown in Figure 25     With the cell battery model validated, a 12-cell battery pack is used for SOC estimation and subsequent cell balancing.Figure 22 shows the power and thermal connection of the battery pack model in the series.The link of the battery cells is physically arranged serially as illustrated in Figure 23.The SOC estimation of the battery pack is different from a single battery cell.Figure 24 is the top level simulation environment for SOC estimation and cell balancing for the battery pack.The SOC estimation block computes the SOC of the 12-cell using the data collected from the experiment.Some researchers considered the whole pack as a single cell without taking into account the differences between the cells.However, the non-uniformity of the cells in the battery pack cannot be neglected for the embedded BMS development.Hence, a different SOC value of each cell is required to be estimated.In this case, the Ah method as shown in Figure 25       The SOC estimation algorithm is shown in Figure 26.The SOC computation is grouped into two main parts.First, the SOC of each cell is determined.The Pack SOC #1 and Pack SOC #2 determine the minimum SOC and the average SOC, respectively.The battery cell is checked for any over- The SOC estimation algorithm is shown in Figure 26.The SOC computation is grouped into two main parts.First, the SOC of each cell is determined.The Pack SOC #1 and Pack SOC #2 determine the minimum SOC and the average SOC, respectively.The battery cell is checked for any over- The SOC estimation algorithm is shown in Figure 26.The SOC computation is grouped into two main parts.First, the SOC of each cell is determined.The Pack SOC #1 and Pack SOC #2 determine the minimum SOC and the average SOC, respectively.The battery cell is checked for any over-charging before it sends out an alarm or warning signal.The SOC estimation algorithm also gives additional SOC information for the subsequent cell balancing algorithm to prioritize the cell that needs to balance first.In this case, it should be the cell with the lowest SOC.
Energies 2017, 10, 85 18 of 22 charging before it sends out an alarm or warning signal.The SOC estimation algorithm also gives additional SOC information for the subsequent cell balancing algorithm to prioritize the cell that needs to balance first.In this case, it should be the cell with the lowest SOC.Since the SOC in each cell can be different, the cells need to be checked for over-charging and balanced to operate for a longer endurance in embedded applications.Hence, the cell balancing becomes an indispensable feature for real embedded BMS as it affects the lifespan and eventual safety of the battery power system.Different types of model-based cell balancing algorithms can be developed and validated in the MATLAB/Simulink environment using the battery pack model.For clarity, only the battery cells #1 to #4 of the battery pack are used for comparison.Cells #1 and #2 are employed for the passive balancing due to its simplicity and reliable performance.Cells #3 and #4 are not used for any balancing function as shown in Figure 27.Instead, it is used to compare the cell balancing results with cells #1 and #2 (that are not balanced).The balancing scheme is solely based on average voltage.If the cell is not equal to the mean voltage, the cell balancing will begin to increase the SOC.To do that, the SOC in each cell provides an input variable to the balancing decision block (named "cell balancing block").The initial SOC values of cells #1 to #4 are pre-set to 100%, 96%, 92% and 81%, respectively, to show different initial SOV values.The simulation result (without the cell balancing) is provided in Figure 28.The results indicate that battery cells with different initial states will lead to different terminal voltages, SOC distributions, and thermal behaviors.As shown in Figure 29, cells #1 and #2 after cell balancing can maintain the SOC across each cell, and the SOC across all the cells have improved by approximately 60% as compared to the one without the cell balancing.Since the SOC in each cell can be different, the cells need to be checked for over-charging and balanced to operate for a longer endurance in embedded applications.Hence, the cell balancing becomes an indispensable feature for real embedded BMS as it affects the lifespan and eventual safety of the battery power system.Different types of model-based cell balancing algorithms can be developed and validated in the MATLAB/Simulink environment using the battery pack model.For clarity, only the battery cells #1 to #4 of the battery pack are used for comparison.Cells #1 and #2 are employed for the passive balancing due to its simplicity and reliable performance.Cells #3 and #4 are not used for any balancing function as shown in Figure 27.Instead, it is used to compare the cell balancing results with cells #1 and #2 (that are not balanced).The balancing scheme is solely based on average voltage.If the cell is not equal to the mean voltage, the cell balancing will begin to increase the SOC.To do that, the SOC in each cell provides an input variable to the balancing decision block (named "cell balancing block").The initial SOC values of cells #1 to #4 are pre-set to 100%, 96%, 92% and 81%, respectively, to show different initial SOV values.The simulation result (without the cell balancing) is provided in Figure 28.The results indicate that battery cells with different initial states will lead to different terminal voltages, SOC distributions, and thermal behaviors.As shown in Figure 29, cells #1 and #2 after cell balancing can maintain the SOC across each cell, and the SOC across all the cells have improved by approximately 60% as compared to the one without the cell balancing.In summary, the proposed battery pack model can estimate the SOC of each cell and temperature between the cells.The passive cell balancing scheme was applied on the temperature-dependent battery model.Although the active balancing system has attracted more attention as of late, it is quite  In summary, the proposed battery pack model can estimate the SOC of each cell and temperature between the cells.The passive cell balancing scheme was applied on the temperature-dependent battery model.Although the active balancing system has attracted more attention as of late, it is quite In summary, the proposed battery pack model can estimate the SOC of each cell and temperature between the cells.The passive cell balancing scheme was applied on the temperature-dependent Energies 2017, 10, 85 21 of 22 battery model.Although the active balancing system has attracted more attention as of late, it is quite costly, possesses a sophisticated control structure and requires higher power consumption than passive cell balancing.

Conclusions
In this paper, a simple but effective battery model was proposed, which was suitable to be implemented in a microcontroller with limited resources for the embedded applications.Simplified lookup table with interpolation technique is applied to obtain the real-time open-circuit voltage (OCV), R 1 and C 1 , which is a highly efficient method for the microcontroller implementation in the embedded applications.Furthermore, based on the proposed cell model, a 12-cell series connected battery pack is systematically modeled, simulated and validated by actual experimental results.This paper mainly focused on the 12-cell LiFePO 4 battery pack for a more realistic simulation instead of a single battery cell.As a trade-off between the high fidelity and computation effort, the conductive thermal transfer is neglected in this paper.Instead of using the temperature as an external disturbance acting on the battery power system, the thermal influence due to convective heat transfer of each cell was included as parameters to couple both the equivalent circuit model (ECM) and the thermal model.Also, the temperature-dependent battery model was included to estimate the SOC that was balanced by an automatic cell balancing scheme.As compared with the experimental results, there exists a minimal root mean square error of the terminal voltage at a different ambient temperature (from 5 • C to 45 • C).The proposed simulation model allows SOC and temperature estimation of the battery cells for the embedded implementation.It can be used to develop and validate any advanced algorithms using the proposed battery cell/pack model.
For future works, the high current rate and effects of aging will be included.More experimental works will be conducted.The fault diagnosis approach will be performed on the final battery model.The mechanical enclosure will be used to hold the battery pack.

Figure 3 .
Figure 3. Coupled equivalent circuit model (ECM) and thermal model
ambient temperatures 5 • C, 15 • C, 25 • C, 35 • C and 45 • C were used to determine the model parameters of the 12-cell battery.

Figure 6 . 6 .
Figure 6.Static capacity under specified ambient temperature Figure 6.Static capacity under specified ambient temperature.

Figure 7 .
Figure 7. Relaxation process example of battery pulse discharge test (PDT).

Figure 7 .
Figure 7. Relaxation process example of battery pulse discharge test (PDT).

Figure 7 .
Figure 7. Relaxation process example of battery pulse discharge test (PDT).

Figure 9 .
Figure 9. Terminal voltage of pulse discharges test.

Figure 9 .
Figure 9. Terminal voltage of pulse discharges test.

Figure 9 .
Figure 9. Terminal voltage of pulse discharges test.

Figure 12 .
Figure 12.Relaxation period after the discharge pulses.Figure 12. Relaxation period after the discharge pulses.

Figure 12 .
Figure 12.Relaxation period after the discharge pulses.Figure 12. Relaxation period after the discharge pulses.

4. 2 .
Temperature-Dependent Battery Cell Parameters Validation The model output terminal voltage was compared with the measured terminal voltage at the similar current loads to validate the equivalent circuit battery model.As shown in Figure 16, a cell battery model is implemented in the MATLAB/Simulink platform using the model identified in Section 4.1.The comparisons of the battery terminal voltages for both the experimental data and the simulation outputs under different temperatures such as 5 • C, 15 • C, 25 • C and 45 • C are shown in Figures 17-20, respectively.As seen in the individual error plots across the simulation time, it is evident that the model outputs follow the experimental data closely with a small error throughout the simulation time.Energies 2017, 10, 85 13 of 22

Figure 16 .
Figure 16.Battery cell model for validation.

Figure 17 .
Figure 17.(a) Model validation at 5 °C; (b) Error between model output and experimental data.

Figure 16 .
Figure 16.Battery cell model for validation.

Figure 16 .
Figure 16.Battery cell model for validation.

Figure 17 .
Figure 17.(a) Model validation at 5 °C ; (b) Error between model output and experimental data.

Figure 17 .
Figure 17.(a) Model validation at 5 • C; (b) Error between model output and experimental data.

Figure 18 .
Figure 18.(a) Model validation at 15 °C ; (b) Error between model output and experimental data.

Figure 19 .
Figure 19.(a) Model validation at 25 °C ; (b) Error between model output and experimental data.

Figure 19 .
Figure 19.(a) Model validation at 25 °C ; (b) Error between model output and experimental data.

Figure 19 .
Figure 19.(a) Model validation at 25 • C; (b) Error between model output and experimental data.For comparison purposes, the root means square errors of the terminal voltage between the simulation and experimental results shown in Figures 17-20 at different temperatures are tabulated in Table4.The comparison between the simulation and experiment at various temperatures shows a maximum RMS error of 7.2078 × 10 −5 .It shows the battery cell indeed operating quite poorly at a lower temperature (a common characteristic of a battery cell).From the figures, it is evident that the terminal voltage errors due to the suddenly changed current can be converged to around 0 quickly (e.g., within 1.2 × 10 −5 s); this means the model has a certain degree of robustness, which is relevant to the further study of the advanced algorithms.To test the robustness of the model under

Energies 2017 ,
10, 85 15 of 22 identification) was compared with the simulation model.The results in Figure21show that the RMS error of the terminal voltage between the simulation and experiment is approximately 1.5609 × 10 −5 .It indicates that the temperature-dependent battery model output can estimate the terminal voltage at a different ambient temperature with an acceptable error for the embedded applications.

Figure 20 .
Figure 20.(a) Model validation at 45 °C ; (b) Error between model output and experimental data.

Figure 21 .
Figure 21.(a) Model validation at 35 °C ; (b) Error between model output and experimental data.

Figure 20 .
Figure 20.(a) Model validation at 45 • C; (b) Error between model output and experimental data.

Figure 20 .
Figure 20.(a) Model validation at 45 °C ; (b) Error between model output and experimental data.

Figure 21 .
Figure 21.(a) Model validation at 35 °C ; (b) Error between model output and experimental data.

Figure 21 .
Figure 21.(a) Model validation at 35 • C; (b) Error between model output and experimental data.
is used.

Figure 22 .
Figure 22.Battery cells' power connection and convective heat transfer in a battery pack model.

Figure 23 .
Figure 23.Current battery pack's physical connection (Left); and proposed final compact enclosure design (Right).

Figure 22 .
Figure 22.Battery cells' power connection and convective heat transfer in a battery pack model.
is used.

Figure 22 .
Figure 22.Battery cells' power connection and convective heat transfer in a battery pack model.

Figure 23 .
Figure 23.Current battery pack's physical connection (Left); and proposed final compact enclosure design (Right).Figure 23.Current battery pack's physical connection (Left); and proposed final compact enclosure design (Right).

Figure 23 .
Figure 23.Current battery pack's physical connection (Left); and proposed final compact enclosure design (Right).Figure 23.Current battery pack's physical connection (Left); and proposed final compact enclosure design (Right).

Figure 24 .
Figure 24.Battery pack validation set up in Simulink.

Figure 26 .
Figure 26.(a) Current pulse; (b) simulation battery pack SOC result for battery pack SOC.

Figure 26 .
Figure 26.(a) Current pulse; (b) simulation battery pack SOC result for battery pack SOC.

Figure 27 .
Figure 27.Cell balancing algorithm development in Simulink (for clarity only show 5-cell).Figure 27.Cell balancing algorithm development in Simulink (for clarity only show 5-cell).

Figure 27 .
Figure 27.Cell balancing algorithm development in Simulink (for clarity only show 5-cell).Figure 27.Cell balancing algorithm development in Simulink (for clarity only show 5-cell).

Figure 28 .
Figure 28.Battery pack simulation result without cell balancing: (a) current pulse (active when charging and negative when discharging); (b) voltage response of each cell; (c) SOC of each cell; (d) temperature of each cell.

Figure 29 .
Figure 29.Simulation result with cell balancing: (a) comparison of cell #1 to #4; (b) error between cell voltage and average voltage of cell #1 to #4 after balancing.

Figure 28 . 22 Figure 28 .
Figure 28.Battery pack simulation result without cell balancing: (a) current pulse (active when charging and negative when discharging); (b) voltage response of each cell; (c) SOC of each cell; (d) temperature of each cell.

Figure 29 .
Figure 29.Simulation result with cell balancing: (a) comparison of cell #1 to #4; (b) error between cell voltage and average voltage of cell #1 to #4 after balancing.

Figure 29 .
Figure 29.Simulation result with cell balancing: (a) comparison of cell #1 to #4; (b) error between cell voltage and average voltage of cell #1 to #4 after balancing.

Table 1 .
Battery cell and thermal specifications.

Table 2 .
Static capacities under specified ambient temperature

Table 2 .
Static capacities under specified ambient temperature

Table 3 .
Comparison results between adaptive least square (ALS), extended Kalman filter (EKF) and lookup table methods.

Table 3 .
Comparison results between adaptive least square (ALS), extended Kalman filter (EKF) and lookup table methods.

Table 3 .
Comparison results between adaptive least square (ALS), extended Kalman filter (EKF) and lookup table methods.

Table 4 .
Root mean square (RMS) error of terminal voltage between simulation and experimental results.

Table 4 .
Root mean square (RMS) error of terminal voltage between simulation and experimental results.

Table 4 .
Root mean square (RMS) error of terminal voltage between simulation and experimental results.