0% found this document useful (0 votes)
14 views10 pages

Developing A Battery Monitoring System Software in Matlab Simulink Environment Using Kalman Filter

The document discusses the development of a battery monitoring system software using a Kalman filter in a Matlab Simulink environment, focusing on lead-acid batteries commonly used in vehicles. It details the importance of accurately estimating the state of charge (SOC) for battery performance and reliability, and presents a graphical interface for real-time monitoring and control. The software is designed to be easily implemented with real batteries, allowing for continuous data recording and parameter analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Developing A Battery Monitoring System Software in Matlab Simulink Environment Using Kalman Filter

The document discusses the development of a battery monitoring system software using a Kalman filter in a Matlab Simulink environment, focusing on lead-acid batteries commonly used in vehicles. It details the importance of accurately estimating the state of charge (SOC) for battery performance and reliability, and presents a graphical interface for real-time monitoring and control. The software is designed to be easily implemented with real batteries, allowing for continuous data recording and parameter analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

International Journal of Applied Power Engineering (IJAPE)

Vol.8, No.1, April 2019, pp. 1~10


ISSN: 2252-8792 DOI: 10.11591/ijape.v8.i1.pp1-10  1

Developing a battery monitoring system software in matlab


simulink environment using kalman filter

Alireza Rahighi1, Seyed Mohammad Hadi Seyed Kashani2, Behrang Sakhaee3


1,3
Ferdowsi University of Mashhad, Iran
2
Islamic Azad University of Mashhad, Iran

Article Info ABSTRACT


Article history: Batteries play a vital role in electrical equipments and electrical engineering
tools. In addition, in vehicles, the duties of the battery is very important, both
Received Aug 24, 2018 in providing initial start energy for conventional cars and movement energy
Revised Oct 11, 2018 for electric vehicles. Therefore, the batteries could be counted as one of the
Accepted Dec 28, 2018 most important segments of the electric vehicles. The batteries used in
vehicles have various types. The most utilized of which in vehicles are the
lead-acid batteries. Due to the noticeable privileges of the lead-acid batteries,
Keywords: they have been widely used in vehicles. The battery of the system, which
have been processed in this project, is a traction battery with 24V nominal
Battery voltage and 500Ahours nominal capacity. In this project, the Kalman filter
Battery monitoring system method has been used in order to estimate the remaining amount of battery’s
Charge charge. Kalman filter is an algorithm that estimates the state of a dynamic
Kalman-Filter system using a set of measurements including fault in a specific time period.
Lead-acid Having implemented the Kalman filter to the dynamic model of the battery,
State of charge an estimation of state of the charge (SOC) and battery parameters have been
acquired. This operation was simulated in Matlab Simulink environment and
the results of the simulation were compared with the real amounts of the
parameters achieved from prior experiments to make sure about the accuracy
of the results. In the designed software, a graphical environment has been
developed in order to providing an appropriate interface and simplifying the
software performance. The program can be easily implemented to a real
battery and calculate the desired parameters.

Copyright © 2019 Institute of Advanced Engineering and Science.


All rights reserved.

Corresponding Author:
Alireza Rahighi,
Faculty of Engineering,
Ferdowsi University of Mashhad,
Azadi square, Mashhad, Iran.
Email: [email protected]

1. INTRODUCTION
Nowadays, batteries are known to be the most important energy storage equipment in fast growing
electrical vehicles and smart grids. Due to wide presence of batteries in a large variety of applications
including generating and consuming systems, it is completely essential to identify the state of charge (SOC)
and aging conditions of batteries. Batteries play an important role in performance of electric systems.
Therefore, it is clear that with increasing capabilities of the systems, introducing renewable energy sources
and rising penetration of electric and hybrid vehicles, batteries are of great importance in electrical
researches. In addition, the role of batteries as fundamental devices for maintaining fault free performance
and increasing reliability of the systems have been widely investigated [1]. The desirable performance of
batteries is highly related to appropriate estimation of SOC and control of them [2]. So, it is essential to
provide proper performance of the batteries and electrical devices by measuring and estimation of SOC.

Journal homepage: http://iaescore.com/journals/index.php/IJAPE


2  ISSN: 2252-8792

