Sliding Mode Observer for State-of-Charge Estimation Using Hysteresis-Based Li-Ion Battery Model

: Lithium-ion battery devices are essential for energy storage and supply in distributed energy generation systems. Robust battery management systems (BMSs) must guarantee that batteries work within a safe range and avoid the damage caused by overcharge and overdischarge. The state-of-charge (SoC) of Li-ion batteries is difﬁcult to observe after batteries are manufactured. The hysteresis phenomenon inﬂuences the existing battery modeling and SoC estimation accuracy. This research applies a terminal sliding mode observer (TSMO) algorithm based on a hysteresis resistor-capacitor (RC) equivalent circuit model to enable accurate SoC estimation. The proposed method is evaluated using two dynamic battery tests: the dynamic street test (DST) and the federal urban driving schedule (FUDS) test. The simulation results show that the proposed method achieved high estimation accuracy and fast response speed. Additionally, real-time battery information, including battery output voltage and SoC, was acquired and displayed by an automatic monitoring system. The designed system is valuable for all battery application cases.


Introduction
The conventional centralized electricity distribution mode and existing electric power generation are challenged to meet the ever-changing and growing energy requirements of the 21st century due to increasing population and economic growth. Traditionally, fossil fuels are the primary energy sources used for electricity generation. The combustion of fossil fuels leads to greenhouse gas emissions, which cause global warming. Therefore, there is an urgent need for an energy transition from fossil fuels to renewable energy sources, such as solar energy, to alleviate atmospheric contamination and maximize the efficiency of energy utilization.
Since most renewable energy sources are intermittent in nature, battery storage systems always couple with energy generators to store excess power and supply appliances when it is needed. Lithium-ion (Li-ion) batteries and lead-acid batteries are recognized as having the most mature technologies employed as energy storage devices in photovoltaics solar systems. Compared with lead-acid batteries, Li-ion batteries have advantages with high power density, quick charging, long lifespan, and low maintenance [1]. However, Li-ion batteries have a safe working zone, e.g., overcharge accelerates the temperature increase in batteries, which may induce a fire. Thus, robust battery management systems (BMSs) are required to guarantee that batteries work within a safe range.

•
Formalizing the hysteresis-based equivalent circuit model for Li-ion battery, based on which the charging and discharging processes are treated differently during the SoC estimation. • A terminal sliding mode observer is designed with theoretical proof for estimating the SoC of a Li-ion battery in real time.
Extensive simulations using the practical database have shown that higher accuracy and faster response speed can be achieved simultaneously for the SoC estimation through integrating the hysteresis effect into the battery model, while the computational complexity remains roughly the same as that of the resistor-capacitor (RC) equivalent circuit model.
To the best of our knowledge, this study is the first to consider the hysteresis effect to improve the SoC estimation accuracy using the TSMO-based estimation method. In addition, this paper has also designed an automatic battery state monitoring system to acquire and display real-time battery information, including voltage and SoC.
The rest of this paper is organized as follows: Section 2 describes the hysteresis effect during battery charge and discharge and battery model establishment. Section 3 applies three TSMOs to observe a hysteresis-based battery model. Section 4 presents simulation results using two dynamic battery tests. Section 5 depicts the design of an automatic battery state monitoring system. Section 6 concludes the study and shows the future roadmap.

Rechargeable Battery Model
The electrochemical reaction process in Li-ion batteries is complex. A precise battery model is a prerequisite for an accurate battery SoC estimation. An equivalent circuit model can be seen as one of the best choices due to less computation and simple structure. However, due to the hysteresis phenomenon during battery charge and discharge, an equivalent circuit model cannot comprehensively depict the electrochemical characteristics. Hysteresis models usually combine with other types of battery models to depict the OCV discrepancy. Our previous study [19] investigated the performance of battery SoC estimation with and without hysteresis included based on the Luenberger observer. Simulation results showed better battery modeling and SoC estimation accuracy performance when adding a hysteresis model. Therefore, the same battery model that includes hysteresis terms will be used in this research.