Battery monitoring enables us to utilize the full capability of the battery in order to energizing the devices
that need electrical energy [1,2].
For dynamic modeling of lead acid batteries, several models based different assumptions have been
proposed so far. From which we can refer to the following works: Battery modeling using the Thevenin
model in [3]. In this model, the temperature is assumed to be constant. Battery modeling using kopty model
by Bruno Francois [4]. In this model all parameters are assumed constant. Non-linear time series models
using neural network system were also been used in order to enhance the existing non-linear dynamic
models [5].
The model presented in our project is the proposed model of lead-acid battery introduced by V. Pop,
et al [6], which is discussed further in detail. The battery structure is shown in form of a nonlinear circuit
equivalent in Figure 1. The structure consists of two parts including the main branch that estimates the
battery dynamics in various conditions and the side branch defines battery behavior at the end of the charging
process. Also in the simulated model, variation of parameters and the effect of temperature in battery
behavior change is considered.

Figure 1. Dynamic model of the battery [6]

Determining the battery charging mode (SOC) is based on the complexity or simplicity of the
battery type used in it. A brief overview of the methods used to estimate the charging of batteries comes in
the following lines. Various methods for the SOC estimation were suggested, such as methods based on the
electrochemical equations of the battery [7], frequency-based methods using the Electrochemical Impedance
Spectroscopy (EIS) [6].
The Coulomb count [8], adaptive and nonlinear methods such as extended kalman filter [9] and
sliding mode observer [10] are the proposed methods for the SOC estimation based on the battery equivalent
model. In [11], the battery model is considered similar to a Linear Time Variable (LTV). In this model the
load current (iL) is considered as an input and the terminal voltage (vT) is considered as an output. Moreover,
an online adaptive recognition algorithm is used to identify battery model parameters at every time step. This
model is continuously updated and a reduced order observer has been introduced. In our research, the kalman
filtering model is used to estimate battery parameters. Kalman filtering is one of the most successful
algorithms of estimation and is able to estimate the internal states of the system, which are not directly
measurable by discrete models of the state space of dynamic systems. Therefore, many researches which
have been done on the estimation of the charging of batteries, have taken advantage of kalman filtering
algorithm [12, 13, 14, 15, 16]. In some of the researches, the estimator has been used to estimate battery open
circuit voltage or some internal battery parameters which have a direct relationship with battery’s state of
charge [12, 13]. In this method, finding the correction parameter between open circuit voltage and loaded
voltage of the battery is an important problem, which could be solved by defining two linearization
areas [17].
In other cases, state of charge is considered as one of the state variables of battery’s model and is
directly estimated using extended kalman filtering [12, 13, 15, 16]. One of the advantages of kalman filtering
algorithm is its ability to apply to any kind of battery and one of its faults is its high computational volume.

Int J Appl Power Eng, Vol. 8, No. 1, April 2019: 1 – 10


Int J Appl Power Eng ISSN: 2252-8792  3
In our research, the kalman filtering model [6], as shown in Figure 2 is used in order to estimate the
SOC of the system. Furthermore, Matlab/Simulink based software has been designed to calculate the SOC of
the battery and identify the critical parameters of the battery. In this program the effect of the ambient
temperature on the battery’s behavior has been considered. In addition, the real time amounts of the desired
parameters is shown. Furthermore, the record of battery charge cycles is continuously saved. Moreover, the
software is capable to be connected to a real battery via a port and doing the desired tasks and functions
without any wide change in the program coding.

Figure 2. Control diagram of the kalman filter [6]

In the second section, the SOC estimation algorithm and a description of the reviewed device has
been presented. In the third section the different parts of the software has been introduced. In the fourth
paragraph an execution of the program has been represented. Finally, the conclusions and suggestions for
further researches are offered.

2. SOC ESTIMATION
Explaining In this section, an algorithm for state of the charge estimation for simulated battery
models has been proposed. According to [18], the problem solving using a simulated model, compared to the
conventional methods, is not only preferred in terms of cost and time, but it is able to provide an overall
vision of the system and its methodology.

2.1. SOC calculations


At the first glance, the charging mode is basically a proportion of the electric charge stored as the
total load that can be stored in the battery. Suppose that we have a battery that already has Q(t0) energy and
now charge it with the charging flow Ib(t). In this case, the amount of load delivered to the battery is:
t

I
t0
I b ( )d 
1

On the other hand, if the battery is completely devoid of energy, the total load that can be stored in the
battery is:

(2)
Q 0   I I b ( )d 
0

In (1) and (2), parameter ƞI demonstrate the battery efficiency which is dependent on the battery
flow because during the charging process some of electric power is wasted in the battery. ƞI ≤ 1indicates
charging and ƞI = 1 indicates discharging current. Using the above definition, the charging mode is
defined by:
t

SOC (t )  SOC (t 0 )
I
t0
I b ( )d 
100 (3)
Q0

In (3), SOC (t0) = Q(t0)/Q0 is the primary state of the battery charge, Q(t0) is the electrical charge in t0 time
and Q0 is the total electrical charge which can be stored in battery.

Developing a battery monitoring system software in matlab simulink … (Alireza Rahighi)


4  ISSN: 2252-8792

However, the striking point is not the availability of the battery's primary charging mode in most
applications that are continually being used. It should be noted that the equation (1-3) is one of the direct
methods of measuring battery charging in the laboratory and other methods of battery charging method will
be briefly introduced later. As discussed, many approaches have been used to obtain SOC, such as using
special sensors or using classical and smart algorithms. Each of these algorithms have their own advantages
and drawbacks.

2.2. SOC estimation algorithm


According to Robin A. Jackey [18], a model-based SOC estimation algorithm for an electrical vehicle
is consisted of several steps. The first step is specifying the electrical architecture of the system. The next
step is to test the components. The developing a system model and building a test vehicle. Then, the
validation of the system model is needed. After that, the design should be optimized through the simulation.
At the next step, the test vehicle should be modified and the optimal components should be specified. Finally,
the system performance will be modified. This algorithm has been partially used in this research.

2.3. Battery monitoring software (BMS) sections


In a typical BMS [19], a number of battery cells, which form a battery pack, are studied. The load
(or charging) current is received as one of the input parameters of the software and is applied to the
controller. The controller also deals with the battery charging unit and the thermal processing unit in
exchange of information. Also, safety control and remote control sections are applicable to the system. The
output of this software will be visible on a screen and can also be shared via a CAN communication interface
or saved in a memory.

2.4. Description of the reviewed device


The reviewed system of this project is a lead-acid traction battery. These batteries are widely used in
electric forklift. Lead-acid traction batteries may also be used in some electric cars and operational devices.
All electric forklift batteries are composed of 2 volts cells and they are usually in 24, 36, 48, 72, 80, and
double 40 Volts voltage and are in different Amp-Hour from 300 to 1000 Amp-Hours. The key point is that
all batteries voltage is a multiple of 2. In our reviewed device, nominal voltage is 24 Volts which is
composed of 12 cells of 2 Volts and nominal capacity is 500 Amp-Hours. The mentioned specifications are
represented in Table1.

Table 1. Reviewed Battery Specification


Battery type Lead-acid
Battery model Traction
Nominal voltage 24 volt
Capacity 500 amp-hour
Battery arrangement 12 two-volts cells

3. SOFTWARE DESCRIPTION AND RESULTS


In this chapter, the steps of project, different parts of software and its environment will be described.
At the end, charts and outputs results is also provided.

3.1. System implementation


At first, Matlab GUI had been used to implement this project but due to this method limitations on
this case, the Simulink environment of Matlab was chosen after all. Battery model was simulated as real
battery using Simulink environment. Furthermore, a particular Kalman filter model was designed for the
battery of project.

3.2. Simulink environment


The overview of the Simulink environment in Matlab has been shown in Figure 3. The main parts of
this software is as follows:
a. Graphical interface of the software (dashboard panel)
b. Dynamic model of battery
c. Kalman filter
d. Presentation and data analysis tools

Int J Appl Power Eng, Vol. 8, No. 1, April 2019: 1 – 10


Int J Appl Power Eng ISSN: 2252-8792  5

Figure 3. Battery monitoring system in matlab/simulink environment

3.3. Graphical interface of the softwere


Graphical interface includes different tools due to monitoring and control needs of system which has
been shown on Figure 4. This graphical interface is able to show the outputs and also receive commands to
change some parameters. In this section, the software process the received information of simulation and
convert them into data which will be shown in monitoring panel. This information will be displayed online at
the same time with the simulation runs and the ability to receive online information during the simulation is
also provided. Figure 4 shows the different parts of the dashboard panel whose various components are:
1) Online display of battery charging signal
2) Online display of voltage signal per time
3) Online marker of battery recharge moment (SOC)
4) Online marker of the battery status (charging and discharging)
5) Online marker of terminal voltage monitor
6) Online marker of charge/discharge flow rate
7) Marker of the remaining period until full charge and full battery discharge
8) Marker of the battery 's internal temperature
9) Marker of total battery charging times
10) Settings panel to set the parameters of the simulation parameters including ambient temperature, battery
type, charging method, battery discharge times (for battery life calculation) and load flow (if not
determining charge)
11) Switch for the charge state among pre-determined states
12) Indicator of current voltage and current diagrams

Developing a battery monitoring system software in matlab simulink … (Alireza Rahighi)


6  ISSN: 2252-8792

Figure 4. Graphical interface of the software

3.4. Graphical interface of the softwere