State-of-Charge and Open-Circuit Voltage Curve
Battery state-of-charge (SoC) indicates the residual capacity of a battery device, which can be defined as charges accumulated with time: .
where Z denotes SoC and .
Z is the changing rate of SoC; t 0 is the initial time and t is the current time; C n is the capacity of the battery; and I is the input current.
Accurate and fast battery SoC estimation ensures efficient battery charge and discharge and allows battery life extension. However, battery SoC is hard to observe under dynamic Taking a 18650 type battery [27] as an example, it can be seen in Figure 1a that the OCV curves are discrepant during charge and discharge due to the hysteresis effect, denoted by OCV up and OCV lw . SoC values are different at the same voltage value. The gap between SoC values during charge and discharge is illustrated in Figure 1b and indicated using red arrows in Figure 1a. This gap influences battery SoC estimation accuracy and could cause approximately a maximum of 5% SoC error.
where denotes SoC and ̇ is the changing rate of SoC; 0 is the initial time and is the current time; is the capacity of the battery; and is the input current. Accurate and fast battery SoC estimation ensures efficient battery charge and discharge and allows battery life extension. However, battery SoC is hard to observe under dynamic operating conditions. The battery voltage is a known function of SoC during open-circuit conditions. The SoC value could be obtained from the open-circuit voltage (OCV) curve.
Taking a 18650 type battery [27] as an example, it can be seen in Figure 1a that the OCV curves are discrepant during charge and discharge due to the hysteresis effect, denoted by and . SoC values are different at the same voltage value. The gap between SoC values during charge and discharge is illustrated in Figure 1b and indicated using red arrows in Figure 1a. This gap influences battery SoC estimation accuracy and could cause approximately a maximum of 5% SoC error.

Hysteresis Based Li-ion Battery Model
The hysteresis model [28] is used to depict the battery hysteresis phenomenon: where is a positive constant used to influence the rate of decay; ℎ denoted hysteresis voltage is affected by battery SoC value and operation time; and ( ,) is related to the SoC and the rate of SoC used to express the maximum deviation from ( ). ( ,) can be formed as follows: where ( ) denotes the average value; ( ) is a signum function: ( ) = 1 for battery charge and −1 for battery discharge.
Because involving the hysteresis model could increase model accuracy, we use the same battery model as in our previous study [19]. The model combines a hysteresis model and a first-order resistor-capacitor (RC) equivalent circuit model (ECM) (Figure 2). The

Hysteresis Based Li-ion Battery Model
The hysteresis model [28] is used to depict the battery hysteresis phenomenon: where γ is a positive constant used to influence the rate of decay; V h denoted hysteresis voltage is affected by battery SoC value and operation time; and H Z, where OCV avg (Z) denotes the average value; sgn(x) is a signum function: sgn(x) = 1 for battery charge and −1 for battery discharge.
Because involving the hysteresis model could increase model accuracy, we use the same battery model as in our previous study [19]. The model combines a hysteresis model and a first-order resistor-capacitor (RC) equivalent circuit model (ECM) (Figure 2). The hysteresis model is circled by a dotted line ( Figure 2) which consists of average OCV and hysteresis voltage.