As described earlier, in this project the battery consists of 12 serial batteries of 2 Volts that provide a
total voltage of 24 Volts. As can be seen in Figure 5, in the battery model, the 12 cells are serialized. At this
point the ambient temperature is applied as an input to the system.

Figure 5. Baterry cells

By opening each of these battery cells, the dynamic model of the battery, which is simulated
according to the reference, is shown. The dynamic model of each 2 Volts individual battery cell is represented
in Figure 6. The values of each of the parameters of the model, including the Em, values of resistance,
capacitors etc. are calculated according to the reference and determined for the blocks.

Int J Appl Power Eng, Vol. 8, No. 1, April 2019: 1 – 10


Int J Appl Power Eng ISSN: 2252-8792  7

Figure 6. Dynamic model of the battery simulated in Matlab/ Simulink

3.5. Kalman filter


In Figure 7, the section which describes the computation of Kalman filtering in the software is
visible. In this section, the charge is collected by random noise in order to obtain an estimate of the charge,
and the difference of this value is multiplied by the amount of the next state in a Kalaman gain (obtained by
experiment and observation). This value is applied as an input to the dynamic model of the battery. Next, the
charging state output which is received from dynamic battery is used to determine the values of the next
state. In this project, Kalman gain is considered equal to 0.2 according to references.

Figure 7. Kalman filter simulation

Developing a battery monitoring system software in matlab simulink … (Alireza Rahighi)


8  ISSN: 2252-8792

3.6. Presentation and data analysis tools


Scopes and software measurement tools are shown in Figure 8. Most of these information are
displayed on the dashboard. However, presentation and data analysis tools can be used to observe some of
the charts.

Figure 8. Measurement and data analyzing tools

3.7. Other files of the software


In this project, in addition to the original file in Matlab Simulink, other files performs some other
tasks in the software. These files are:
a. MakeDifault.m: The values of different system parameters, including Kalman filter parameters and the
battery model are stored in this file. In case of any change in the values of these parameters, by
executing this file, changed values will be returned to the original standard values.
b. InitialChargeChange: This file allows the user to determine the desired initial charging value for the
start of the simulation. It should be noted that the amount of charging is saved every time the software is
run and it will be available for the next time the software is executed.
c. ChangeSitting.m: Using this file, it is possible to change the parameters of the battery model and
Kalman filter.

4. PROJECT EXECUTION
The dashboard panel opens with execution of Simulink project. In this panel, the charging or
discharging state of the battery, the amount of charging flow, ambient temperature, and charging pattern can
be set arbitrary. By executing this file, the battery will charge or discharge based on the usage of it, and the
corresponding parameters are displayed on the monitors.
The amount of the charge and remaining time to complete charge or discharge are some of the
parameters presented in this section. Furthermore, it is possible to observe the charging diagrams, discharge
depth, flow and voltage from the scope of the program. For example, as is shown in Figure 9. the battery
starts to charge from about 50 percent and it takes about 7 hours to take full charge. In this case, the terminal
voltage is 29.16V and the internal temperature of the battery is 25 Degrees Centigrades.

Int J Appl Power Eng, Vol. 8, No. 1, April 2019: 1 – 10


Int J Appl Power Eng ISSN: 2252-8792  9

Figure 9. An example of the program application

5. CONCLUSION
In this project, a software was developed to estimate the charging of a lead-acid battery. Using the
dynamic model of the battery and the Kalman filter method the software is able to estimate the charge state
(SOC), discharge depth (DOD), terminal voltage, battery internal temperature and residual duration to charge
or discharge.
The dynamic model presented in the literature is used for developing this software in Simulink
environment of Matlab. This model can be applied to any kind of battery without requiring substantial
changes. This software has the ability to perform desired calculations by connecting to a real battery and
calculate desired parameters. Due to experimental observations of the existing battery and comparison with
the software outputs, it can be said that the accuracy of the results obtained from this software are acceptable
and near to real numbers.
In this project, the battery was simulated using the proposed dynamic model in the reference and the
results obtained for the parameters were compared with actual values. It is suggested that in later studies the
following items should be considered to complete the research carried out in this project:
a. Using the actual battery and connect it to the software to perform accurate verification tests and compare
the values obtained in the simulation mode.
b. Using more advanced algorithms such as reduced Kalman filtering algorithm, or different values for
Kalman gain and compare the results.
c. Using other methods for estimating battery charging , such as fuzzy method or genetic algorithm, and
compare the results
d. Exploreing the impact of environmental conditions on battery performance

REFERENCES
[1] E. Meissner and G. Richter, "Vehicle electric power systems are under change Implications for design, monitoring
and management of automotive batteries," Journal of Power Sources, No. 95, pp. 13-23, 2001. vol 95, no 1–2, pp.
13-23, March 2001.
[2] S. Piller, M. Perrin and A. Jossen, "Methodes for state-of-charge determination and their applications," Journal of
Power Sources, vol. 96, no. 1, pp. 113-120, 2001.
[3] H. He, R. Xiong, X. Zhang, F. Sun and J. Fan, "State-of-Charge Estimation of the Lithium-Ion Battery Using an
Adaptive Extended Kalman Filter Based on an Improved Thevenin Model," in IEEE Transactions on Vehicular
Technology, vol. 60, no. 4, pp. 1461-1469, May 2011.
[4] Francois B., Hissel D., Iqbal T., "Dynamic modelling of a fuel cell and wind turbine DC-linked power system,"
Electrimacs Conference, 2005.
[5] El Mehdi Laadissi, Anas El Filali, Malika Zazi, "A Nonlinear TSNN Based Model of a Lead Acid Battery,"
Bulletin of Electrical Engineering and Informatics, vol. 7, no. 2, pp. 169-175, June 2018.

Developing a battery monitoring system software in matlab simulink … (Alireza Rahighi)


10  ISSN: 2252-8792

[6] V. Pop, H. J. Bergveld, J. H. G. Op het Veld, "Modeling Battery Behavior for Accurate State-of-Charge
Indication," The Netherlands. Philips Research Laboratories, 2006.
[7] W. Su, H. Eichi, W. Zeng, and M. Y. Chow, "A Survey on the Electrification of Transportation in a Smart Grid
Environment," IEEE Transactions on Industrial Informatics, vol. 8, pp. 1-10, 2012.
[8] F. Huet, "A review of impedance measurements for determination of the state-of-charge or state-of-health of
secondary batteries," Journal of Power Sources, vol. 70, pp. 59-69, 1998.
[9] J. Alzieu, H. Smimite, and C. Glaize, "Improvement of intelligent battery controller: state-of-charge indicator and
associated functions," Journal of Power Sources, vol. 67, pp. 157-161, 1997.
[10] G. L. Plett, "Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs: Part 3.
State and parameter estimation," Journal of Power Sources, vol. 134, pp. 277-292, 2004.
[11] I.-S. Kim, "A novel state of charge estimation method for lithium battery using sliding mode observer," Journal of
Power Sources, vol 163, no. 1, pp. 584-590, 2006.
[12] Shuo Pang, J. Farrell, Jie Du and M. Barth, "Battery state-of-charge estimation," Proceedings of the 2001 American
Control Conference. (Cat. No.01CH37148), Arlington, VA, USA, 2001, pp. 1644-1649.
[13] B. S. Bhangu, P. Bentley, D. A. Stone and C. M. Bingham, "Nonlinear observers for predicting state-of-charge and
state-of-health of lead-acid batteries for hybrid-electric vehicles," in IEEE Transactions on Vehicular Technology,
vol. 54, no. 3, pp. 783-794, May 2005.
[14] G. L. Plett, " Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs: Part 2.
Modeling and identification," Journal of Power Sources, vol 134, no 2, pp. 262-276, August 2004.
[15] G. L. Plett, "Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs, Part 3.
State and Prameter estimation," Journal of Power Sources, vol 134, no 2, pp. 277-292, August 2004.
[16] G. L. Plett, "LiPB dynamic cell models for Kalman-filter SOC estimation," Proceedings of the 19th International
Battery, Hybrid and Fuel Cell Electric Vehicles Symposium & Exhibition (EVS19), Bousan, pp.1-12, October
2002.
[17] Ahmad Qurthobi, Anggita Bayu Krisna Pambudi, Dudi Darmawan, and Reza Fauzi Iskandar, "Correlation between
Battery Voltage under Loaded Condition and Estimated State of Charge at Valve-Regulated Lead Acid Battery on
Discharge Condition using Open Circuit Voltage Method," International Journal of Power Electronics and Drive
Systems, vol. 9, no. 1, pp. 357 – 364, March 2018.
[18] Robin A. Jackey, "A simple, effective lead-acid battery modeling process for electrical system component
selection," The Mathworks inc, 2007.
[19] Wang Yan, Yin Tian-ming and Liu Bao-jie, "Lead-acid power battery management system basing on Kalman
filtering," 2008 IEEE Vehicle Power and Propulsion Conference, Harbin, 2008, pp. 1-6.

Int J Appl Power Eng, Vol. 8, No. 1, April 2019: 1 – 10

You might also like