Real-Time Battery SoC Estimation Based on Terminal Sliding Mode Observe
The Luenberger and sliding mode observers are insensitive to measurement external disturbances, and internal parameter uncertainties, generally used for SoC estimation. However, keeping the balance of the convergence speed and mod racy is challenging in terms of the Luenberger observer. The terminal sliding m server (TSMO) proposed in [15] used continuous high-gain feedback to force es states to a designed non-linear hypersurface. Thus, three battery states ( , ( ), can converge to real values in finite time after reaching the hypersurface, rather asymptotical convergence. In addition, the TSMO avoids the utilization of low-pas that incur phase lag. Therefore, higher estimation accuracy and faster response sp be obtained simultaneously compared with the Luenberger observer-based metho paper improves the battery SoC estimation accuracy by considering the hystere nomenon.
Three TSMOs based on the hysteresis RC ECM were designed to estimate th tery states ( ,  . . . where In Equations (5)- (7), battery parameters, including the capacity of the battery (C n ), capacitor (C p ), diffusion resistance (R p ), and Ohmic resistance (R t ), can be obtained via the recursive least square (RLS) method. ∆ f denotes the model uncertainty and I denotes the input current. Since V oc (Z) is a function of SoC, the rate of SoC is expressed by V oc (Z), where Z denotes SoC and k is the slope of the SoC function.

Real-Time Battery SoC Estimation Based on Terminal Sliding Mode Observer
The Luenberger and sliding mode observers are insensitive to measurement noises, external disturbances, and internal parameter uncertainties, generally used for battery SoC estimation. However, keeping the balance of the convergence speed and model accuracy is challenging in terms of the Luenberger observer. The terminal sliding mode observer (TSMO) proposed in [15] used continuous high-gain feedback to force estimated states to a designed non-linear hypersurface. Thus, three battery states (V t , V oc (Z), and V p ) can converge to real values in finite time after reaching the hypersurface, rather than an asymptotical convergence. In addition, the TSMO avoids the utilization of low-pass filters that incur phase lag. Therefore, higher estimation accuracy and faster response speed can be obtained simultaneously compared with the Luenberger observer-based method. This paper improves the battery SoC estimation accuracy by considering the hysteresis phenomenon.
Three TSMOs based on the hysteresis RC ECM were designed to estimate three battery states (V t , V oc (Z), and V p ). The output voltage (V t ) and input current (I) are external measurements. The open-circuit voltage (V oc (Z)) and polarization voltage (V p ) are internal states, which work as intermediate variables. Three observation errors are expressed by e t = V t −V t ; e oc = V oc (Z) −V oc (Z); and e p = V p −V p , where estimated values can be defined by a "hat".

Estimation of the Output Voltage
For the output voltage observer, the control signal u t is added at the end of the output voltage state equation to drive the output voltage to the real value: The error system for the output voltage is: The sliding hyperplane for output voltage is chosen as follows: where β t , ρ t1 , and ρ t2 are positive constants. The sliding hyperplanes and appropriate control signals allow the estimates to converge to the actual system in a finite time. The control signal of the output voltage observer consists of a non-linear control term (u n ) and equivalent control term (u eq ). The non-linear control term (u n ) forces the estimated state errors to reach the designed hypersurface, while the equivalent control term (u eq ) allows them to slide along with the desired dynamic behavior and to converge to zero: oc (Z) and η t is a positive constant. When plugging (9)-(13) into (10), the following equations can be formed as below: The system stability can be verified by choosing the Lyapunov candidate function as e oc S t − k t |S t | ≤ −η t |S t | ≤ 0, for S t = 0, the output voltage could converge to the true value in finite time. When the output voltage reaches the sliding surface, the open-circuit voltage error can be calculated as e oc = u tn /a 1 .

Estimation of the Open-Circuit Voltage
Instead of using the average OCV value (OCV avg (Z)) to design an open-circuit voltage observer proposed in [14], this paper applies a more accurate open-circuit voltage value to form an observer by considering hysteresis, which can be expressed byV oc (Z) = .V The error system for the open-circuit voltage is: . e oc = ka 2 e t − ka 2 e oc − ka 2 e p − u oc , e oc + β oc e oc ρ oc1 /ρ oc2 , where β oc , ρ oc1 , and ρ oc2 are positive constants.
The following control signal forces the open-circuit voltage error to the sliding hyperplane, and then pushes it to zero: u oceq = ka 2 e t − ka 2 e oc + β oc e oc ρ oc1 /ρ oc2 , where p , and η oc is a positive constant. When plugging (15)(16)(17)(18)(19) into (16), the following equations can be formed as below:

Estimation of the Polarization Voltage
After getting the polarization voltage error, the polarization voltage observer can be chosen as follows, where u p is the control signal of the polarization voltage observer: The error system for the polarization voltage is: .
The sliding hyperplane for the polarization voltage is chosen as follows: where β p , ρ p1 , and ρ p2 are positive constants. Then the control signals of the polarization voltage can be designed as follows: where f and η p is a positive constant. When plugging (21)(22)(23)(24)(25) into (22), the following equations can be formed as below: The Lyapunov candidate function for the polarization voltage can be chosen as f S p − k p S p ≤ −η p S p ≤ 0, for S p = 0, the polarization voltage could converge to the true values in finite time. Battery SoC is obtained through the OCV curve after three estimated states converge to actual battery states.
Compared with the Luenberger observer-based SoC estimation method, the TSMObased method introduces switching control signals to quickly force estimated states to approach actual values and the designed hyperplanes to converge states to real values in finite time so that the estimation accuracy has been increased.

Results and Discussion
The experimental data used in this paper were collected from the database provided by the Center for Advanced Life Cycle Engineering (CALCE) at the University of Maryland [27]. The battery tests were carried out at room temperature (25 • C). The parameters of the battery are shown in Table 1. Temperature is another factor that impacts battery SoC. The methodology proposed in this study is valuable for other temperature cases.

Li-ion Battery Test Samples
We evaluate the performance of battery SoC estimation using two dynamic battery tests: the dynamic street test (DST) and the federal urban driving schedule (FUDS) test [27]. The DST simulates simple dynamic loading conditions of a Li-ion battery, while the FUDS represents more complex power demands of higher standard battery applications [27]. The voltage and current profiles of the 18650 Li-ion battery under DST and FUDS are shown in Figure 3. From Figure 3, it can be seen that DST and DUDS have the same voltage variation trend and current variation range, while the FUDS has more complex and frequent test profiles.

Performance Evaluation between Different Battery Models
To verify the accuracy of estimating battery SoC by TSMO based on the hysteresis RC model, we compare the performance of the TSMO-based battery SoC estimation method with and without hysteresis included [15] under two dynamic batteries tests (DST and FUDS). The red dotted line indicates estimated results based on the hysteresis RC battery model, while the solid blue line indicates estimated results based on the nominal electrical circuit mode (without considering the hysteresis effect) (Figure 4).
The estimated SoC is compared with the measured SoC (solid green line) using DST and FUDS, which are shown in Figure 4b,d. Their corresponding simulation results from 3000 s to 5000 s are enlarged in Figure 4b,d to reflect the usual battery discharge conditions that the SoC value drops from 0.6 to 0.4. The root means square error (RMSE) is used to evaluate how close a fitted line consisting of estimates is to the measured data points. tests: the dynamic street test (DST) and the federal urban driving schedule (FUDS) test [27]. The DST simulates simple dynamic loading conditions of a Li-ion battery, while the FUDS represents more complex power demands of higher standard battery applications [27]. The voltage and current profiles of the 18650 Li-ion battery under DST and FUDS are shown in Figure 3. From Figure 3, it can be seen that DST and DUDS have the same voltage variation trend and current variation range, while the FUDS has more complex and frequent test profiles.

Performance Evaluation between Different Battery Models
To verify the accuracy of estimating battery SoC by TSMO based on the hysteresis RC model, we compare the performance of the TSMO-based battery SoC estimation method with and without hysteresis included [15] under two dynamic batteries tests (DST and FUDS). The red dotted line indicates estimated results based on the hysteresis RC battery model, while the solid blue line indicates estimated results based on the nominal electrical circuit mode (without considering the hysteresis effect) (Figure 4).
The estimated SoC is compared with the measured SoC (solid green line) using DST and FUDS, which are shown in Figure 4b,d. Their corresponding simulation results from 3000 s to 5000 s are enlarged in Figure 4b,d to reflect the usual battery discharge conditions

Performance Evaluation between Different Observer Methods
To verify the response speed of estimating battery SoC, the performance of battery SoC estimation has been evaluated using Luenberger observers [19] (solid lines, Figure 5) and TSMOs (dotted lines, Figure 5  From Figure 4, the red dotted line (indicating estimated SoC using the modified model) is closer to the solid green line (indicating measured SoC). In addition, battery SoC varies more frequently under the FUDS test. Therefore, the FUDS test requires a faster response speed and a more stable system. The RMSEs are 1.24% and 1.34% under DST and FUDS tests based on the nominal electrical circuit model, while the RMSEs are 0.95% under both DST and FUDS tests based on the hysteresis RC battery model. Therefore, the proposed observer generates a remarkably smaller estimation error with RMSE under 1%.

Performance Evaluation between Different Observer Methods
To verify the response speed of estimating battery SoC, the performance of battery SoC estimation has been evaluated using Luenberger observers [19] (solid lines, Figure 5) and TSMOs (dotted lines, Figure 5) based on the hysteresis RC battery model with different initial SoC guess values. Taking initial SoC guess values at 0.7, 0.5, and 0.3 as examples, both observer-based methods can force the estimated states to converge to the measured SoC (solid green line, Figure 5).  Figure 6 illustrates the estimated results from 0 s to 4000 s. Figure 5a,c show the comparative results of convergence speed between Luenberger observers and TSMOs under DST and FUDS. Figure 5b,d illustrate the SoC estimation error. It is clear that the TSMO has a faster response speed compared with the Luenberger observer. For Luenberger observer-based SoC estimation, there is a specific point to which all the curves converged. Since the estimated curves are overlapped after that point, it can be identified as the convergence point and represents the convergence time of the algorithm. Regarding the terminal sliding motion and finite time convergence equations given by [15], the convergence time of TSMO is influenced by the SoC guess values. Therefore, the estimated curves cannot be overlapped.
From the above experimental results, it is clear that battery SoC estimation accuracy and response speed have been improved by considering the hysteresis and using TSMOs.

Automatic Monitoring System
An automatic monitoring system allows real-time data display and fault alarm,   Figure 5b,d illustrate the SoC estimation error. It is clear that the TSMO has a faster response speed compared with the Luenberger observer. For Luenberger observer-based SoC estimation, there is a specific point to which all the curves converged. Since the estimated curves are overlapped after that point, it can be identified as the convergence point and represents the convergence time of the algorithm. Regarding the terminal sliding motion and finite time convergence equations given by [15], the convergence time of TSMO is influenced by the SoC guess values. Therefore, the estimated curves cannot be overlapped. sensors (GLT-B direct voltage intelligent sensors) for data acquisition and signal e with the upper machine through RS485 serial interface using Modbus protoc CR1000X Datalogger and its software for providing data storage, processing and stration; and (3) a Data Transfer Unit (DTU) for data publishing. The automated m ing system will output voltage, current, and SoC of the storage batteries. This set also be used as a reference for monitoring other measurable parameters.  From the above experimental results, it is clear that battery SoC estimation accuracy and response speed have been improved by considering the hysteresis and using TSMOs.

Automatic Monitoring System
An automatic monitoring system allows real-time data display and fault alarm, which is the fundamental basis for battery management systems (BMS) and subsequent Internet of things (IoT) applications. Based on the proposed battery SoC estimation algorithm in Section 3, an automatic monitoring system is developed for energy storage devices in power stations, as shown in Figure. 6. The monitoring system set-up includes: (1) sensors (GLT-B direct voltage intelligent sensors) for data acquisition and signal exchange with the upper machine through RS485 serial interface using Modbus protocol; (2) a CR1000X Datalogger and its software for providing data storage, processing and demonstration; and (3) a Data Transfer Unit (DTU) for data publishing. The automated monitoring system will output voltage, current, and SoC of the storage batteries. This setting can also be used as a reference for monitoring other measurable parameters.

• Data Acquisition
In the battery monitoring system, sensors are used to measure the output voltage and current of the Li-ion battery with a time interval of every 5 s. The sampled voltage and current are transmitted through the RS485 communication interface following the support Modbus protocol. In this case, we choose one of the most common, stable, and cheap sensors used in industry, GLT-B direct voltage intelligent sensors [29]. In addition to sensing the physical change and transmit signals, the data acquisition system is capable of strengthening input signals for further processing.

• Data Processing
A data logger is adopted for providing signal measurement and data storage. The program algorithm of the data logger could calculate battery SoC based on the measured voltage and current.
The CR1000X datalogger [30] of Campbell Scientific, Inc., is used for converting electrical signals into sampled data, which is stored in its internal memory. The CR1000X datalogger is a low-powered device that provides a precision measurement of sensors, drives direct communication and telecommunications, analyses, and stores data and programs onboard [30]. BASIC-like programming language, CRBasic [31], has been used to support data processing and analysis routines. The LoggerNet software [32] is used to support programming, communication, and data retrieval between data loggers and a PC computer. Real-time collected battery data could be observed and analyzed by the software. By programming the data logger, the battery SoC can be calculated using the algorithm in Section 3. The real-time measured battery input current, output voltage, and calculated SoC results will be demonstrated in a table and graph on the PC. To simplify the test, the input current is chosen as a constant value 2A. Then, the output voltage and calculated SoC is shown in Figure 7a,b. From Figure 7, it can be seen that during the battery discharge, battery output voltage and SoC values drop simultaneously.
Internet of things (IoT), providing wireless long-distance data transmission through public cellular networks. After connecting DTU to a data logger through RS485, battery information could be published through a wireless network. Therefore, real-time Li-ion battery information, including output voltage, current, and SoC, could be both automatically monitored for safety reasons and published for subsequent processing in battery networks.

Conclusions
The purpose of this research is to rapidly and accurately acquire real-time battery SoC, which could ensure batteries work within a safe range and prevent overcharge and over-discharge. The accuracy of battery SoC estimation has been increased using a hysteresis RC battery model, which diminishes estimated errors due to the hysteresis effect. By applying a terminal sliding mode observer (TSMO), higher estimation accuracy and faster response speed can be obtained simultaneously compared with the Luenberger observerbased method. The battery SoC estimation accuracy has been evaluated under two dynamic battery tests based on battery models with and without hysteresis included using TSMO. Additionally, the response speed of battery SoC estimation was verified using different observer methods, Luenberger observers and TSMOs, based on the hysteresis RC battery model. Simulation results show that the TSMO-based SoC estimation method achieves higher estimation accuracy and faster response speed when integrating hysteresis effect into RC equivalent circuit battery model compared with the Luenberger observer. Moreover, real-time battery information, including output voltage and SoC, was acquired and demonstrated by a designed automatic monitoring system. The designed

• Data Publishing
A data transfer unit (DTU) is required to provide the conversion between serial data and IP data. The F2X16 V2 series IP Modem [33] is a wireless data terminal used in the Internet of things (IoT), providing wireless long-distance data transmission through public cellular networks. After connecting DTU to a data logger through RS485, battery information could be published through a wireless network. Therefore, real-time Li-ion battery information, including output voltage, current, and SoC, could be both automatically monitored for safety reasons and published for subsequent processing in battery networks.

Conclusions
The purpose of this research is to rapidly and accurately acquire real-time battery SoC, which could ensure batteries work within a safe range and prevent overcharge and over-discharge. The accuracy of battery SoC estimation has been increased using a hysteresis RC battery model, which diminishes estimated errors due to the hysteresis effect. By applying a terminal sliding mode observer (TSMO), higher estimation accuracy and faster response speed can be obtained simultaneously compared with the Luenberger observer-based method. The battery SoC estimation accuracy has been evaluated under two dynamic battery tests based on battery models with and without hysteresis included using TSMO. Additionally, the response speed of battery SoC estimation was verified using different observer methods, Luenberger observers and TSMOs, based on the hysteresis RC battery model. Simulation results show that the TSMO-based SoC estimation method achieves higher estimation accuracy and faster response speed when integrating hysteresis effect into RC equivalent circuit battery model compared with the Luenberger observer. Moreover, real-time battery information, including output voltage and SoC, was acquired and demonstrated by a designed automatic monitoring system. The designed system is valuable for all battery application cases. Future works could focus on battery information exchange and energy control.